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
63#define TC_ACT_GOTO_CHAIN __TC_ACT_EXT(2)63#define TC_ACT_GOTO_CHAIN __TC_ACT_EXT(2)
64#define TC_ACT_EXT_OPCODE_MAX TC_ACT_GOTO_CHAIN64#define TC_ACT_EXT_OPCODE_MAX TC_ACT_GOTO_CHAIN
65 65
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
66/* Action type identifiers*/87/* Action type identifiers*/
67enum {88enum {
68 TCA_ID_UNSPEC=0,89 TCA_ID_UNSPEC = 0,
69 TCA_ID_POLICE=1,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,
70 /* other actions go here */107 /* other actions go here */
71 __TCA_ID_MAX=255108 __TCA_ID_MAX = 255
72};109};
73 110
74#define TCA_ID_MAX __TCA_ID_MAX111#define TCA_ID_MAX __TCA_ID_MAX
include/uapi/linux/tc_act/tc_bpf.h+0−2
@@ -13,8 +13,6 @@ · 12 unmodified lines
13 13
14#include <linux/pkt_cls.h>14#include <linux/pkt_cls.h>
15 15
16#define TCA_ACT_BPF 13
17
18struct tc_act_bpf {16struct tc_act_bpf {
19 tc_gen;17 tc_gen;
20};18};
include/uapi/linux/tc_act/tc_connmark.h+0−2
@@ -5,8 +5,6 @@ · 4 unmodified lines
5#include <linux/types.h>5#include <linux/types.h>
6#include <linux/pkt_cls.h>6#include <linux/pkt_cls.h>
7 7
8#define TCA_ACT_CONNMARK 14
9
10struct tc_connmark {8struct tc_connmark {
11 tc_gen;9 tc_gen;
12 __u16 zone;10 __u16 zone;
include/uapi/linux/tc_act/tc_csum.h+0−2
@@ -5,8 +5,6 @@ · 4 unmodified lines
5#include <linux/types.h>5#include <linux/types.h>
6#include <linux/pkt_cls.h>6#include <linux/pkt_cls.h>
7 7
8#define TCA_ACT_CSUM 16
9
10enum {8enum {
11 TCA_CSUM_UNSPEC,9 TCA_CSUM_UNSPEC,
12 TCA_CSUM_PARMS,10 TCA_CSUM_PARMS,
include/uapi/linux/tc_act/tc_gact.h+0−1
@@ -5,7 +5,6 @@ · 4 unmodified lines
5#include <linux/types.h>5#include <linux/types.h>
6#include <linux/pkt_cls.h>6#include <linux/pkt_cls.h>
7 7
8#define TCA_ACT_GACT 5
9struct tc_gact {8struct tc_gact {
10 tc_gen;9 tc_gen;
11 10
include/uapi/linux/tc_act/tc_ife.h+0−1
@@ -6,7 +6,6 @@ · 5 unmodified lines
6#include <linux/pkt_cls.h>6#include <linux/pkt_cls.h>
7#include <linux/ife.h>7#include <linux/ife.h>
8 8
9#define TCA_ACT_IFE 25
10/* Flag bits for now just encoding/decoding; mutually exclusive */9/* Flag bits for now just encoding/decoding; mutually exclusive */
11#define IFE_ENCODE 110#define IFE_ENCODE 1
12#define IFE_DECODE 011#define IFE_DECODE 0
include/uapi/linux/tc_act/tc_ipt.h+0−3
@@ -4,9 +4,6 @@ · 3 unmodified lines
4 4
5#include <linux/pkt_cls.h>5#include <linux/pkt_cls.h>
6 6
7#define TCA_ACT_IPT 6
8#define TCA_ACT_XT 10
9
10enum {7enum {
11 TCA_IPT_UNSPEC,8 TCA_IPT_UNSPEC,
12 TCA_IPT_TABLE,9 TCA_IPT_TABLE,
include/uapi/linux/tc_act/tc_mirred.h+0−1
@@ -5,7 +5,6 @@ · 4 unmodified lines
5#include <linux/types.h>5#include <linux/types.h>
6#include <linux/pkt_cls.h>6#include <linux/pkt_cls.h>
7 7
8#define TCA_ACT_MIRRED 8
9#define TCA_EGRESS_REDIR 1 /* packet redirect to EGRESS*/8#define TCA_EGRESS_REDIR 1 /* packet redirect to EGRESS*/
10#define TCA_EGRESS_MIRROR 2 /* mirror packet to EGRESS */9#define TCA_EGRESS_MIRROR 2 /* mirror packet to EGRESS */
11#define TCA_INGRESS_REDIR 3 /* packet redirect to INGRESS*/10#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
5#include <linux/pkt_cls.h>5#include <linux/pkt_cls.h>
6#include <linux/types.h>6#include <linux/types.h>
7 7
8#define TCA_ACT_NAT 9
9
10enum {8enum {
11 TCA_NAT_UNSPEC,9 TCA_NAT_UNSPEC,
12 TCA_NAT_PARMS,10 TCA_NAT_PARMS,
include/uapi/linux/tc_act/tc_pedit.h+0−2
@@ -5,8 +5,6 @@ · 4 unmodified lines
5#include <linux/types.h>5#include <linux/types.h>
6#include <linux/pkt_cls.h>6#include <linux/pkt_cls.h>
7 7
8#define TCA_ACT_PEDIT 7
9
10enum {8enum {
11 TCA_PEDIT_UNSPEC,9 TCA_PEDIT_UNSPEC,
12 TCA_PEDIT_TM,10 TCA_PEDIT_TM,
include/uapi/linux/tc_act/tc_sample.h+0−2
@@ -6,8 +6,6 @@ · 5 unmodified lines
6#include <linux/pkt_cls.h>6#include <linux/pkt_cls.h>
7#include <linux/if_ether.h>7#include <linux/if_ether.h>
8 8
9#define TCA_ACT_SAMPLE 26
10
11struct tc_sample {9struct tc_sample {
12 tc_gen;10 tc_gen;
13};11};
include/uapi/linux/tc_act/tc_skbedit.h+0−2
@@ -23,8 +23,6 @@ · 22 unmodified lines
23 23
24#include <linux/pkt_cls.h>24#include <linux/pkt_cls.h>
25 25
26#define TCA_ACT_SKBEDIT 11
27
28#define SKBEDIT_F_PRIORITY 0x126#define SKBEDIT_F_PRIORITY 0x1
29#define SKBEDIT_F_QUEUE_MAPPING 0x227#define SKBEDIT_F_QUEUE_MAPPING 0x2
30#define SKBEDIT_F_MARK 0x428#define SKBEDIT_F_MARK 0x4
include/uapi/linux/tc_act/tc_skbmod.h+0−2
@@ -13,8 +13,6 @@ · 12 unmodified lines
13 13
14#include <linux/pkt_cls.h>14#include <linux/pkt_cls.h>
15 15
16#define TCA_ACT_SKBMOD 15
17
18#define SKBMOD_F_DMAC 0x116#define SKBMOD_F_DMAC 0x1
19#define SKBMOD_F_SMAC 0x217#define SKBMOD_F_SMAC 0x2
20#define SKBMOD_F_ETYPE 0x418#define SKBMOD_F_ETYPE 0x4
include/uapi/linux/tc_act/tc_tunnel_key.h+0−2
@@ -14,8 +14,6 @@ · 13 unmodified lines
14 14
15#include <linux/pkt_cls.h>15#include <linux/pkt_cls.h>
16 16
17#define TCA_ACT_TUNNEL_KEY 17
18
19#define TCA_TUNNEL_KEY_ACT_SET 117#define TCA_TUNNEL_KEY_ACT_SET 1
20#define TCA_TUNNEL_KEY_ACT_RELEASE 218#define TCA_TUNNEL_KEY_ACT_RELEASE 2
21 19
include/uapi/linux/tc_act/tc_vlan.h+0−2
@@ -13,8 +13,6 @@ · 12 unmodified lines
13 13
14#include <linux/pkt_cls.h>14#include <linux/pkt_cls.h>
15 15
16#define TCA_ACT_VLAN 12
17
18#define TCA_VLAN_ACT_POP 116#define TCA_VLAN_ACT_POP 1
19#define TCA_VLAN_ACT_PUSH 217#define TCA_VLAN_ACT_PUSH 2
20#define TCA_VLAN_ACT_MODIFY 318#define TCA_VLAN_ACT_MODIFY 3