From: Zhud <zhud@hygon.cn>
To: Eric Dumazet <edumazet@google.com>
Cc: Paolo Abeni <pabeni@redhat.com>,
"davem@davemloft.net" <davem@davemloft.net>,
"kuba@kernel.org" <kuba@kernel.org>,
"horms@kernel.org" <horms@kernel.org>,
"andrew+netdev@lunn.ch" <andrew+netdev@lunn.ch>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
Jing Li <lijing@hygon.cn>, Zhiwei Ying <yingzhiwei@hygon.cn>
Subject: RE: [PATCH net] netdev: increment TSO only if TSO is not enabled on any slave device
Date: Wed, 24 Dec 2025 00:48:36 +0000 [thread overview]
Message-ID: <355e6f707b57413098af339d0bd6dcba@hygon.cn> (raw)
In-Reply-To: <CANn89i+p0UX1VW9Pm6_B5tJ-_b_iwJP5Dkk_Agnf+46FD2jY-g@mail.gmail.com>
>
> On Tue, Dec 23, 2025 at 1:20 PM Zhud <zhud@hygon.cn> wrote:
> >
> >
> > > On 12/16/25 9:52 AM, Di Zhu wrote:
> > > > Unconditionally increment the TSO flag has a side effect: it will
> > > > also
> > >
> > > This changelog is IMHO quite confusing. The code does not 'increment
> > > TSO'. Instead it increments the features set to include ALL_TSO.
> > >
> > > Please reword the changelog accordingly.
> > >
> > > > directly clear the flags in NETIF_F_ALL_FOR_ALL on the master
> > > > device, which can cause issues such as the inability to enable the
> > > > nocache copy feature on the bonding network card.
> > >
> > > bonding network card -> bonding driver.
> > >
> > > > So, when at least one slave device's TSO is enabled, there is no
> > > > need to explicitly increment the TSO flag to the master device.
> > > >
> > > > Fixes: b0ce3508b25e ("bonding: allow TSO being set on bonding
> > > > master")
> > > > Signed-off-by: Di Zhu <zhud@hygon.cn>
> > > > ---
> > > > include/linux/netdevice.h | 3 ++-
> > > > 1 file changed, 2 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> > > > index bf99fe8622da..2aca39f7f9e1 100644
> > > > --- a/include/linux/netdevice.h
> > > > +++ b/include/linux/netdevice.h
> > > > @@ -5322,7 +5322,8 @@ netdev_features_t
> > > > netdev_increment_features(netdev_features_t all, static inline
> > > netdev_features_t netdev_add_tso_features(netdev_features_t
> > > features,
> > > >
> > > > netdev_features_t mask) {
> > > > - return netdev_increment_features(features, NETIF_F_ALL_TSO, mask);
> > > > + return (features & NETIF_F_ALL_TSO) ? features :
> > > > + netdev_increment_features(features, NETIF_F_ALL_TSO,
> > > > + mask);
> > >
> > > NETIF_F_ALL_TSO is not a single bit, but a (later large) bit mask;
> > > the above will yield incorrect result when:
> > >
> > > features & NETIF_F_ALL_TSO != NETIF_F_ALL_TSO
> >
> > Yes, it is indeed necessary to set all tso flags to avoid GSO at the bonding layer.
> > I will revise the code and its related changlong, thanks.
>
> What about this instead ?
>
> static inline netdev_features_t
> netdev_add_tso_features(netdev_features_t features,
>
> netdev_features_t mask) {
> - return netdev_increment_features(features, NETIF_F_ALL_TSO, mask);
> + return netdev_increment_features(features, NETIF_F_ALL_TSO |
> + NETIF_F_ALL_FOR_ALL, mask);
> }
Yes, I also want to do it this way.
prev parent reply other threads:[~2025-12-24 0:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-16 8:52 [PATCH net] netdev: increment TSO only if TSO is not enabled on any slave device Di Zhu
2025-12-23 10:54 ` Paolo Abeni
2025-12-23 12:20 ` Zhud
2025-12-23 14:47 ` Eric Dumazet
2025-12-24 0:48 ` Zhud [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=355e6f707b57413098af339d0bd6dcba@hygon.cn \
--to=zhud@hygon.cn \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=lijing@hygon.cn \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=yingzhiwei@hygon.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;
as well as URLs for NNTP newsgroup(s).