Skip to content

vxlan metadata device vnifiltering support

Roopa Prabhu netdev 3 versions – Applied

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

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest12 patches 0 repliesApplied 12/12
  2. v212 patches 15 repliesSuperseded
  3. v112 patches 4 repliesSuperseded

Changes in v3 from the cover letter

- incorporate review feedback from Jakub
- move rhashtable declarations to c file
- define and use netlink policy for top level vxlan filter api
- fix unused stats function warning
- pass vninode from vnifilter lookup into stats count function to avoid another lookup (only applicable to vxlan_rcv)
- fix missing vxlan vni delete notifications in vnifilter uninit function
- misc cleanups
- remote dev check for multicast groups added via vnifiltering api

Patches in v3 All 12 applied

#Subject and filesSizeRepliesApplied
1/12vxlan: move to its own directorydrivers/net/Makefile drivers/net/vxlan/Makefile drivers/net/vxlan/vxlan_core.c+8 -10 repliesApplied
2/12vxlan_core: fix build warnings in vxlan_xmit_onedrivers/net/vxlan/vxlan_core.c+8 -10 repliesApplied
3/12vxlan_core: move common declarations to private header filedrivers/net/vxlan/vxlan_core.c drivers/net/vxlan/vxlan_private.h+100 -790 repliesApplied
4/12vxlan_core: move some fdb helpers to non-staticdrivers/net/vxlan/vxlan_core.c drivers/net/vxlan/vxlan_private.h+39 -190 repliesApplied
5/12vxlan_core: make multicast helper take rip and ifindex explicitlydrivers/net/vxlan/vxlan_core.c+21 -160 repliesApplied
6/12vxlan_core: add helper vxlan_vni_in_usedrivers/net/vxlan/vxlan_core.c+28 -180 repliesApplied
7/12rtnetlink: add new rtm tunnel api for tunnel id filteringinclude/uapi/linux/if_link.h include/uapi/linux/rtnetlink.h security/selinux/nlmsgtab.c+39 -10 repliesApplied
8/12vxlan_multicast: Move multicast helpers to a separate filedrivers/net/vxlan/Makefile drivers/net/vxlan/vxlan_core.c drivers/net/vxlan/vxlan_multicast.c +1 more+142 -1240 repliesApplied
9/12vxlan: vni filtering support on collect metadata devicedrivers/net/vxlan/Makefile drivers/net/vxlan/vxlan_core.c drivers/net/vxlan/vxlan_multicast.c +3 more+1147 -320 repliesApplied
10/12selftests: add new tests for vxlan vnifilteringtools/testing/selftests/net/test_vxlan_vnifiltering.sh+579 -00 repliesApplied
11/12drivers: vxlan: vnifilter: per vni statsdrivers/net/vxlan/vxlan_core.c drivers/net/vxlan/vxlan_private.h drivers/net/vxlan/vxlan_vnifilter.c +1 more+128 -90 repliesApplied
12/12drivers: vxlan: vnifilter: add support for stats dumpingdrivers/net/vxlan/vxlan_vnifilter.c include/uapi/linux/if_link.h+110 -70 repliesApplied

Reviews trailers per patch

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

Read the v3 thread

Cover letter [PATCH net-next v3 00/12] vxlan metadata device vnifiltering support

This series adds vnifiltering support to vxlan collect metadata device.

Motivation:
You can only use a single vxlan collect metadata device for a given vxlan udp port in the system today. The vxlan collect metadata device terminates all received vxlan packets. As shown in the below diagram, there are use-cases where you need to support multiple such vxlan devices in independent bridge domains. Each vxlan device must terminate the vni's it is configured for.
Example usecase: In a service provider network a service provider typically supports multiple bridge domains with overlapping vlans. One bridge domain per customer. Vlans in each bridge domain are mapped to globally unique vxlan ranges assigned to each customer.

This series adds vnifiltering support to collect metadata devices to terminate only configured vnis. This is similar to vlan filtering in bridge driver. The vni filtering capability is provided by a new flag on collect metadata device.

In the below pic:
- customer1 is mapped to br1 bridge domain
- customer2 is mapped to br2 bridge domain
- customer1 vlan 10-11 is mapped to vni 1001-1002
- customer2 vlan 10-11 is mapped to vni 2001-2002
- br1 and br2 are vlan filtering bridges
- vxlan1 and vxlan2 are collect metadata devices with vnifiltering enabled

