public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH net-next 0/3] net: add ndo_update_offloads for offload computation
@ 2026-02-26 11:42 Hangbin Liu
  2026-02-26 11:42 ` [RFC PATCH net-next 1/3] net: add ndo_update_offloads Hangbin Liu
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Hangbin Liu @ 2026-02-26 11:42 UTC (permalink / raw)
  To: netdev
  Cc: Jay Vosburgh, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Sridhar Samudrala, Jiri Pirko,
	Simon Horman, Nikolay Aleksandrov, Ido Schimmel,
	Stanislav Fomichev, Kuniyuki Iwashima, Samiullah Khawaja,
	Ahmed Zaki, Alexander Lobakin, linux-kernel, bridge, Hangbin Liu

Currently, master devices (bonding, bridge, team) manually call
netdev_compute_master_upper_features() scattered throughout their port
add/remove operations. This approach requires each driver to remember
to update features at the right times and leads to code duplication.

The series adds a new ndo_update_offloads callback that is automatically
invoked during feature updates when upper/lower device relationships change.
This centralizes the feature computation flow and removes the burden
from individual drivers.

Changes:
1. Patch 1: Add ndo_update_offloads callback to net_device_ops and invoke
   it from __netdev_update_features()
2. Patch 2: Convert bonding, bridge, and team drivers to use the new
   callback, removing manual feature computation calls
3. Patch 3: Convert net_failover driver, significantly simplifying its
   feature management code

*Discuss*:
1. Should we set ndo_update_offloads after ndo_set_features? Or maybe just
   call netdev_compute_master_upper_features() in ndo_set_features?
2. Do we need to compute the offload feature for hsr?


Hangbin Liu (3):
  net: add ndo_update_offloads
  net: use ndo_update_offloads for bonding/bridge/team
  failover: use .ndo_update_offloads for failover

 drivers/net/bonding/bond_main.c | 10 ++++--
 drivers/net/net_failover.c      | 64 ++++-----------------------------
 drivers/net/team/team_core.c    | 11 +++---
 include/linux/netdevice.h       |  7 ++++
 include/net/net_failover.h      |  7 ----
 net/bridge/br_device.c          |  6 ++++
 net/bridge/br_if.c              |  4 ---
 net/core/dev.c                  | 11 ++++--
 8 files changed, 42 insertions(+), 78 deletions(-)

-- 
2.50.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-02-27  7:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox