lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <877c2iuqij.fsf@nvidia.com>
Date: Thu, 15 May 2025 12:04:36 +0200
From: Petr Machata <petrm@...dia.com>
To: Wentao Liang <vulab@...as.ac.cn>
CC: <idosch@...dia.com>, <petrm@...dia.com>, <andrew+netdev@...n.ch>,
	<davem@...emloft.net>, <edumazet@...gle.com>, <kuba@...nel.org>,
	<pabeni@...hat.com>, <netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] mlxsw: spectrum: Reset lossiness configuration when
 changing MTU


Wentao Liang <vulab@...as.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@...as.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);


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