Subject: Re: [PATCH net-next 3/3] openvswitch: New MPLS actions for layer 2 tunnelling

From: Martin Varghese <[email-masked]>
Date: Wed, 11 Dec 2019 05:32:45 +0530

On Tue, Dec 10, 2019 at 01:22:56PM -0800, Pravin Shelar wrote:
> On Tue, Dec 10, 2019 at 12:17 AM Martin Varghese
> <[email-masked]> wrote:
> >
> > From: Martin Varghese <[email-masked]>
> >
> > The existing PUSH MPLS & POP MPLS actions inserts & removes MPLS header
> > between ethernet header and the IP header. Though this behaviour is fine
> > for L3 VPN where an IP packet is encapsulated inside a MPLS tunnel, it
> > does not suffice the L2 VPN (l2 tunnelling) requirements. In L2 VPN
> > the MPLS header should encapsulate the ethernet packet.
> >
> > The new mpls actions PTAP_PUSH_MPLS & PTAP_POP_MPLS inserts and removes
> > MPLS header from start of the packet respectively.
> >
> > PTAP_PUSH_MPLS - Inserts MPLS header at the start of the packet.
> > @ethertype - Ethertype of MPLS header.
> >
> > PTAP_POP_MPLS - Removes MPLS header from the start of the packet.
> > @ethertype - Ethertype of next header following the popped MPLS header.
> >              Value 0 in ethertype indicates the tunnelled packet is
> >              ethernet.
> >
> Did you considered using existing MPLS action to handle L2 tunneling
> packet ? It can be done by adding another parameter to the MPLS
> actions.

Not really.

Are you suggesting to extend the ovs_action_push_mpls and similarly for pop

struct ovs_action_push_mpls {
        __be32 mpls_lse;
        __be16 mpls_ethertype; /* Either %ETH_P_MPLS_UC or %ETH_P_MPLS_MC */
+        bool l2_tunnel;
};

Does not that break the compatibilty with the existing userspace
OVS ?

Will not push_mpls and pop_mpls called from existing OVS fail in action_lens check
in __ovs_nla_copy_actions ?