┌──────────────────────────────────────────────────────────────────┐
│  switch                                                          │
│                                                                  │
│         ┌───────────┐                 ┌───────────┐              │
│         │           │                 │           │              │
│         │   br1     │                 │   br2     │              │
│         └┬─────────┬┘                 └──┬───────┬┘              │
│     vlans│         │               vlans │       │               │
│     10,11│         │                10,11│       │               │
│          │     vlanvnimap:               │    vlanvnimap:        │
│          │       10-1001,11-1002         │      10-2001,11-2002  │
│          │         │                     │       │               │
│   ┌──────┴┐     ┌──┴─────────┐       ┌───┴────┐  │               │
│   │ swp1  │     │vxlan1      │       │ swp2   │ ┌┴─────────────┐ │
│   │       │     │  vnifilter:│       │        │ │vxlan2        │ │
│   └───┬───┘     │   1001,1002│       └───┬────┘ │ vnifilter:   │ │
│       │         └────────────┘           │      │  2001,2002   │ │
│       │                                  │      └──────────────┘ │
│       │                                  │                       │
└───────┼──────────────────────────────────┼───────────────────────┘
        │                                  │
        │                                  │
  ┌─────┴───────┐                          │
  │  customer1  │                    ┌─────┴──────┐
  │ host/VM     │                    │customer2   │
  └─────────────┘                    │ host/VM    │
                                     └────────────┘

v2:
- remove stale xstats declarations pointed out by Nikolay Aleksandrov
- squash selinux patch with the tunnel api patch as pointed out by benjamin poirier
- Fix various build issues:

v3:
- incorporate review feedback from Jakub
- move rhashtable declarations to c file
- define and use netlink policy for top level vxlan filter api
- fix unused stats function warning
- pass vninode from vnifilter lookup into stats count function to avoid another lookup (only applicable to vxlan_rcv)
- fix missing vxlan vni delete notifications in vnifilter uninit function
- misc cleanups
- remote dev check for multicast groups added via vnifiltering api

Nikolay Aleksandrov (2):
drivers: vxlan: vnifilter: per vni stats
drivers: vxlan: vnifilter: add support for stats dumping

Roopa Prabhu (10):
vxlan: move to its own directory
vxlan_core: fix build warnings in vxlan_xmit_one
vxlan_core: move common declarations to private header file
vxlan_core: move some fdb helpers to non-static
vxlan_core: make multicast helper take rip and ifindex explicitly
vxlan_core: add helper vxlan_vni_in_use
rtnetlink: add new rtm tunnel api for tunnel id filtering
vxlan_multicast: Move multicast helpers to a separate file
vxlan: vni filtering support on collect metadata device
selftests: add new tests for vxlan vnifiltering

 drivers/net/Makefile                          |   2 +-
 drivers/net/vxlan/Makefile                    |   7 +
 drivers/net/{vxlan.c => vxlan/vxlan_core.c}   | 434 +++-----
 drivers/net/vxlan/vxlan_multicast.c           | 272 +++++
 drivers/net/vxlan/vxlan_private.h             | 162 +++
 drivers/net/vxlan/vxlan_vnifilter.c           | 999 ++++++++++++++++++
 include/net/vxlan.h                           |  54 +-
 include/uapi/linux/if_link.h                  |  49 +
 include/uapi/linux/rtnetlink.h                |   9 +
 security/selinux/nlmsgtab.c                   |   5 +-
 .../selftests/net/test_vxlan_vnifiltering.sh  | 581 ++++++++++
 11 files changed, 2309 insertions(+), 265 deletions(-)
 create mode 100644 drivers/net/vxlan/Makefile
 rename drivers/net/{vxlan.c => vxlan/vxlan_core.c} (94%)
 create mode 100644 drivers/net/vxlan/vxlan_multicast.c
 create mode 100644 drivers/net/vxlan/vxlan_private.h
 create mode 100644 drivers/net/vxlan/vxlan_vnifilter.c
 create mode 100755 tools/testing/selftests/net/test_vxlan_vnifiltering.sh
Signature · 1 line
2.25.1