Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e51a08b8 authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'openvswitch-net'



Pravin B Shelar says:

====================
openvswitch: datapath fixes

Following patch series is mostly targeted to MPLS fixes. other
patches are related datapth transmit path error handling.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents ceb8d5bf 74f47278
Loading
Loading
Loading
Loading
+24 −10
Original line number Diff line number Diff line
@@ -1579,8 +1579,10 @@ static int vxlan6_xmit_skb(struct vxlan_sock *vs,
	bool udp_sum = !udp_get_no_check6_tx(vs->sock->sk);

	skb = udp_tunnel_handle_offloads(skb, udp_sum);
	if (IS_ERR(skb))
		return -EINVAL;
	if (IS_ERR(skb)) {
		err = -EINVAL;
		goto err;
	}

	skb_scrub_packet(skb, xnet);

@@ -1590,12 +1592,16 @@ static int vxlan6_xmit_skb(struct vxlan_sock *vs,

	/* Need space for new headers (invalidates iph ptr) */
	err = skb_cow_head(skb, min_headroom);
	if (unlikely(err))
		return err;
	if (unlikely(err)) {
		kfree_skb(skb);
		goto err;
	}

	skb = vlan_hwaccel_push_inside(skb);
	if (WARN_ON(!skb))
		return -ENOMEM;
	if (WARN_ON(!skb)) {
		err = -ENOMEM;
		goto err;
	}

	vxh = (struct vxlanhdr *) __skb_push(skb, sizeof(*vxh));
	vxh->vx_flags = htonl(VXLAN_FLAGS);
@@ -1606,6 +1612,9 @@ static int vxlan6_xmit_skb(struct vxlan_sock *vs,
	udp_tunnel6_xmit_skb(vs->sock, dst, skb, dev, saddr, daddr, prio,
			     ttl, src_port, dst_port);
	return 0;
err:
	dst_release(dst);
	return err;
}
#endif

@@ -1621,7 +1630,7 @@ int vxlan_xmit_skb(struct vxlan_sock *vs,

	skb = udp_tunnel_handle_offloads(skb, udp_sum);
	if (IS_ERR(skb))
		return -EINVAL;
		return PTR_ERR(skb);

	min_headroom = LL_RESERVED_SPACE(rt->dst.dev) + rt->dst.header_len
			+ VXLAN_HLEN + sizeof(struct iphdr)
@@ -1629,8 +1638,10 @@ int vxlan_xmit_skb(struct vxlan_sock *vs,

	/* Need space for new headers (invalidates iph ptr) */
	err = skb_cow_head(skb, min_headroom);
	if (unlikely(err))
	if (unlikely(err)) {
		kfree_skb(skb);
		return err;
	}

	skb = vlan_hwaccel_push_inside(skb);
	if (WARN_ON(!skb))
@@ -1776,9 +1787,12 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev,
				     tos, ttl, df, src_port, dst_port,
				     htonl(vni << 8),
				     !net_eq(vxlan->net, dev_net(vxlan->dev)));

		if (err < 0)
		if (err < 0) {
			/* skb is already freed. */
			skb = NULL;
			goto rt_tx_error;
		}

		iptunnel_xmit_stats(err, &dev->stats, dev->tstats);
#if IS_ENABLED(CONFIG_IPV6)
	} else {
+1 −1
Original line number Diff line number Diff line
@@ -2522,7 +2522,7 @@ static int illegal_highdma(struct net_device *dev, struct sk_buff *skb)
/* If MPLS offload request, verify we are testing hardware MPLS features
 * instead of standard features for the netdev.
 */
#ifdef CONFIG_NET_MPLS_GSO
#if IS_ENABLED(CONFIG_NET_MPLS_GSO)
static netdev_features_t net_mpls_features(struct sk_buff *skb,
					   netdev_features_t features,
					   __be16 type)
+5 −1
Original line number Diff line number Diff line
@@ -122,14 +122,18 @@ int geneve_xmit_skb(struct geneve_sock *gs, struct rtable *rt,
	int err;

	skb = udp_tunnel_handle_offloads(skb, !gs->sock->sk->sk_no_check_tx);
	if (IS_ERR(skb))
		return PTR_ERR(skb);

	min_headroom = LL_RESERVED_SPACE(rt->dst.dev) + rt->dst.header_len
			+ GENEVE_BASE_HLEN + opt_len + sizeof(struct iphdr)
			+ (vlan_tx_tag_present(skb) ? VLAN_HLEN : 0);

	err = skb_cow_head(skb, min_headroom);
	if (unlikely(err))
	if (unlikely(err)) {
		kfree_skb(skb);
		return err;
	}

	skb = vlan_hwaccel_push_inside(skb);
	if (unlikely(!skb))
+1 −4
Original line number Diff line number Diff line
@@ -31,10 +31,7 @@ static struct sk_buff *mpls_gso_segment(struct sk_buff *skb,
				  SKB_GSO_TCPV6 |
				  SKB_GSO_UDP |
				  SKB_GSO_DODGY |
				  SKB_GSO_TCP_ECN |
				  SKB_GSO_GRE |
				  SKB_GSO_GRE_CSUM |
				  SKB_GSO_IPIP)))
				  SKB_GSO_TCP_ECN)))
		goto out;

	/* Setup inner SKB. */
+2 −1
Original line number Diff line number Diff line
@@ -147,6 +147,7 @@ static int push_mpls(struct sk_buff *skb, struct sw_flow_key *key,
	hdr = eth_hdr(skb);
	hdr->h_proto = mpls->mpls_ethertype;

	if (!skb->inner_protocol)
		skb_set_inner_protocol(skb, skb->protocol);
	skb->protocol = mpls->mpls_ethertype;

Loading