]> git.baikalelectronics.ru Git - kernel.git/commit
net/sched: act_vlan: Add {POP,PUSH}_ETH actions
authorGuillaume Nault <gnault@redhat.com>
Fri, 2 Oct 2020 22:44:28 +0000 (00:44 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 4 Oct 2020 00:28:45 +0000 (17:28 -0700)
commit6385eb650924384dddd7b248501aa7161412039f
treeb3e9a747a50272805b7f93bdf6739d38da088ef4
parent9e1e4c492ffed4a5f75c985037f89ad33b01f641
net/sched: act_vlan: Add {POP,PUSH}_ETH actions

Implement TCA_VLAN_ACT_POP_ETH and TCA_VLAN_ACT_PUSH_ETH, to
respectively pop and push a base Ethernet header at the beginning of a
frame.

POP_ETH is just a matter of pulling ETH_HLEN bytes. VLAN tags, if any,
must be stripped before calling POP_ETH.

PUSH_ETH is restricted to skbs with no mac_header, and only the MAC
addresses can be configured. The Ethertype is automatically set from
skb->protocol. These restrictions ensure that all skb's fields remain
consistent, so that this action can't confuse other part of the
networking stack (like GSO).

Since openvswitch already had these actions, consolidate the code in
skbuff.c (like for vlan and mpls push/pop).

Signed-off-by: Guillaume Nault <gnault@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/skbuff.h
include/net/tc_act/tc_vlan.h
include/uapi/linux/tc_act/tc_vlan.h
net/core/skbuff.c
net/openvswitch/actions.c
net/sched/act_vlan.c