From: Simon Horman <horms@kernel.org>
To: Jijie Shao <shaojijie@huawei.com>
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, andrew+netdev@lunn.ch, shenjian15@huawei.com,
liuyonglong@huawei.com, chenhao418@huawei.com,
yangshuaisong@h-partners.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH V3 net] net: hns3: fix speed configuration residue after driver reload
Date: Thu, 30 Jul 2026 17:34:40 +0100 [thread overview]
Message-ID: <20260730163440.GE51943@horms.kernel.org> (raw)
In-Reply-To: <87b5d9ec-3a8d-4bca-92d0-53d27beb9e2b@huawei.com>
On Wed, Jul 29, 2026 at 07:45:21PM +0800, Jijie Shao wrote:
>
> on 2026/7/29 19:03, Simon Horman wrote:
> > On Fri, Jul 24, 2026 at 05:30:36PM +0800, Jijie Shao wrote:
> > > After setting a 100G optical port to 40G via ethtool and reloading
> > > the driver, the port remains at 40G instead of reverting to the
> > > firmware default speed of 100G.
> > >
> > > The commit referenced in Fixes: added two overwrites in
> > > hclge_init_ae_dev() for non-copper media, so that optical ports
> > > connected to forced-mode remotes inherit the firmware-preset
> > > autoneg and speed instead of the hardcoded defaults:
> > >
> > > req_autoneg = mac.autoneg
> > > req_speed = mac.speed (when autoneg disabled)
> > >
> > > The autoneg overwrite keeps existing behavior:
> > > hclge_set_autoneg_speed_dup() already uses mac.autoneg (not
> > > req_autoneg) since it was introduced, so autoneg inheritance from
> > > firmware was already in place. This part is kept.
> > The AI-generated review on netdev-ai [1] flags that this isn't strictly
> > true as req_autoneg does appear to be used in hclge_set_autoneg_speed_dup().
> > I don't want to nitpick, but perhaps this is worth clarifying.
> >
> > [1] https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260724093036.426631-1-shaojijie%40huawei.com
>
>
> The intent is to restore the pre-c711f6d1cee9 behavior for non-copper
> media, where the helper read mac.autoneg directly and fiber ports
> inherited firmware autoneg at init. c711f6d1cee9 switched the helper
> to req_autoneg, breaking that inheritance; d9d349c4e8a0 (same patchset)
> added the explicit req_autoneg = autoneg copy to restore
> it, and also added a req_speed = mac.speed copy.
>
> This patch keeps the req_autoneg copy — load-bearing as the sole
> init-time path for non-copper media — and drops the req_speed copy,
> which is the residue source. The commit message wording about the
> helper reading mac.autoneg describes the pre-c711f6d1cee9 state,
> not the current code.
Thanks for clarifying.
In that case all seems to be in order to me.
Reviewed-by: Simon Horman <horms@kernel.org>
next prev parent reply other threads:[~2026-07-30 16:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-24 9:30 [PATCH V3 net] net: hns3: fix speed configuration residue after driver reload Jijie Shao
2026-07-29 11:03 ` Simon Horman
2026-07-29 11:45 ` Jijie Shao
2026-07-30 16:34 ` Simon Horman [this message]
2026-07-30 22:30 ` patchwork-bot+netdevbpf
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=20260730163440.GE51943@horms.kernel.org \
--to=horms@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=chenhao418@huawei.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liuyonglong@huawei.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shaojijie@huawei.com \
--cc=shenjian15@huawei.com \
--cc=yangshuaisong@h-partners.com \
/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