]> git.baikalelectronics.ru Git - kernel.git/commit
mlxsw: spectrum_buffers: Introduce shared buffer ops
authorPetr Machata <petrm@nvidia.com>
Wed, 16 Sep 2020 06:35:27 +0000 (09:35 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 16 Sep 2020 22:19:30 +0000 (15:19 -0700)
commit3a51bead7c75698689f4c64eef2b800b0ab7256a
tree7d395477db397bbbf5485783f5d1016ef303cecf
parentd1aba5b101460a389f80b12e360cf96097c9c6e8
mlxsw: spectrum_buffers: Introduce shared buffer ops

The size of the internal buffer is currently calculated in the SPAN module.
Logically it belongs to the spectrum_buffers module, where it should be
moved. However, that being a chip-specific operation, it needs dynamic
dispatch. There currently is a chip-specific structure for description of
shared buffer values, struct mlxsw_sp_sb_vals. However placing ops into
this structure would be confusing. Therefore introduce a new per-chip
structure, currently empty, and initialize the ops pointer as appropriate.

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