OSDN Git Service

mlxsw: spectrum_buffers: Convert mlxsw_sp_port_headroom_init()
authorPetr Machata <petrm@nvidia.com>
Wed, 16 Sep 2020 06:35:26 +0000 (09:35 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 16 Sep 2020 22:19:30 +0000 (15:19 -0700)
commit0cda1a9b452333fbb4d74636de0a92f128972fd0
treefa4ef6b9781359aeee0f7732a2922155147dba92
parentbd3e86a5be721786f7967d64c2c99617637dbe43
mlxsw: spectrum_buffers: Convert mlxsw_sp_port_headroom_init()

Currently mlxsw_sp_port_headroom_init() configures both priomap and buffers
by hand. Additionally, for port buffers, it configures buffer 0 with a size
that it will never again have if PFC configuration is touched.

Rewrite the init code to become a client of the new hdroom code. The only
difference in invocation is that the configuration is forced, so that it is
issued even if the desired configuration happens to match what is contained
in (hitherto not initialized with meaningful values) mlxsw_sp_port->hdroom.

Since now mlxsw_sp_port_headroom_init() initializes all the PG buffers to
meaningful values, mlxsw_sp_hdroom_configure_buffers() can avoid querying
the current configuration, and can fill the whole PBMC itself.

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_buffers.c