]> 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)
commitd1aba5b101460a389f80b12e360cf96097c9c6e8
treefa4ef6b9781359aeee0f7732a2922155147dba92
parent3a6ee220c1910720e71ebc0a08b1bd0c1397b69d
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