Skip to content

Commit a3a48de

Browse files
idoschdavem330
authored andcommitted
vxlan: mdb: Add MDB control path support
Implement MDB control path support, enabling the creation, deletion, replacement and dumping of MDB entries in a similar fashion to the bridge driver. Unlike the bridge driver, each entry stores a list of remote VTEPs to which matched packets need to be replicated to and not a list of bridge ports. The motivating use case is the installation of MDB entries by a user space control plane in response to received EVPN routes. As such, only allow permanent MDB entries to be installed and do not implement snooping functionality, avoiding a lot of unnecessary complexity. Since entries can only be modified by user space under RTNL, use RTNL as the write lock. Use RCU to ensure that MDB entries and remotes are not freed while being accessed from the data path during transmission. In terms of uAPI, reuse the existing MDB netlink interface, but add a few new attributes to request and response messages: * IP address of the destination VXLAN tunnel endpoint where the multicast receivers reside. * UDP destination port number to use to connect to the remote VXLAN tunnel endpoint. * VXLAN VNI Network Identifier to use to connect to the remote VXLAN tunnel endpoint. Required when Ingress Replication (IR) is used and the remote VTEP is not a member of originating broadcast domain (VLAN/VNI) [1]. * Source VNI Network Identifier the MDB entry belongs to. Used only when the VXLAN device is in external mode. * Interface index of the outgoing interface to reach the remote VXLAN tunnel endpoint. This is required when the underlay destination IP is multicast (P2MP), as the multicast routing tables are not consulted. All the new attributes are added under the 'MDBA_SET_ENTRY_ATTRS' nest which is strictly validated by the bridge driver, thereby automatically rejecting the new attributes. [1] https://datatracker.ietf.org/doc/html/draft-ietf-bess-evpn-irb-mcast#section-3.2.2 Signed-off-by: Ido Schimmel <[email protected]> Reviewed-by: Nikolay Aleksandrov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 6ab271a commit a3a48de

File tree

6 files changed

+1396
-1
lines changed

6 files changed

+1396
-1
lines changed

drivers/net/vxlan/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44

55
obj-$(CONFIG_VXLAN) += vxlan.o
66

7-
vxlan-objs := vxlan_core.o vxlan_multicast.o vxlan_vnifilter.o
7+
vxlan-objs := vxlan_core.o vxlan_multicast.o vxlan_vnifilter.o vxlan_mdb.o

drivers/net/vxlan/vxlan_core.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2878,8 +2878,14 @@ static int vxlan_init(struct net_device *dev)
28782878
if (err)
28792879
goto err_free_percpu;
28802880

2881+
err = vxlan_mdb_init(vxlan);
2882+
if (err)
2883+
goto err_gro_cells_destroy;
2884+
28812885
return 0;
28822886

2887+
err_gro_cells_destroy:
2888+
gro_cells_destroy(&vxlan->gro_cells);
28832889
err_free_percpu:
28842890
free_percpu(dev->tstats);
28852891
err_vnigroup_uninit:
@@ -2904,6 +2910,8 @@ static void vxlan_uninit(struct net_device *dev)
29042910
{
29052911
struct vxlan_dev *vxlan = netdev_priv(dev);
29062912

2913+
vxlan_mdb_fini(vxlan);
2914+
29072915
if (vxlan->cfg.flags & VXLAN_F_VNIFILTER)
29082916
vxlan_vnigroup_uninit(vxlan);
29092917

0 commit comments

Comments
 (0)