History

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

Guillaume Nault committed 6 years ago

Commit 19fbcb31 parent e275d496 files · +126 −18Browse files

Showing the changes to include/uapi/linux (1 of 6 files). Show all

Unified · Split

include/uapi/linux/tc_act/tc_vlan.h+4−0
@@ -16,6 +16,8 @@ · 15 unmodified lines
16#define TCA_VLAN_ACT_POP 116#define TCA_VLAN_ACT_POP 1
17#define TCA_VLAN_ACT_PUSH 217#define TCA_VLAN_ACT_PUSH 2
18#define TCA_VLAN_ACT_MODIFY 318#define TCA_VLAN_ACT_MODIFY 3
19#define TCA_VLAN_ACT_POP_ETH 4
20#define TCA_VLAN_ACT_PUSH_ETH 5
19 21
20struct tc_vlan {22struct tc_vlan {
21 tc_gen;23 tc_gen;
@@ -30,6 +32,8 @@ enum { · 8 unmodified lines
30 TCA_VLAN_PUSH_VLAN_PROTOCOL,32 TCA_VLAN_PUSH_VLAN_PROTOCOL,
31 TCA_VLAN_PAD,33 TCA_VLAN_PAD,
32 TCA_VLAN_PUSH_VLAN_PRIORITY,34 TCA_VLAN_PUSH_VLAN_PRIORITY,
35 TCA_VLAN_PUSH_ETH_DST,
36 TCA_VLAN_PUSH_ETH_SRC,
33 __TCA_VLAN_MAX,37 __TCA_VLAN_MAX,
34};38};
35#define TCA_VLAN_MAX (__TCA_VLAN_MAX - 1)39#define TCA_VLAN_MAX (__TCA_VLAN_MAX - 1)