Skip to content

Commit

Permalink
datapath: backport: allow output of MPLS packets on tunnel vports
Browse files Browse the repository at this point in the history
Upstream commit:
    commit fe3a5f6c795810edb1646a840fec3c8c350c2a4e
    Author: Simon Horman <[email protected]>

    openvswitch: allow output of MPLS packets on tunnel vports

    Currently output of MPLS packets on tunnel vports is not allowed by Open
    vSwitch. This is because historically encapsulation was done in such a way
    that the inner_protocol field of the skb needed to hold the inner protocol
    for both MPLS and tunnel encapsulation in order for GSO segmentation to be
    performed correctly.

    Since b2acd1dc3949 ("openvswitch: Use regular GRE net_device instead of
    vport") Open vSwitch makes use of lwt to output to tunnel netdevs which
    perform encapsulation. As no drivers expose support for MPLS offloads this
    means that GSO packets are segmented in software by validate_xmit_skb(),
    which is called from __dev_queue_xmit(), before tunnel encapsulation occurs.
    This means that the inner protocol of MPLS is no longer needed by the time
    encapsulation occurs and the contention on the inner_protocol field of the
    skb no longer occurs.

    Thus it is now safe to output MPLS to tunnel vports.

    Signed-off-by: Simon Horman <[email protected]>
    Reviewed-by: Jesse Gross <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>

Signed-off-by: Pravin B Shelar <[email protected]>
Acked-by: Jesse Gross <[email protected]>
  • Loading branch information
Pravin B Shelar authored and pshelar committed Jul 18, 2016
1 parent 40c08cd commit 4c3c564
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion datapath/flow_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -2046,9 +2046,10 @@ static int validate_set(const struct nlattr *a,
break;

case OVS_KEY_ATTR_TUNNEL:
#ifndef USE_UPSTREAM_TUNNEL
if (eth_p_mpls(eth_type))
return -EINVAL;

#endif
if (masked)
return -EINVAL; /* Masked tunnel set not supported. */

Expand Down

0 comments on commit 4c3c564

Please sign in to comment.