* [PATCH] mlxsw: spectrum: Reset lossiness configuration when changing MTU
@ 2025-05-14 8:28 Wentao Liang
2025-05-15 10:04 ` Petr Machata
0 siblings, 1 reply; 2+ messages in thread
From: Wentao Liang @ 2025-05-14 8:28 UTC (permalink / raw)
To: idosch, petrm, andrew+netdev, davem, edumazet, kuba, pabeni
Cc: netdev, linux-kernel, Wentao Liang
The function mlxsw_sp_port_change_mtu() reset the buffer sizes but does
not reset the lossiness configuration of the buffers. This could lead to
inconsistent lossiness settings. A proper implementation can be found
in mlxsw_sp_port_headroom_ets_set().
Add lossiness reset by calling mlxsw_sp_hdroom_bufs_reset_lossiness().
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
index 3f5e5d99251b..54aa1dca5076 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
@@ -797,6 +797,7 @@ static int mlxsw_sp_port_change_mtu(struct net_device *dev, int mtu)
hdroom = orig_hdroom;
hdroom.mtu = mtu;
+ mlxsw_sp_hdroom_bufs_reset_lossiness(&hdroom);
mlxsw_sp_hdroom_bufs_reset_sizes(mlxsw_sp_port, &hdroom);
err = mlxsw_sp_hdroom_configure(mlxsw_sp_port, &hdroom);
--
2.42.0.windows.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mlxsw: spectrum: Reset lossiness configuration when changing MTU
2025-05-14 8:28 [PATCH] mlxsw: spectrum: Reset lossiness configuration when changing MTU Wentao Liang
@ 2025-05-15 10:04 ` Petr Machata
0 siblings, 0 replies; 2+ messages in thread
From: Petr Machata @ 2025-05-15 10:04 UTC (permalink / raw)
To: Wentao Liang
Cc: idosch, petrm, andrew+netdev, davem, edumazet, kuba, pabeni,
netdev, linux-kernel
Wentao Liang <vulab@iscas.ac.cn> writes:
> The function mlxsw_sp_port_change_mtu() reset the buffer sizes but does
> not reset the lossiness configuration of the buffers. This could lead to
> inconsistent lossiness settings. A proper implementation can be found
> in mlxsw_sp_port_headroom_ets_set().
>
> Add lossiness reset by calling mlxsw_sp_hdroom_bufs_reset_lossiness().
Thanks for the patch.
Can you explain a little bit more about what issues not resetting
lossiness leads to?
mlxsw_sp_hdroom_bufs_reset_lossiness() changes buffer lossiness based on
lossiness of individual priorities, and priority-to-buffer mapping. It
needs to be called when either of these changes, such as in
mlxsw_sp_port_headroom_ets_set(), or when lossiness of a priority
changes, such as in mlxsw_sp_dcbnl_ieee_setpfc().
Since neither changes here, I would think that the call is just a NOP.
> Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
> ---
> drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
> index 3f5e5d99251b..54aa1dca5076 100644
> --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
> +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
> @@ -797,6 +797,7 @@ static int mlxsw_sp_port_change_mtu(struct net_device *dev, int mtu)
>
> hdroom = orig_hdroom;
> hdroom.mtu = mtu;
> + mlxsw_sp_hdroom_bufs_reset_lossiness(&hdroom);
> mlxsw_sp_hdroom_bufs_reset_sizes(mlxsw_sp_port, &hdroom);
>
> err = mlxsw_sp_hdroom_configure(mlxsw_sp_port, &hdroom);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-05-15 10:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-14 8:28 [PATCH] mlxsw: spectrum: Reset lossiness configuration when changing MTU Wentao Liang
2025-05-15 10:04 ` Petr Machata
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.