netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/2] net/sched: Add actions for MPLS L2 VPNs
@ 2020-10-02 22:44 Guillaume Nault
  2020-10-02 22:44 ` [PATCH net-next 1/2] net/sched: act_vlan: Add {POP,PUSH}_ETH actions Guillaume Nault
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Guillaume Nault @ 2020-10-02 22:44 UTC (permalink / raw)
  To: David Miller, Jakub Kicinski
  Cc: netdev, Jamal Hadi Salim, Cong Wang, Jiri Pirko, Jiri Benc,
	Martin Varghese

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(-)

-- 
2.21.3


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-10-04  0:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-02 22:44 [PATCH net-next 0/2] net/sched: Add actions for MPLS L2 VPNs Guillaume Nault
2020-10-02 22:44 ` [PATCH net-next 1/2] net/sched: act_vlan: Add {POP,PUSH}_ETH actions Guillaume Nault
2020-10-02 22:44 ` [PATCH net-next 2/2] net/sched: act_mpls: Add action to push MPLS LSE before Ethernet header Guillaume Nault
2020-10-04  0:33 ` [PATCH net-next 0/2] net/sched: Add actions for MPLS L2 VPNs David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).