OSDN Git Service

mlxsw: spectrum_buffers: Allow pools of infinite size
authorPetr Machata <petrm@mellanox.com>
Thu, 20 Sep 2018 06:21:28 +0000 (09:21 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 20 Sep 2018 14:46:01 +0000 (07:46 -0700)
commitf0024f0d98519f7ff5640ab6f11f102594985038
tree52240e6066dcbe66d7e13c0712fc6089aafc1b3a
parentfe07d723c00db23c1683a994fd57cc9b2aa9aaa2
mlxsw: spectrum_buffers: Allow pools of infinite size

The MC pool should have an infinite size (i.e. no quota).

To that end, add infi_size to the SBPR register and extend
mlxsw_reg_sbpr_pack(). Also add MLXSW_SP_SB_INFI to denote
buffers that should have an infinite size.

Change mlxsw_sp_sb_pr_write() to take as parameter byte size,
instead of cell size, and add the special handling of infinite
buffers. Report pools with infinite size as if they actually
take the full shared buffer size.

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