From: Hangbin Liu <liuhangbin@gmail.com>
To: netdev@vger.kernel.org
Cc: Jay Vosburgh <jv@jvosburgh.net>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Sridhar Samudrala <sridhar.samudrala@intel.com>,
Jiri Pirko <jiri@resnulli.us>, Simon Horman <horms@kernel.org>,
Nikolay Aleksandrov <razor@blackwall.org>,
Ido Schimmel <idosch@nvidia.com>,
Stanislav Fomichev <sdf@fomichev.me>,
Kuniyuki Iwashima <kuniyu@google.com>,
Samiullah Khawaja <skhawaja@google.com>,
Alexander Lobakin <aleksander.lobakin@intel.com>,
linux-kernel@vger.kernel.org, bridge@lists.linux.dev
Subject: Re: [RFC PATCH net-next 2/3] net: use ndo_update_offloads for bonding/bridge/team
Date: Fri, 27 Feb 2026 07:53:46 +0000 [thread overview]
Message-ID: <aaFNilMyFaD9cA2u@fedora> (raw)
In-Reply-To: <20260226114208.27774-3-liuhangbin@gmail.com>
On Thu, Feb 26, 2026 at 11:42:07AM +0000, Hangbin Liu wrote:
> Convert bonding, bridge, and team drivers to use the new
> ndo_update_offloads callback instead of manually calling
> netdev_compute_master_upper_features() during port add/remove operations.
>
> This change centralizes the feature computation flow:
>
> Before:
> - netdev_compute_master_upper_features()
> - compute offload features
> - netdev_change_features()
> - __netdev_update_features()
> - update other features
>
> After:
> - netdev_master_upper_dev_link()
> - __netdev_upper_dev_link()
> - netdev_change_features()
> - __netdev_update_features()
> - ndo_update_offloads()
> - netdev_compute_master_upper_features()
> - update other features
>
> This ensures offload features are computed automatically when
> upper/lower device links change, removing the need for manual
> feature computation calls in the driver code.
>
> The netdev_change_features() call in team_uninit() is also removed
> since it calls team_port_del() for each port, which now triggers
> feature updates automatically.
>
> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
> ---
> drivers/net/bonding/bond_main.c | 10 +++++++---
> drivers/net/team/team_core.c | 11 +++++++----
> net/bridge/br_device.c | 6 ++++++
> net/bridge/br_if.c | 4 ----
> net/core/dev.c | 8 ++++++--
> 5 files changed, 26 insertions(+), 13 deletions(-)
>
> diff --git a/net/core/dev.c b/net/core/dev.c
> index d05837c0713a..7043ee022980 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -8893,6 +8893,9 @@ static int __netdev_upper_dev_link(struct net_device *dev,
> __netdev_walk_all_upper_dev(upper_dev, __netdev_update_lower_level,
> priv);
>
> + /* re-compute all features after adding link */
> + netdev_change_features(upper_dev);
> +
> return 0;
Another benefit for this change is, after calling netdev_change_features() here,
the later netdev_sync_lower_features() will disable LRO automatically.
So we don't need to call dev_disable_lro() manually in
bonding/bridge/team/VLAN. I will add this patch in next version.
Hangbin
next prev parent reply other threads:[~2026-02-27 7:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-26 11:42 [RFC PATCH net-next 0/3] net: add ndo_update_offloads for offload computation Hangbin Liu
2026-02-26 11:42 ` [RFC PATCH net-next 1/3] net: add ndo_update_offloads Hangbin Liu
2026-02-26 11:42 ` [RFC PATCH net-next 2/3] net: use ndo_update_offloads for bonding/bridge/team Hangbin Liu
2026-02-27 7:53 ` Hangbin Liu [this message]
2026-02-26 11:42 ` [RFC PATCH net-next 3/3] failover: use .ndo_update_offloads for failover Hangbin Liu
2026-02-26 12:48 ` Hangbin Liu
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=aaFNilMyFaD9cA2u@fedora \
--to=liuhangbin@gmail.com \
--cc=aleksander.lobakin@intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=bridge@lists.linux.dev \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=idosch@nvidia.com \
--cc=jiri@resnulli.us \
--cc=jv@jvosburgh.net \
--cc=kuba@kernel.org \
--cc=kuniyu@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=razor@blackwall.org \
--cc=sdf@fomichev.me \
--cc=skhawaja@google.com \
--cc=sridhar.samudrala@intel.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 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.