History

net: Move all TC actions identifiers to one place

Move all the TC identifiers to one place, to the same enum that defines the identifier of police action. This makes it easier choose numbers for new actions since they are now defined in one place. We preserve the original values for binary compatibility. New IDs should be added inside the enum.

Eli Cohen committed 7 years ago

Commit 257eede1 parent 99c864617 files · +40 −33Browse files

Showing the changes to include/uapi/linux (15 of 17 files). Show all

Unified · Split

15 files
  1. include/uapi/linux/pkt_cls.h +40 −3
  2. include/uapi/linux/tc_act/tc_bpf.h +0 −2
  3. include/uapi/linux/tc_act/tc_connmark.h +0 −2
  4. include/uapi/linux/tc_act/tc_csum.h +0 −2
  5. include/uapi/linux/tc_act/tc_gact.h +0 −1
  6. include/uapi/linux/tc_act/tc_ife.h +0 −1
  7. include/uapi/linux/tc_act/tc_ipt.h +0 −3
  8. include/uapi/linux/tc_act/tc_mirred.h +0 −1
  9. include/uapi/linux/tc_act/tc_nat.h +0 −2
  10. include/uapi/linux/tc_act/tc_pedit.h +0 −2
  11. include/uapi/linux/tc_act/tc_sample.h +0 −2
  12. include/uapi/linux/tc_act/tc_skbedit.h +0 −2
  13. include/uapi/linux/tc_act/tc_skbmod.h +0 −2
  14. include/uapi/linux/tc_act/tc_tunnel_key.h +0 −2
  15. include/uapi/linux/tc_act/tc_vlan.h +0 −2
