• Amit Cohen's avatar
    vxlan: vxlan_core: Support FDB flushing by destination VNI · c499fccb
    Amit Cohen authored
    Add support for flush VXLAN FDB entries by destination VNI. FDB entry is
    stored as {MAC, SRC_VNI} + remote. The destination VNI is an attribute
    of the remote. For multicast entries, the VXLAN driver stores a linked list
    of remotes for a given key.
    
    In user space, each remote is represented as a separate entry, so when
    flush is sent with filter of 'destination VNI', flush only the match
    remotes. In case that there are no additional remotes, destroy the entry.
    
    For example, the following are stored as one entry with several remotes:
    $ bridge fdb show dev vx10
    00:00:00:00:00:00 dst 192.1.1.1 vni 3000 self permanent
    00:00:00:00:00:00 dst 192.1.1.1 vni 4000 self permanent
    00:00:00:00:00:00 dst 192.1.1.1 vni 2000 self permanent
    00:00:00:00:00:00 dst 192.1.1.2 vni 2000 self permanent
    
    When user flush by VNI x, only the relevant remotes will be flushed:
    $ bridge fdb flush dev vx10 vni 2000
    
    $ bridge fdb show dev vx10
    00:00:00:00:00:00 dst 192.1.1.1 vni 3000 self permanent
    00:00:00:00:00:00 dst 192.1.1.1 vni 4000 self permanent
    Signed-off-by: default avatarAmit Cohen <amcohen@nvidia.com>
    Reviewed-by: default avatarPetr Machata <petrm@nvidia.com>
    Reviewed-by: default avatarIdo Schimmel <idosch@nvidia.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    c499fccb
vxlan_core.c 126 KB