Excludes VXLAN_F_REMCSUM_TX bits as OVS currently doesn't support it. Upstream commit: vxlan: Eliminate dependency on UDP socket in transmit path
In the vxlan transmit path there is no need to reference the socket for a tunnel which is needed for the receive side. We do, however, need the vxlan_dev flags. This patch eliminate references to the socket in the transmit path, and changes VXLAN_F_UNSHAREABLE to be VXLAN_F_RCV_FLAGS. This mask is used to store the flags applicable to receive (GBP, CSUM6_RX, and REMCSUM_RX) in the vxlan_sock flags. Signed-off-by: Tom Herbert <therb...@google.com> Signed-off-by: David S. Miller <da...@davemloft.net> Upstream: af33c1adae1e ("vxlan: Eliminate dependency on UDP socket in transmit path") Signed-off-by: Thomas Graf <tg...@noironetworks.com> --- datapath/linux/compat/include/net/vxlan.h | 12 ++++++++---- datapath/linux/compat/vxlan.c | 10 +++++----- datapath/vport-vxlan.c | 2 +- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/datapath/linux/compat/include/net/vxlan.h b/datapath/linux/compat/include/net/vxlan.h index 643f837..c33be0f 100644 --- a/datapath/linux/compat/include/net/vxlan.h +++ b/datapath/linux/compat/include/net/vxlan.h @@ -77,20 +77,24 @@ struct vxlanhdr_gbp { #define VXLAN_F_GBP 0x800 #endif +#ifndef VXLAN_F_RCV_FLAGS +#define VXLAN_F_RCV_FLAGS VXLAN_F_GBP +#endif + #ifdef HAVE_VXLAN_METADATA static inline int rpl_vxlan_xmit_skb(struct vxlan_sock *vs, struct rtable *rt, struct sk_buff *skb, __be32 src, __be32 dst, __u8 tos, __u8 ttl, __be16 df, __be16 src_port, __be16 dst_port, - struct vxlan_metadata *md, bool xnet) + struct vxlan_metadata *md, bool xnet, u32 vxflags) { if (skb_is_gso(skb) && skb_is_encapsulated(skb)) { kfree_skb(skb); return -ENOSYS; } - return vxlan_xmit_skb(vs, rt, skb, src, dst, tos, ttl, df, - src_port, dst_port, md, xnet); + return vxlan_xmit_skb(rt, skb, src, dst, tos, ttl, df, + src_port, dst_port, md, xnet, vxflags); } #define vxlan_xmit_skb rpl_vxlan_xmit_skb @@ -132,7 +136,7 @@ int vxlan_xmit_skb(struct vxlan_sock *vs, struct rtable *rt, struct sk_buff *skb, __be32 src, __be32 dst, __u8 tos, __u8 ttl, __be16 df, __be16 src_port, __be16 dst_port, - struct vxlan_metadata *md, bool xnet); + struct vxlan_metadata *md, bool xnet, u32 vxflags); #define vxlan_src_port rpl_vxlan_src_port __be16 vxlan_src_port(__u16 port_min, __u16 port_max, struct sk_buff *skb); diff --git a/datapath/linux/compat/vxlan.c b/datapath/linux/compat/vxlan.c index dbccd3c..b5fbc5f 100644 --- a/datapath/linux/compat/vxlan.c +++ b/datapath/linux/compat/vxlan.c @@ -206,7 +206,7 @@ static struct sk_buff *handle_offloads(struct sk_buff *skb) return ovs_iptunnel_handle_offloads(skb, false, vxlan_gso); } -static void vxlan_build_gbp_hdr(struct vxlanhdr *vxh, struct vxlan_sock *vs, +static void vxlan_build_gbp_hdr(struct vxlanhdr *vxh, u32 vxflags, struct vxlan_metadata *md) { struct vxlanhdr_gbp *gbp; @@ -227,7 +227,7 @@ int vxlan_xmit_skb(struct vxlan_sock *vs, struct rtable *rt, struct sk_buff *skb, __be32 src, __be32 dst, __u8 tos, __u8 ttl, __be16 df, __be16 src_port, __be16 dst_port, - struct vxlan_metadata *md, bool xnet) + struct vxlan_metadata *md, bool xnet, u32 vxflags) { struct vxlanhdr *vxh; struct udphdr *uh; @@ -260,8 +260,8 @@ int vxlan_xmit_skb(struct vxlan_sock *vs, vxh->vx_flags = htonl(VXLAN_HF_VNI); vxh->vx_vni = md->vni; - if (vs->flags & VXLAN_F_GBP) - vxlan_build_gbp_hdr(vxh, vs, md); + if (vxflags & VXLAN_F_GBP) + vxlan_build_gbp_hdr(vxh, vxflags, md); __skb_push(skb, sizeof(*uh)); skb_reset_transport_header(skb); @@ -341,7 +341,7 @@ static struct vxlan_sock *vxlan_socket_create(struct net *net, __be16 port, } vs->rcv = rcv; vs->data = data; - vs->flags = flags; + vs->flags = (flags & VXLAN_F_RCV_FLAGS); /* Disable multicast loopback */ inet_sk(sk)->mc_loop = 0; diff --git a/datapath/vport-vxlan.c b/datapath/vport-vxlan.c index 2e58541..38d0ac0 100644 --- a/datapath/vport-vxlan.c +++ b/datapath/vport-vxlan.c @@ -259,7 +259,7 @@ static int vxlan_tnl_send(struct vport *vport, struct sk_buff *skb) tun_key->ipv4_tos, tun_key->ipv4_ttl, df, src_port, dst_port, - &md, false); + &md, false, vxlan_port->exts); if (err < 0) ip_rt_put(rt); return err; -- 1.9.3 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev