Skip to content

bonding: add an option to rely on unvalidated arp packets

Veaceslav Falico netdev 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest12 patches 2 repliesIn review
  2. v412 patches 8 repliesSuperseded
  3. v312 patches 3 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v2 posting 2/20 of 12 patches0 repliesSuperseded
v2 posting 1/212 patches5 repliesSuperseded

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12bonding: remove bond->lock from bond_arp_rcvdrivers/net/bonding/bond_main.c+0 -31 reply
2/12bonding: permit using arp_validate with non-ab modesDocumentation/networking/bonding.txt drivers/net/bonding/bond_main.c drivers/net/bonding/bond_options.c+5 -81 reply
3/12bonding: always update last_arp_rx on packet recievedrivers/net/bonding/bond_main.c+2 -00 replies
4/12bonding: always set recv_probe to bond_arp_rcv in arp monitordrivers/net/bonding/bond_main.c drivers/net/bonding/bond_options.c+2 -40 replies
5/12bonding: extend arp_validate to be able to receive unvalidated arp-only trafficdrivers/net/bonding/bond_options.c drivers/net/bonding/bonding.h+19 -50 replies
6/12bonding: document the new _arp options for arp_validateDocumentation/networking/bonding.txt+66 -300 replies
7/12bonding: use the new options to correctly set last_arp_rxdrivers/net/bonding/bond_main.c+8 -70 replies
8/12bonding: use last_arp_rx in slave_last_rx()drivers/net/bonding/bonding.h+3 -70 replies
9/12bonding: use last_arp_rx in bond_loadbalance_arp_mon()drivers/net/bonding/bond_main.c+2 -20 replies
10/12bonding: remove useless updating of slave->dev->last_rxdrivers/net/bonding/bond_main.c include/linux/netdevice.h+1 -100 replies
11/12bonding: trivial: rename slave->jiffies to ->last_link_updrivers/net/bonding/bond_main.c drivers/net/bonding/bonding.h+12 -110 replies
12/12bonding: rename last_arp_rx to last_rxdrivers/net/bonding/bond_main.c drivers/net/bonding/bonding.h+8 -80 replies

Reviews trailers per patch

2 of 12 patches have a Reviewed-by or Acked-by.

PatchNikolay AleksandrovDing Tianhong
1/12A-b
2/12A-b
3/12
4/12
5/12
6/12
7/12
8/12
9/12
10/12
11/12
12/12

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [PATCH v5 net-next 0/12] bonding: add an option to rely on unvalidated arp packets
Quoted 4 lines · Veaceslav Falico

From Veaceslav Falico <[email protected]> # This line is ignored.
From: Veaceslav Falico <[email protected]>
Subject: [PATCH v5 net-next 0/12] bonding: add an option to rely on unvalidated arp packets In-Reply-To:

Nice, cover letter got fucked up, sorry for that. Patches are ok though.

Quoted 69 lines

Hi,

v4 -> v5:
Again per Nik's advise correct the bond_opts restrictions for arp_validate
- set it the same as arp_interval.

v3 -> v4:
Per Nikolay's advise, remove the new bond_opts restriction on modes setting for arp_validate.

v2 -> v3:
Per Jay's advise, use the 'filter' keyword instead of 'arp' one, and use his text for documentation. Also, rebase on the latest net-next. Sorry for the delay, didn't manage to send it before net-next was closed.

v1 -> v2:
Don't remove the 'all traffic' functionality - rather, add new arp_validate options to specify that we want *only* unvalidated arps.

Currently, if arp_validate is off (0), slave_last_rx() returns the slave->dev->last_rx, which is always updated on *any* packet received by slave, and not only arps. This means that, if the validation of arps is off, we're treating *any* incoming packet as a proof of slave being up, and not only arps.

This might seem logical at the first glance, however it can cause a lot of troubles and false-positives, one example would be:

The arp_ip_target is NOT accessible, however someone in the broadcast domain spams with any broadcast traffic. This way bonding will be tricked that the slave is still up (as in - can access arp_ip_target), while it's not.

The net_device->last_rx is already used in a lot of drivers (even though the comment states to NOT do it :)), and it's also ugly to modify it from bonding.

However, some loadbalance setups might rely on the fact that even non-arp traffic is a sign of slave being up - and we definitely can't break anyones config - so an extension to arp_validate is needed.

So, to fix this, add an option for the user to specify if he wants to filter out non-arp traffic on unvalidated slaves, remove the last_rx from bonding, *always* call bond_arp_rcv() in slave's rx_handler (which is bond_handle_frame), and if we spot an arp there with this option on - update the slave->last_arp_rx - and use it instead of net_device->last_rx. Finally, rename last_arp_rx to last_rx to reflect the changes.

Also rename slave->jiffies to ->last_link_up, to reflect better its meaning, add the new option's documentation and update the arp_validate one to be a bit more descriptive.

CC Rob Landley <[email protected]>
CC Jay Vosburgh <[email protected]>
CC Andy Gospodarek <[email protected]>
CC "David S. Miller" <[email protected]>
CC dingtianhong <[email protected]>
CC Nikolay Aleksandrov <[email protected]>
CC Neil Horman <[email protected]>
CC Cong Wang <[email protected]>

---

Documentation/networking/bonding.txt | 96 +++++++++++++++++++++++++-----------
drivers/net/bonding/bond_main.c      | 56 +++++++++------------
drivers/net/bonding/bond_options.c   | 19 ++++---
drivers/net/bonding/bonding.h        | 26 ++++++----
include/linux/netdevice.h            |  8 +--
5 files changed, 119 insertions(+), 86 deletions(-)