include/uapi/linux/pkt_cls.h+40−3
@@ -63,12 +63,49 @@ enum { · 62 unmodified lines
6363 #define TC_ACT_GOTO_CHAIN __TC_ACT_EXT(2)
6464 #define TC_ACT_EXT_OPCODE_MAX TC_ACT_GOTO_CHAIN
6565
66+/* These macros are put here for binary compatibility with userspace apps that
67+ * make use of them. For kernel code and new userspace apps, use the TCA_ID_*
68+ * versions.
69+ */
70+#define TCA_ACT_GACT 5
71+#define TCA_ACT_IPT 6
72+#define TCA_ACT_PEDIT 7
73+#define TCA_ACT_MIRRED 8
74+#define TCA_ACT_NAT 9
75+#define TCA_ACT_XT 10
76+#define TCA_ACT_SKBEDIT 11
77+#define TCA_ACT_VLAN 12
78+#define TCA_ACT_BPF 13
79+#define TCA_ACT_CONNMARK 14
80+#define TCA_ACT_SKBMOD 15
81+#define TCA_ACT_CSUM 16
82+#define TCA_ACT_TUNNEL_KEY 17
83+#define TCA_ACT_SIMP 22
84+#define TCA_ACT_IFE 25
85+#define TCA_ACT_SAMPLE 26
86+
6687 /* Action type identifiers*/
6788 enum {
68− TCA_ID_UNSPEC=0,
69− TCA_ID_POLICE=1,
89+ TCA_ID_UNSPEC = 0,
90+ TCA_ID_POLICE = 1,
91+ TCA_ID_GACT = TCA_ACT_GACT,
92+ TCA_ID_IPT = TCA_ACT_IPT,
93+ TCA_ID_PEDIT = TCA_ACT_PEDIT,
94+ TCA_ID_MIRRED = TCA_ACT_MIRRED,
95+ TCA_ID_NAT = TCA_ACT_NAT,
96+ TCA_ID_XT = TCA_ACT_XT,
97+ TCA_ID_SKBEDIT = TCA_ACT_SKBEDIT,
98+ TCA_ID_VLAN = TCA_ACT_VLAN,
99+ TCA_ID_BPF = TCA_ACT_BPF,
100+ TCA_ID_CONNMARK = TCA_ACT_CONNMARK,
101+ TCA_ID_SKBMOD = TCA_ACT_SKBMOD,
102+ TCA_ID_CSUM = TCA_ACT_CSUM,
103+ TCA_ID_TUNNEL_KEY = TCA_ACT_TUNNEL_KEY,
104+ TCA_ID_SIMP = TCA_ACT_SIMP,
105+ TCA_ID_IFE = TCA_ACT_IFE,
106+ TCA_ID_SAMPLE = TCA_ACT_SAMPLE,
70107 /* other actions go here */
71− __TCA_ID_MAX=255
108+ __TCA_ID_MAX = 255
72109 };
73110
74111 #define TCA_ID_MAX __TCA_ID_MAX
include/uapi/linux/tc_act/tc_bpf.h+0−2
@@ -13,8 +13,6 @@ · 12 unmodified lines
1313
1414 #include <linux/pkt_cls.h>
1515
16−#define TCA_ACT_BPF 13
17−
1816 struct tc_act_bpf {
1917 tc_gen;
2018 };
include/uapi/linux/tc_act/tc_connmark.h+0−2
@@ -5,8 +5,6 @@ · 4 unmodified lines
55 #include <linux/types.h>
66 #include <linux/pkt_cls.h>
77
8−#define TCA_ACT_CONNMARK 14
9−
108 struct tc_connmark {
119 tc_gen;
1210 __u16 zone;
include/uapi/linux/tc_act/tc_csum.h+0−2
@@ -5,8 +5,6 @@ · 4 unmodified lines
55 #include <linux/types.h>
66 #include <linux/pkt_cls.h>
77
8−#define TCA_ACT_CSUM 16
9−
108 enum {
119 TCA_CSUM_UNSPEC,
1210 TCA_CSUM_PARMS,
include/uapi/linux/tc_act/tc_gact.h+0−1
@@ -5,7 +5,6 @@ · 4 unmodified lines
55 #include <linux/types.h>
66 #include <linux/pkt_cls.h>
77
8−#define TCA_ACT_GACT 5
98 struct tc_gact {
109 tc_gen;
1110
include/uapi/linux/tc_act/tc_ife.h+0−1
@@ -6,7 +6,6 @@ · 5 unmodified lines
66 #include <linux/pkt_cls.h>
77 #include <linux/ife.h>
88
9−#define TCA_ACT_IFE 25
109 /* Flag bits for now just encoding/decoding; mutually exclusive */
1110 #define IFE_ENCODE 1
1211 #define IFE_DECODE 0
include/uapi/linux/tc_act/tc_ipt.h+0−3
@@ -4,9 +4,6 @@ · 3 unmodified lines
44
55 #include <linux/pkt_cls.h>
66
7−#define TCA_ACT_IPT 6
8−#define TCA_ACT_XT 10
9−
107 enum {
118 TCA_IPT_UNSPEC,
129 TCA_IPT_TABLE,
include/uapi/linux/tc_act/tc_mirred.h+0−1
@@ -5,7 +5,6 @@ · 4 unmodified lines
55 #include <linux/types.h>
66 #include <linux/pkt_cls.h>
77
8−#define TCA_ACT_MIRRED 8
98 #define TCA_EGRESS_REDIR 1 /* packet redirect to EGRESS*/
109 #define TCA_EGRESS_MIRROR 2 /* mirror packet to EGRESS */
1110 #define TCA_INGRESS_REDIR 3 /* packet redirect to INGRESS*/
include/uapi/linux/tc_act/tc_nat.h+0−2
@@ -5,8 +5,6 @@ · 4 unmodified lines
55 #include <linux/pkt_cls.h>
66 #include <linux/types.h>
77
8−#define TCA_ACT_NAT 9
9−
108 enum {
119 TCA_NAT_UNSPEC,
1210 TCA_NAT_PARMS,
include/uapi/linux/tc_act/tc_pedit.h+0−2
@@ -5,8 +5,6 @@ · 4 unmodified lines
55 #include <linux/types.h>
66 #include <linux/pkt_cls.h>
77
8−#define TCA_ACT_PEDIT 7
9−
108 enum {
119 TCA_PEDIT_UNSPEC,
1210 TCA_PEDIT_TM,
include/uapi/linux/tc_act/tc_sample.h+0−2
@@ -6,8 +6,6 @@ · 5 unmodified lines
66 #include <linux/pkt_cls.h>
77 #include <linux/if_ether.h>
88
9−#define TCA_ACT_SAMPLE 26
10−
119 struct tc_sample {
1210 tc_gen;
1311 };
include/uapi/linux/tc_act/tc_skbedit.h+0−2
@@ -23,8 +23,6 @@ · 22 unmodified lines
2323
2424 #include <linux/pkt_cls.h>
2525
26−#define TCA_ACT_SKBEDIT 11
27−
2826 #define SKBEDIT_F_PRIORITY 0x1
2927 #define SKBEDIT_F_QUEUE_MAPPING 0x2
3028 #define SKBEDIT_F_MARK 0x4
include/uapi/linux/tc_act/tc_skbmod.h+0−2
@@ -13,8 +13,6 @@ · 12 unmodified lines
1313
1414 #include <linux/pkt_cls.h>
1515
16−#define TCA_ACT_SKBMOD 15
17−
1816 #define SKBMOD_F_DMAC 0x1
1917 #define SKBMOD_F_SMAC 0x2
2018 #define SKBMOD_F_ETYPE 0x4
include/uapi/linux/tc_act/tc_tunnel_key.h+0−2
@@ -14,8 +14,6 @@ · 13 unmodified lines
1414
1515 #include <linux/pkt_cls.h>
1616
17−#define TCA_ACT_TUNNEL_KEY 17
18−
1917 #define TCA_TUNNEL_KEY_ACT_SET 1
2018 #define TCA_TUNNEL_KEY_ACT_RELEASE 2
2119
include/uapi/linux/tc_act/tc_vlan.h+0−2
@@ -13,8 +13,6 @@ · 12 unmodified lines
1313
1414 #include <linux/pkt_cls.h>
1515
16−#define TCA_ACT_VLAN 12
17−
1816 #define TCA_VLAN_ACT_POP 1
1917 #define TCA_VLAN_ACT_PUSH 2
2018 #define TCA_VLAN_ACT_MODIFY 3