Skip to content

bonding: remove vlan special handling

Veaceslav Falico netdev 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest13 patches 1 replyIn review
  2. v313 patches 6 repliesSuperseded
  3. v213 patches 3 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v19 patches10 repliesSuperseded

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/13net: rename netdev_upper to netdev_adjacentnet/core/dev.c+12 -120 replies
2/13net: add lower_dev_list to net_device and make a full meshinclude/linux/netdevice.h net/core/dev.c+259 -270 replies
3/13net: remove search_list from netdev_adjacentnet/core/dev.c+1 -360 replies
4/13net: add netdev_upper_get_next_dev_rcu(dev, iter)net/core/dev.c+25 -00 replies
5/13net: add netdev_for_each_upper_dev_rcu()include/linux/netdevice.h+10 -00 replies
6/13bonding: use netdev_upper list in bond_vlan_useddrivers/net/bonding/bonding.h+14 -10 replies
7/13bonding: make bond_arp_send_all use upper device listdrivers/net/bonding/bond_main.c+51 -510 replies
8/13bonding: convert bond_has_this_ip() to use upper devicesdrivers/net/bonding/bond_main.c+13 -120 replies
9/13bonding: use vlan_uses_dev() in __bond_release_one()drivers/net/bonding/bond_main.c+1 -10 replies
10/13bonding: split alb_send_learning_packets()drivers/net/bonding/bond_alb.c+35 -240 replies
11/13bonding: make alb_send_learning_packets() use upper dev listdrivers/net/bonding/bond_alb.c drivers/net/bonding/bond_alb.h+11 -190 replies
12/13bonding: remove vlan_list/current_alb_vlandrivers/net/bonding/bond_alb.c drivers/net/bonding/bond_alb.h drivers/net/bonding/bond_main.c +1 more+2 -1430 replies
13/13bonding: pr_debug instead of pr_warn in bond_arp_send_alldrivers/net/bonding/bond_main.c+6 -80 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.

Read the v4 thread

Cover letter [PATCH net-next v4 0/13] bonding: remove vlan special handling

v1: Per Jiri's advice, remove the exported netdev_upper struct to keep it
inside dev.c only, and instead implement a macro to iterate over the list and return only net_device *.
v2: Jiri noted that we need to see every upper device, but not only the
first level. Modify the netdev_upper logic to include a list of lower devices and for both upper/lower lists every device would see both its first-level devices and every other devices that is lower/upper of it. Also, convert some annoying spamming warnings to pr_debug in bond_arp_send_all.
v3: move renaming part completely to patch 1 (did I forget to git add
before commiting?) and address Jiri's input about comments/style of patch 2.
v4: as Vlad found spotted, bond_arp_send_all() won't work in a config where
we have a device with ip on top of our upper vlan. It fails to send packets because we don't tag the packet, while the device on top of vlan will emit tagged packets through this vlan. Fix this by first searching for all upper vlans, and for each vlan - for the devs on top of it. If we find the dev - then tag the packet with the underling's vlan_id, otherwise just search the old way - for all devices on top of bonding. Also, move the version changes under "---" so they won't get into the commit message, if/when applied.

The aim of this patchset is to remove bondings' own vlan handling as much as possible and replace it with the netdev upper device functionality.

The upper device functionality is extended to include also lower devices and to have, for each device, a full view of every lower and upper device, but not only the first-level ones. This might permit in the future to avoid, for any grouping/teaming/upper/lower devices, to maintain its own lists of slaves/vlans/etc.

This is achieved by adding a helper function to upper dev list handling - netdev_upper_get_next_dev(dev, iter), which returns the next device after the list_head **iter, and sets *iter to the next list_head *. This patchset also adds netdev_for_each_upper_dev(dev, upper, iter), which iterates through the whole dev->upper_dev_list, setting upper to the net_device. The only special treatment of vlans remains in rlb code.

This patchset solves several issues with bonding, simplifies it overall, RCUify further and exports upper list functions for any other users which might also want to get rid of its own vlan_lists or slaves.

I'm testing it continuously currently, no issues found, will update on anything.

CC Vlad Yasevich <[email protected]>
CC Jay Vosburgh <[email protected]>
CC Andy Gospodarek <[email protected]>
CC "David S. Miller" <[email protected]>
CC Eric Dumazet <[email protected]>
CC Jiri Pirko <[email protected]>
CC Alexander Duyck <[email protected]>
CC Cong Wang <[email protected]>
---
 drivers/net/bonding/bond_alb.c  |  75 +++++----
 drivers/net/bonding/bond_alb.h  |   2 -
 drivers/net/bonding/bond_main.c | 272 +++++++++----------------------
 drivers/net/bonding/bonding.h   |  21 ++-
 include/linux/netdevice.h       |  11 ++
 net/core/dev.c                  | 345 ++++++++++++++++++++++++++++++++--------
 6 files changed, 416 insertions(+), 310 deletions(-)