Skip to content

Commit

Permalink
mlxsw: spectrum: Prevent overwrite of DCB capability fields
Browse files Browse the repository at this point in the history
The number of supported traffic classes that can have ETS and PFC
simultaneously enabled is not subject to user configuration, so make
sure we always initialize them to the correct values following a set
operation.

Fixes: 8e8dfe9 ("mlxsw: spectrum: Add IEEE 802.1Qaz ETS support")
Fixes: d81a6bd ("mlxsw: spectrum: Add IEEE 802.1Qbb PFC support")
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Ido Schimmel authored and David S. Miller committed Jul 15, 2016
1 parent 7347180 commit 28f5275
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/ethernet/mellanox/mlxsw/spectrum_dcb.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ static int mlxsw_sp_dcbnl_ieee_setets(struct net_device *dev,
return err;

memcpy(mlxsw_sp_port->dcb.ets, ets, sizeof(*ets));
mlxsw_sp_port->dcb.ets->ets_cap = IEEE_8021QAZ_MAX_TCS;

return 0;
}
Expand Down Expand Up @@ -372,6 +373,7 @@ static int mlxsw_sp_dcbnl_ieee_setpfc(struct net_device *dev,
}

memcpy(mlxsw_sp_port->dcb.pfc, pfc, sizeof(*pfc));
mlxsw_sp_port->dcb.pfc->pfc_cap = IEEE_8021QAZ_MAX_TCS;

return 0;

Expand Down

0 comments on commit 28f5275

Please sign in to comment.