History

vxlan: combine VXLAN_FLOWBASED into VXLAN_COLLECT_METADATA

IFLA_VXLAN_FLOWBASED is useless without IFLA_VXLAN_COLLECT_METADATA, so combine them into single IFLA_VXLAN_COLLECT_METADATA flag. 'flowbased' doesn't convey real meaning of the vxlan tunnel mode. This mode can be used by routing, tc+bpf and ovs. Only ovs is strictly flow based, so 'collect metadata' is a better name for this tunnel mode.

Alexei Starovoitov committed 11 years ago

Commit da8b43c1 parent e03c5124 files · +8 −16Browse files

Unified · Split

4 files
  1. drivers/net/vxlan.c +6 −11
  2. include/net/vxlan.h +1 −3
  3. include/uapi/linux/if_link.h +0 −1
  4. net/openvswitch/vport-vxlan.c +1 −1
drivers/net/vxlan.c+6−11
@@ -1141,7 +1141,7 @@ static void vxlan_rcv(struct vxlan_sock *vs, struct sk_buff *skb, · 1140 unmodified lines
11411141 union vxlan_addr *remote_ip;
11421142
11431143 /* For flow based devices, map all packets to VNI 0 */
1144− if (vs->flags & VXLAN_F_FLOW_BASED)
1144+ if (vs->flags & VXLAN_F_COLLECT_METADATA)
11451145 vni = 0;
11461146
11471147 /* Is this VNI defined? */
@@ -1183,7 +1183,7 @@ static void vxlan_rcv(struct vxlan_sock *vs, struct sk_buff *skb, · 35 unmodified lines
11831183
11841184 skb_reset_network_header(skb);
11851185 /* In flow-based mode, GBP is carried in dst_metadata */
1186− if (!(vs->flags & VXLAN_F_FLOW_BASED))
1186+ if (!(vs->flags & VXLAN_F_COLLECT_METADATA))
11871187 skb->mark = md->gbp;
11881188
11891189 if (oip6)
@@ -2129,7 +2129,7 @@ static netdev_tx_t vxlan_xmit(struct sk_buff *skb, struct net_device *dev) · 939 unmodified lines
21292129 #endif
21302130 }
21312131
2132− if (vxlan->flags & VXLAN_F_FLOW_BASED &&
2132+ if (vxlan->flags & VXLAN_F_COLLECT_METADATA &&
21332133 info && info->mode == IP_TUNNEL_INFO_TX) {
21342134 vxlan_xmit_one(skb, dev, NULL, false);
21352135 return NETDEV_TX_OK;
@@ -2462,7 +2462,6 @@ static const struct nla_policy vxlan_policy[IFLA_VXLAN_MAX + 1] = { · 326 unmodified lines
24622462 [IFLA_VXLAN_RSC] = { .type = NLA_U8 },
24632463 [IFLA_VXLAN_L2MISS] = { .type = NLA_U8 },
24642464 [IFLA_VXLAN_L3MISS] = { .type = NLA_U8 },
2465− [IFLA_VXLAN_FLOWBASED] = { .type = NLA_U8 },
24662465 [IFLA_VXLAN_COLLECT_METADATA] = { .type = NLA_U8 },
24672466 [IFLA_VXLAN_PORT] = { .type = NLA_U16 },
24682467 [IFLA_VXLAN_UDP_CSUM] = { .type = NLA_U8 },
@@ -2814,10 +2813,6 @@ static int vxlan_newlink(struct net *src_net, struct net_device *dev, · 345 unmodified lines
28142813 if (data[IFLA_VXLAN_LIMIT])
28152814 conf.addrmax = nla_get_u32(data[IFLA_VXLAN_LIMIT]);
28162815
2817− if (data[IFLA_VXLAN_FLOWBASED] &&
2818− nla_get_u8(data[IFLA_VXLAN_FLOWBASED]))
2819− conf.flags |= VXLAN_F_FLOW_BASED;
2820−
28212816 if (data[IFLA_VXLAN_COLLECT_METADATA] &&
28222817 nla_get_u8(data[IFLA_VXLAN_COLLECT_METADATA]))
28232818 conf.flags |= VXLAN_F_COLLECT_METADATA;
@@ -2903,7 +2898,7 @@ static size_t vxlan_get_size(const struct net_device *dev) · 79 unmodified lines
29032898 nla_total_size(sizeof(__u8)) + /* IFLA_VXLAN_RSC */
29042899 nla_total_size(sizeof(__u8)) + /* IFLA_VXLAN_L2MISS */
29052900 nla_total_size(sizeof(__u8)) + /* IFLA_VXLAN_L3MISS */
2906− nla_total_size(sizeof(__u8)) + /* IFLA_VXLAN_FLOWBASED */
2901+ nla_total_size(sizeof(__u8)) + /* IFLA_VXLAN_COLLECT_METADATA */
29072902 nla_total_size(sizeof(__u32)) + /* IFLA_VXLAN_AGEING */
29082903 nla_total_size(sizeof(__u32)) + /* IFLA_VXLAN_LIMIT */
29092904 nla_total_size(sizeof(struct ifla_vxlan_port_range)) +
@@ -2970,8 +2965,8 @@ static int vxlan_fill_info(struct sk_buff *skb, const struct net_device *dev) · 60 unmodified lines
29702965 !!(vxlan->flags & VXLAN_F_L2MISS)) ||
29712966 nla_put_u8(skb, IFLA_VXLAN_L3MISS,
29722967 !!(vxlan->flags & VXLAN_F_L3MISS)) ||
2973− nla_put_u8(skb, IFLA_VXLAN_FLOWBASED,
2974− !!(vxlan->flags & VXLAN_F_FLOW_BASED)) ||
2968+ nla_put_u8(skb, IFLA_VXLAN_COLLECT_METADATA,
2969+ !!(vxlan->flags & VXLAN_F_COLLECT_METADATA)) ||
29752970 nla_put_u32(skb, IFLA_VXLAN_AGEING, vxlan->cfg.age_interval) ||
29762971 nla_put_u32(skb, IFLA_VXLAN_LIMIT, vxlan->cfg.addrmax) ||
29772972 nla_put_be16(skb, IFLA_VXLAN_PORT, vxlan->cfg.dst_port) ||
include/net/vxlan.h+1−3
@@ -181,7 +181,6 @@ struct vxlan_dev { · 180 unmodified lines
181181 #define VXLAN_F_GBP 0x800
182182 #define VXLAN_F_REMCSUM_NOPARTIAL 0x1000
183183 #define VXLAN_F_COLLECT_METADATA 0x2000
184−#define VXLAN_F_FLOW_BASED 0x4000
185184
186185 /* Flags that are used in the receive path. These flags must match in
187186 * order for a socket to be shareable
@@ -190,8 +189,7 @@ struct vxlan_dev { · 2 unmodified lines
190189 VXLAN_F_UDP_ZERO_CSUM6_RX | \
191190 VXLAN_F_REMCSUM_RX | \
192191 VXLAN_F_REMCSUM_NOPARTIAL | \
193− VXLAN_F_COLLECT_METADATA | \
194− VXLAN_F_FLOW_BASED)
192+ VXLAN_F_COLLECT_METADATA)
195193
196194 struct net_device *vxlan_dev_create(struct net *net, const char *name,
197195 u8 name_assign_type, struct vxlan_config *conf);
include/uapi/linux/if_link.h+0−1
@@ -382,7 +382,6 @@ enum { · 381 unmodified lines
382382 IFLA_VXLAN_REMCSUM_RX,
383383 IFLA_VXLAN_GBP,
384384 IFLA_VXLAN_REMCSUM_NOPARTIAL,
385− IFLA_VXLAN_FLOWBASED,
386385 IFLA_VXLAN_COLLECT_METADATA,
387386 __IFLA_VXLAN_MAX
388387 };
net/openvswitch/vport-vxlan.c+1−1
@@ -90,7 +90,7 @@ static struct vport *vxlan_tnl_create(const struct vport_parms *parms) · 89 unmodified lines
9090 int err;
9191 struct vxlan_config conf = {
9292 .no_share = true,
93− .flags = VXLAN_F_FLOW_BASED | VXLAN_F_COLLECT_METADATA,
93+ .flags = VXLAN_F_COLLECT_METADATA,
9494 };
9595
9696 if (!options) {