mlxsw: spectrum_buffers: Add struct mlxsw_sp_hdroom
authorPetr Machata <petrm@nvidia.com>
Wed, 16 Sep 2020 06:35:14 +0000 (09:35 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 16 Sep 2020 22:19:29 +0000 (15:19 -0700)
commit3a77f5a2d23aab8b12b74d12ca429cba5b5db317
tree2c15ba15faf2cd0c27101941defb94d901a797f3
parent045e42f3e6b1dd4c78ec82e980894543be86f782
mlxsw: spectrum_buffers: Add struct mlxsw_sp_hdroom

The port headroom handling is currently strewn across several modules and
tricky to follow: MTU, DCB PFC, DCB ETS and ethtool pause all influence the
settings, and then there is the completely separate initial configuraion in
spectrum_buffers. A following patch will implement the dcbnl_setbuffer
callback, which is going to further complicate the landscape.

In order to simplify work with port buffers, the following patches are
going to centralize all port-buffer handling in spectrum_buffers. As a
first step, introduce a (currently empty) struct mlxsw_sp_hdroom that will
keep the configuration parameters, and allocate and free it in appropriate
places.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum.c
drivers/net/ethernet/mellanox/mlxsw/spectrum.h
drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c