Re: [net-next,v2,1/4] net: use ndo_set_features to set offload features for bonding/bridge/team

From
Hangbin Liu <hidden>
Date
2026-03-16 01:02:12
Also in
bridge, lkml
Reply to
Simon Horman, 2026-03-15
On Sun, Mar 15, 2026 at 04:19:43PM +0000, Simon Horman wrote:
quoted
diff --git a/net/core/dev.c b/net/core/dev.c
index f48dc299e4b2..16b3fc620807 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -8920,6 +8920,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;

 rollback:
Can the feature computation skip updating ancillary fields when features
don't change?

The new architecture routes computation through netdev_change_features() ->
__netdev_update_features() -> ndo_set_features(). However,
__netdev_update_features() has this check:

net/core/dev.c:__netdev_update_features() {
    ...
    if (dev->features == features)
        goto sync_lower;
Ah, yes. In the RFC patch set[1], I wanted to use a new ndo_update_offloads
callback to handle offload updates. But in the formal patch, I thought we
could avoid introducing a new callback and use ndo_set_features directly.
However, it looks like we need to fall back to ndo_update_offloads now.

[1] https://lore.kernel.org/netdev/20260226114208.27774-1-liuhangbin@gmail.com/ (local)

Thanks
Hangbin
Thread (7 messages) 7 messages, 2 authors, last reply 2026-03-16
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help