On 11/29/21 07:22, Martin Varghese wrote:
> From: Martin Varghese <[email protected]>
>
> The encap & decap actions are extended to support MPLS packet type.
> Encap & decap actions adds and removes MPLS header at start of the
> packet.
>
> 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 requirements. In L2 VPN the
> ethernet packets must be encapsulated inside MPLS tunnel.
>
> In this change the encap & decap actions are extended to support MPLS
> packet type. The encap & decap adds and removes MPLS header at the
> start of packet as depicted below.
>
> Encapsulation:
>
> Actions - encap(mpls(ether_type=0x8847)),encap(ethernet)
>
> Incoming packet -> | ETH | IP | Payload |
>
> 1 Actions - encap(mpls(ether_type=0x8847)) [Datapath action -
> ADD_MPLS:0x8847]
>
> Outgoing packet -> | MPLS | ETH | Payload|
>
> 2 Actions - encap(ethernet) [ Datapath action - push_eth ]
>
> Outgoing packet -> | ETH | MPLS | ETH | Payload|
>
> Decapsulation:
>
> Incoming packet -> | ETH | MPLS | ETH | IP | Payload |
>
> Actions - decap(),decap(packet_type(ns=0,type=0)
>
> 1 Actions - decap() [Datapath action - pop_eth)
>
> Outgoing packet -> | MPLS | ETH | IP | Payload|
>
> 2 Actions - decap(packet_type(ns=0,type=0) [Datapath action - POP_MPLS:0x6558]
>
> Outgoing packet -> | ETH | IP | Payload|
>
> Signed-off-by: Martin Varghese <[email protected]>
> Acked-by: Eelco Chaudron <[email protected]>
> ---
Thanks, Martin and Eelco!
This version looks much better with PT_MPLS_MC. With a few cosmetic
changes, I applied the patch.
One non-cosmetic change though that I made is I added the case for
the PT_MPLS_MC to the second switch in the following code:
> @@ -8600,6 +8643,11 @@ commit_encap_decap_action(const struct flow *flow,
> memcpy(&base_flow->dl_dst, &flow->dl_dst,
> sizeof(*flow) - offsetof(struct flow, dl_dst));
> break;
> + case PT_MPLS:
> + case PT_MPLS_MC:
> + commit_mpls_action(flow, base_flow, odp_actions,
> + pending_encap);
> + break;
> default:
> /* Only the above protocols are supported for encap.
> * The check is done at action translation. */
> @@ -8622,6 +8670,10 @@ commit_encap_decap_action(const struct flow *flow,
> /* pop_nsh. */
> odp_put_pop_nsh_action(odp_actions);
> break;
> + case PT_MPLS:
case PT_MPLS_MC: <-- this one
> + commit_mpls_action(flow, base_flow, odp_actions,
> + pending_encap);
> + break;
> default:
> /* Checks are done during translation. */
> OVS_NOT_REACHED();
I think, it's needed there, but, please, let me know, if that's not
the case.
Best regards, Ilya Maximets.
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev