Patches 1 and 2 fix a problem in which PAUSE frames settings are wrongly
overridden when ieee_setpfc() gets called.
Patch 3 adds a missing rollback in port's creation error path.
Ido Schimmel (3):
mlxsw: spectrum: Do not assume PAUSE frames are disabled
mlxsw: spectrum: Do not override PAUSE settings
mlxsw: spectrum: Add missing DCB rollback in error path
drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 1 +
drivers/net/ethernet/mellanox/mlxsw/spectrum_dcb.c | 10 ++++++----
2 files changed, 7 insertions(+), 4 deletions(-)
--
2.8.2
@@ -351,17 +351,17 @@ static int mlxsw_sp_dcbnl_ieee_setpfc(struct net_device *dev,structieee_pfc*pfc){structmlxsw_sp_port*mlxsw_sp_port=netdev_priv(dev);+boolpause_en=mlxsw_sp_port_is_pause_en(mlxsw_sp_port);interr;-if((mlxsw_sp_port->link.tx_pause||mlxsw_sp_port->link.rx_pause)&&-pfc->pfc_en){+if(pause_en&&pfc->pfc_en){netdev_err(dev,"PAUSE frames already enabled on port\n");return-EINVAL;}err=__mlxsw_sp_port_headroom_set(mlxsw_sp_port,dev->mtu,mlxsw_sp_port->dcb.ets->prio_tc,-false,pfc);+pause_en,pfc);if(err){netdev_err(dev,"Failed to configure port's headroom for PFC\n");returnerr;
@@ -380,7 +380,7 @@ static int mlxsw_sp_dcbnl_ieee_setpfc(struct net_device *dev,err_port_pfc_set:__mlxsw_sp_port_headroom_set(mlxsw_sp_port,dev->mtu,-mlxsw_sp_port->dcb.ets->prio_tc,false,+mlxsw_sp_port->dcb.ets->prio_tc,pause_en,mlxsw_sp_port->dcb.pfc);returnerr;}
We correctly execute mlxsw_sp_port_dcb_fini() when port is removed, but
I missed its rollback in the error path of port creation, so add it.
Fixes: f00817df2b42 ("mlxsw: spectrum: Introduce support for Data Center Bridging (DCB)")
Signed-off-by: Ido Schimmel <redacted>
---
drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 1 +
1 file changed, 1 insertion(+)
The PFCC register is used to configure both PAUSE and PFC frames.
Therefore, when PFC frames are disabled we must make sure we don't
mistakenly also disable PAUSE frames (which might be enabled).
Fix this by packing the PFCC register with the current PAUSE settings.
Note that this register is also accessed via ethtool ops, but there we
are guaranteed to have PFC disabled.
Fixes: d81a6bdb87ce ("mlxsw: spectrum: Add IEEE 802.1Qbb PFC support")
Signed-off-by: Ido Schimmel <redacted>
---
drivers/net/ethernet/mellanox/mlxsw/spectrum_dcb.c | 2 ++
1 file changed, 2 insertions(+)
Thu, Aug 04, 2016 at 04:36:20PM CEST, idosch@mellanox.com wrote:
When ieee_setpfc() gets called, PAUSE frames are not necessarily
disabled on the port.
Check if PAUSE frames are disabled or enabled and configure the port's
headroom buffer accordingly.
Fixes: d81a6bdb87ce ("mlxsw: spectrum: Add IEEE 802.1Qbb PFC support")
Signed-off-by: Ido Schimmel <redacted>
Thu, Aug 04, 2016 at 04:36:21PM CEST, idosch@mellanox.com wrote:
The PFCC register is used to configure both PAUSE and PFC frames.
Therefore, when PFC frames are disabled we must make sure we don't
mistakenly also disable PAUSE frames (which might be enabled).
Fix this by packing the PFCC register with the current PAUSE settings.
Note that this register is also accessed via ethtool ops, but there we
are guaranteed to have PFC disabled.
Fixes: d81a6bdb87ce ("mlxsw: spectrum: Add IEEE 802.1Qbb PFC support")
Signed-off-by: Ido Schimmel <redacted>
Thu, Aug 04, 2016 at 04:36:22PM CEST, idosch@mellanox.com wrote:
We correctly execute mlxsw_sp_port_dcb_fini() when port is removed, but
I missed its rollback in the error path of port creation, so add it.
Fixes: f00817df2b42 ("mlxsw: spectrum: Introduce support for Data Center Bridging (DCB)")
Signed-off-by: Ido Schimmel <redacted>