Skip to content

net/sched: Add actions for MPLS L2 VPNs

Guillaume Nault netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2net/sched: act_vlan: Add {POP,PUSH}_ETH actionsinclude/linux/skbuff.h include/net/tc_act/tc_vlan.h include/uapi/linux/tc_act/tc_vlan.h +3 more+126 -180 replies
2/2net/sched: act_mpls: Add action to push MPLS LSE before Ethernet headerinclude/uapi/linux/tc_act/tc_mpls.h net/sched/act_mpls.c+19 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH net-next 0/2] net/sched: Add actions for MPLS L2 VPNs

This patch series adds the necessary TC actions for supporting layer 2 MPLS VPNs (VPLS).

The objective is to give the possibility to add an MPLS header right before an skb's mac header, then to prepend this MPLS packet with a new Ethernet header with the MAC address of the next hop.

Patch 1 implements the actions for adding and removing the external Ethernet header.
Patch 2 adds the possibility to push an MPLS header before the mac header.

Most of the code already exists as these operations were first implemented in openvswitch.

Practical example, with encap on Host-A and decap on Host-B:

Host-A# tc filter add dev ethAx ingress matchall \

           action mpls mac_push label 20                  \
           action vlan push_eth dst_mac 02:00:00:00:00:02 \
                                src_mac 02:00:00:00:00:01 \
           action mirred egress redirect dev ethAy

Host-B# tc filter add dev ethBx ingress protocol mpls_uc \

           flower mpls_label 20 mpls_bos 1                \
           action vlan pop_eth                            \
           action mpls pop proto teb                      \

action mirred egress redirect dev ethBy

Guillaume Nault (2):
net/sched: act_vlan: Add {POP,PUSH}_ETH actions net/sched: act_mpls: Add action to push MPLS LSE before Ethernet
header

 include/linux/skbuff.h              |  3 ++
 include/net/tc_act/tc_vlan.h        |  2 +
 include/uapi/linux/tc_act/tc_mpls.h |  1 +
 include/uapi/linux/tc_act/tc_vlan.h |  4 ++
 net/core/skbuff.c                   | 67 +++++++++++++++++++++++++++++
 net/openvswitch/actions.c           | 28 +++++-------
 net/sched/act_mpls.c                | 18 ++++++++
 net/sched/act_vlan.c                | 40 +++++++++++++++++
 8 files changed, 145 insertions(+), 18 deletions(-)
Signature · 1 line
2.21.3