vxlan: expose COLLECT_METADATA flag to user space
authorAlexei Starovoitov <ast@plumgrid.com>
Fri, 31 Jul 2015 03:10:22 +0000 (20:10 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 31 Jul 2015 22:24:24 +0000 (15:24 -0700)
Two vxlan driver flags FLOWBASED and COLLECT_METADATA need to be set to
make use of its new flow mode. The former already exposed. Expose the latter.

Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/vxlan.c
include/uapi/linux/if_link.h

index beed5d4025a33b97162c632c5f65d3dea92b870a..e90f7a484e1c741b5b51c04481a3d749bd6ab7bd 100644 (file)
@@ -2463,6 +2463,7 @@ static const struct nla_policy vxlan_policy[IFLA_VXLAN_MAX + 1] = {
        [IFLA_VXLAN_L2MISS]     = { .type = NLA_U8 },
        [IFLA_VXLAN_L3MISS]     = { .type = NLA_U8 },
        [IFLA_VXLAN_FLOWBASED]  = { .type = NLA_U8 },
+       [IFLA_VXLAN_COLLECT_METADATA]   = { .type = NLA_U8 },
        [IFLA_VXLAN_PORT]       = { .type = NLA_U16 },
        [IFLA_VXLAN_UDP_CSUM]   = { .type = NLA_U8 },
        [IFLA_VXLAN_UDP_ZERO_CSUM6_TX]  = { .type = NLA_U8 },
@@ -2817,6 +2818,10 @@ static int vxlan_newlink(struct net *src_net, struct net_device *dev,
            nla_get_u8(data[IFLA_VXLAN_FLOWBASED]))
                conf.flags |= VXLAN_F_FLOW_BASED;
 
+       if (data[IFLA_VXLAN_COLLECT_METADATA] &&
+           nla_get_u8(data[IFLA_VXLAN_COLLECT_METADATA]))
+               conf.flags |= VXLAN_F_COLLECT_METADATA;
+
        if (data[IFLA_VXLAN_PORT_RANGE]) {
                const struct ifla_vxlan_port_range *p
                        = nla_data(data[IFLA_VXLAN_PORT_RANGE]);
index 9eeb5d9cf8f0f110c8ef6fa61233bb17ebe58a88..24e22cd4be79a6cff0bf5459b69bb99851a4d18a 100644 (file)
@@ -383,6 +383,7 @@ enum {
        IFLA_VXLAN_GBP,
        IFLA_VXLAN_REMCSUM_NOPARTIAL,
        IFLA_VXLAN_FLOWBASED,
+       IFLA_VXLAN_COLLECT_METADATA,
        __IFLA_VXLAN_MAX
 };
 #define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1)