mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Petr Machata <petrm@nvidia.com>
To: Wentao Liang <vulab@iscas.ac.cn>
Cc: <idosch@nvidia.com>, <petrm@nvidia.com>, <andrew+netdev@lunn.ch>,
	<davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>,
	<pabeni@redhat.com>, <netdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mlxsw: spectrum: Reset lossiness configuration when changing MTU
Date: Thu, 15 May 2025 12:04:36 +0200	[thread overview]
Message-ID: <877c2iuqij.fsf@nvidia.com> (raw)
In-Reply-To: <20250514082900.239-1-vulab@iscas.ac.cn>


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);


      reply	other threads:[~2025-05-15 10:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-14  8:28 Wentao Liang
2025-05-15 10:04 ` Petr Machata [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877c2iuqij.fsf@nvidia.com \
    --to=petrm@nvidia.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=idosch@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=vulab@iscas.ac.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®