• Alce Lafranque's avatar
    vxlan: add support for flowlabel inherit · c6e9dba3
    Alce Lafranque authored
    By default, VXLAN encapsulation over IPv6 sets the flow label to 0, with
    an option for a fixed value. This commits add the ability to inherit the
    flow label from the inner packet, like for other tunnel implementations.
    This enables devices using only L3 headers for ECMP to correctly balance
    VXLAN-encapsulated IPv6 packets.
    
    ```
    $ ./ip/ip link add dummy1 type dummy
    $ ./ip/ip addr add 2001:db8::2/64 dev dummy1
    $ ./ip/ip link set up dev dummy1
    $ ./ip/ip link add vxlan1 type vxlan id 100 flowlabel inherit remote 2001:db8::1 local 2001:db8::2
    $ ./ip/ip link set up dev vxlan1
    $ ./ip/ip addr add 2001:db8:1::2/64 dev vxlan1
    $ ./ip/ip link set arp off dev vxlan1
    $ ping -q 2001:db8:1::1 &
    $ tshark -d udp.port==8472,vxlan -Vpni dummy1 -c1
    [...]
    Internet Protocol Version 6, Src: 2001:db8::2, Dst: 2001:db8::1
        0110 .... = Version: 6
        .... 0000 0000 .... .... .... .... .... = Traffic Class: 0x00 (DSCP: CS0, ECN: Not-ECT)
            .... 0000 00.. .... .... .... .... .... = Differentiated Services Codepoint: Default (0)
            .... .... ..00 .... .... .... .... .... = Explicit Congestion Notification: Not ECN-Capable Transport (0)
        .... 1011 0001 1010 1111 1011 = Flow Label: 0xb1afb
    [...]
    Virtual eXtensible Local Area Network
        Flags: 0x0800, VXLAN Network ID (VNI)
        Group Policy ID: 0
        VXLAN Network Identifier (VNI): 100
    [...]
    Internet Protocol Version 6, Src: 2001:db8:1::2, Dst: 2001:db8:1::1
        0110 .... = Version: 6
        .... 0000 0000 .... .... .... .... .... = Traffic Class: 0x00 (DSCP: CS0, ECN: Not-ECT)
            .... 0000 00.. .... .... .... .... .... = Differentiated Services Codepoint: Default (0)
            .... .... ..00 .... .... .... .... .... = Explicit Congestion Notification: Not ECN-Capable Transport (0)
        .... 1011 0001 1010 1111 1011 = Flow Label: 0xb1afb
    ```
    Signed-off-by: default avatarAlce Lafranque <alce@lafranque.net>
    Co-developed-by: default avatarVincent Bernat <vincent@bernat.ch>
    Signed-off-by: default avatarVincent Bernat <vincent@bernat.ch>
    Reviewed-by: default avatarIdo Schimmel <idosch@nvidia.com>
    Reviewed-by: default avatarDavid Ahern <dsahern@kernel.org>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    c6e9dba3
vxlan_core.c 124 KB