RFC net: add ndo_update_offloads for offload computation
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest3 patches 2 repliesIn review
Changes from the cover letter
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
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | net: add ndo_update_offloadsinclude/ net/ | +10 | 0 replies | |
| 2/3 | net: use ndo_update_offloads for bonding/bridge/teamdrivers/ drivers/ net/ +2 more | +26 | 1 reply | |
| 3/3 | failover: use .ndo_update_offloads for failoverdrivers/ include/ | +6 | 1 reply |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [RFC PATCH net-next 0/3] net: add ndo_update_offloads for offload computation
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(-)
Signature · 1 line
2.50.1