Skip to content

vxlan: Support user-defined reserved bits

Petr Machata linux-kselftest netdev 2 versions – Applied

Status from this message: This series was applied to netdev/net-next.git (main)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest11 patches 11 repliesApplied 11/11
  2. v111 patches 5 repliesSuperseded

Changes in v2 from the cover letter

- Patch #11:
- Add the new test to Makefile

Patches in v2 All 11 applied

#Subject and filesSizeRepliesApplied
1/11vxlan: In vxlan_rcv(), access flags through the vxlan netdevicedrivers/net/vxlan/vxlan_core.c+5 -51 replyApplied
2/11vxlan: vxlan_rcv() callees: Move clearing of unparsed flags outdrivers/net/vxlan/vxlan_core.c+7 -91 replyApplied
3/11vxlan: vxlan_rcv() callees: Drop the unparsed argumentdrivers/net/vxlan/vxlan_core.c+16 -151 replyApplied
4/11vxlan: vxlan_rcv(): Extract vxlan_hdr(skb) to a named variabledrivers/net/vxlan/vxlan_core.c+6 -51 replyApplied
5/11vxlan: Track reserved bits explicitly as part of the configurationdrivers/net/vxlan/vxlan_core.c include/net/vxlan.h+31 -111 replyApplied
6/11vxlan: Bump error counters for header mismatchesdrivers/net/vxlan/vxlan_core.c+4 -01 replyApplied
7/11vxlan: vxlan_rcv(): Drop unparseddrivers/net/vxlan/vxlan_core.c+1 -151 replyApplied
8/11vxlan: Add an attribute to make VXLAN header validation configurabledrivers/net/vxlan/vxlan_core.c include/uapi/linux/if_link.h+47 -71 replyApplied
9/11selftests: net: lib: Rename ip_link_master() to ip_link_set_master()tools/testing/selftests/net/fdb_notify.sh tools/testing/selftests/net/lib.sh+4 -41 replyApplied
10/11selftests: net: lib: Add several autodefer helperstools/testing/selftests/net/forwarding/lib.sh tools/testing/selftests/net/lib.sh+39 -71 replyApplied
11/11selftests: forwarding: Add a selftest for the new reserved_bits UAPItools/testing/selftests/net/forwarding/Makefile tools/testing/selftests/net/forwarding/vxlan_reserved.sh+353 -01 replyApplied

Reviews trailers per patch

All 11 patches have a Reviewed-by or Acked-by.

PatchIdo SchimmelMateusz PolchlopekNikolay Aleksandrov
1/11R-b R-b
2/11R-b R-b
3/11R-b R-b
4/11R-b R-b R-b
5/11R-b R-b
6/11R-b R-b
7/11R-b R-b
8/11R-b R-b
9/11R-b R-b
10/11R-b R-b
11/11R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v2 thread

Cover letter [PATCH net-next v2 00/11] vxlan: Support user-defined reserved bits

Currently the VXLAN header validation works by vxlan_rcv() going feature by feature, each feature clearing the bits that it consumes. If anything is left unparsed at the end, the packet is rejected.

Unfortunately there are machines out there that send VXLAN packets with reserved bits set, even if they are configured to not use the corresponding features. One such report is here[1], and we have heard similar complaints from our customers as well.

This patchset adds an attribute that makes it configurable which bits the user wishes to tolerate and which they consider reserved. This was recommended in [1] as well.

A knob like that inevitably allows users to set as reserved bits that are in fact required for the features enabled by the netdevice, such as GPE. This is detected, and such configurations are rejected.

In patches #1..#7, the reserved bits validation code is gradually moved away from the unparsed approach described above, to one where a given set of valid bits is precomputed and then the packet is validated against that.

In patch #8, this precomputed set is made configurable through a new attribute IFLA_VXLAN_RESERVED_BITS.

Patches #9 and #10 massage the testsuite a bit, so that patch #11 can introduce a selftest for the resreved bits feature.

The corresponding iproute2 support is available in [2].

[1] https://lore.kernel.org/netdev/[email protected]/
[2] https://github.com/pmachata/iproute2/commits/vxlan_reserved_bits/

v2:
- Patch #11:
- Add the new test to Makefile

v1 (vs. RFC):
- No changes.

Petr Machata (11):
vxlan: In vxlan_rcv(), access flags through the vxlan netdevice
vxlan: vxlan_rcv() callees: Move clearing of unparsed flags out
vxlan: vxlan_rcv() callees: Drop the unparsed argument
vxlan: vxlan_rcv(): Extract vxlan_hdr(skb) to a named variable
vxlan: Track reserved bits explicitly as part of the configuration
vxlan: Bump error counters for header mismatches
vxlan: vxlan_rcv(): Drop unparsed
vxlan: Add an attribute to make VXLAN header validation configurable
selftests: net: lib: Rename ip_link_master() to ip_link_set_master()
selftests: net: lib: Add several autodefer helpers
selftests: forwarding: Add a selftest for the new reserved_bits UAPI

 drivers/net/vxlan/vxlan_core.c                | 150 +++++---
 include/net/vxlan.h                           |   1 +
 include/uapi/linux/if_link.h                  |   1 +
 tools/testing/selftests/net/fdb_notify.sh     |   6 +-
 .../testing/selftests/net/forwarding/Makefile |   1 +
 tools/testing/selftests/net/forwarding/lib.sh |   7 -
 .../net/forwarding/vxlan_reserved.sh          | 352 ++++++++++++++++++
 tools/testing/selftests/net/lib.sh            |  41 +-
 8 files changed, 497 insertions(+), 62 deletions(-)
 create mode 100755 tools/testing/selftests/net/forwarding/vxlan_reserved.sh
Signature · 1 line
2.47.0