]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit122386dfe87e0f587ef753c9907060c786e4cb50
treefa4ef6b9781359aeee0f7732a2922155147dba92
parent678c4372d056ef3934eae72e376a6bb4c0d7aaa4
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