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
1616 #define TCA_VLAN_ACT_POP 1
1717 #define TCA_VLAN_ACT_PUSH 2
1818 #define TCA_VLAN_ACT_MODIFY 3
19+#define TCA_VLAN_ACT_POP_ETH 4
20+#define TCA_VLAN_ACT_PUSH_ETH 5
1921
2022 struct tc_vlan {
2123 tc_gen;
@@ -30,6 +32,8 @@ enum { · 8 unmodified lines
3032 TCA_VLAN_PUSH_VLAN_PROTOCOL,
3133 TCA_VLAN_PAD,
3234 TCA_VLAN_PUSH_VLAN_PRIORITY,
35+ TCA_VLAN_PUSH_ETH_DST,
36+ TCA_VLAN_PUSH_ETH_SRC,
3337 __TCA_VLAN_MAX,
3438 };
3539 #define TCA_VLAN_MAX (__TCA_VLAN_MAX - 1)