Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.

Signed-off-by: Eli Cohen <eli@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Eli Cohen and committed by
David S. Miller
257eeded 99c86466

+40 -33
+40 -3
include/uapi/linux/pkt_cls.h
··· 63 63 #define TC_ACT_GOTO_CHAIN __TC_ACT_EXT(2) 64 64 #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 87 /* Action type identifiers*/ 67 88 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, 70 107 /* other actions go here */ 71 - __TCA_ID_MAX=255 108 + __TCA_ID_MAX = 255 72 109 }; 73 110 74 111 #define TCA_ID_MAX __TCA_ID_MAX
-2
include/uapi/linux/tc_act/tc_bpf.h
··· 13 13 14 14 #include <linux/pkt_cls.h> 15 15 16 - #define TCA_ACT_BPF 13 17 - 18 16 struct tc_act_bpf { 19 17 tc_gen; 20 18 };
-2
include/uapi/linux/tc_act/tc_connmark.h
··· 5 5 #include <linux/types.h> 6 6 #include <linux/pkt_cls.h> 7 7 8 - #define TCA_ACT_CONNMARK 14 9 - 10 8 struct tc_connmark { 11 9 tc_gen; 12 10 __u16 zone;
-2
include/uapi/linux/tc_act/tc_csum.h
··· 5 5 #include <linux/types.h> 6 6 #include <linux/pkt_cls.h> 7 7 8 - #define TCA_ACT_CSUM 16 9 - 10 8 enum { 11 9 TCA_CSUM_UNSPEC, 12 10 TCA_CSUM_PARMS,
-1
include/uapi/linux/tc_act/tc_gact.h
··· 5 5 #include <linux/types.h> 6 6 #include <linux/pkt_cls.h> 7 7 8 - #define TCA_ACT_GACT 5 9 8 struct tc_gact { 10 9 tc_gen; 11 10
-1
include/uapi/linux/tc_act/tc_ife.h
··· 6 6 #include <linux/pkt_cls.h> 7 7 #include <linux/ife.h> 8 8 9 - #define TCA_ACT_IFE 25 10 9 /* Flag bits for now just encoding/decoding; mutually exclusive */ 11 10 #define IFE_ENCODE 1 12 11 #define IFE_DECODE 0
-3
include/uapi/linux/tc_act/tc_ipt.h
··· 4 4 5 5 #include <linux/pkt_cls.h> 6 6 7 - #define TCA_ACT_IPT 6 8 - #define TCA_ACT_XT 10 9 - 10 7 enum { 11 8 TCA_IPT_UNSPEC, 12 9 TCA_IPT_TABLE,
-1
include/uapi/linux/tc_act/tc_mirred.h
··· 5 5 #include <linux/types.h> 6 6 #include <linux/pkt_cls.h> 7 7 8 - #define TCA_ACT_MIRRED 8 9 8 #define TCA_EGRESS_REDIR 1 /* packet redirect to EGRESS*/ 10 9 #define TCA_EGRESS_MIRROR 2 /* mirror packet to EGRESS */ 11 10 #define TCA_INGRESS_REDIR 3 /* packet redirect to INGRESS*/
-2
include/uapi/linux/tc_act/tc_nat.h
··· 5 5 #include <linux/pkt_cls.h> 6 6 #include <linux/types.h> 7 7 8 - #define TCA_ACT_NAT 9 9 - 10 8 enum { 11 9 TCA_NAT_UNSPEC, 12 10 TCA_NAT_PARMS,
-2
include/uapi/linux/tc_act/tc_pedit.h
··· 5 5 #include <linux/types.h> 6 6 #include <linux/pkt_cls.h> 7 7 8 - #define TCA_ACT_PEDIT 7 9 - 10 8 enum { 11 9 TCA_PEDIT_UNSPEC, 12 10 TCA_PEDIT_TM,
-2
include/uapi/linux/tc_act/tc_sample.h
··· 6 6 #include <linux/pkt_cls.h> 7 7 #include <linux/if_ether.h> 8 8 9 - #define TCA_ACT_SAMPLE 26 10 - 11 9 struct tc_sample { 12 10 tc_gen; 13 11 };
-2
include/uapi/linux/tc_act/tc_skbedit.h
··· 23 23 24 24 #include <linux/pkt_cls.h> 25 25 26 - #define TCA_ACT_SKBEDIT 11 27 - 28 26 #define SKBEDIT_F_PRIORITY 0x1 29 27 #define SKBEDIT_F_QUEUE_MAPPING 0x2 30 28 #define SKBEDIT_F_MARK 0x4
-2
include/uapi/linux/tc_act/tc_skbmod.h
··· 13 13 14 14 #include <linux/pkt_cls.h> 15 15 16 - #define TCA_ACT_SKBMOD 15 17 - 18 16 #define SKBMOD_F_DMAC 0x1 19 17 #define SKBMOD_F_SMAC 0x2 20 18 #define SKBMOD_F_ETYPE 0x4
-2
include/uapi/linux/tc_act/tc_tunnel_key.h
··· 14 14 15 15 #include <linux/pkt_cls.h> 16 16 17 - #define TCA_ACT_TUNNEL_KEY 17 18 - 19 17 #define TCA_TUNNEL_KEY_ACT_SET 1 20 18 #define TCA_TUNNEL_KEY_ACT_RELEASE 2 21 19
-2
include/uapi/linux/tc_act/tc_vlan.h
··· 13 13 14 14 #include <linux/pkt_cls.h> 15 15 16 - #define TCA_ACT_VLAN 12 17 - 18 16 #define TCA_VLAN_ACT_POP 1 19 17 #define TCA_VLAN_ACT_PUSH 2 20 18 #define TCA_VLAN_ACT_MODIFY 3
-2
net/sched/act_simple.c
··· 19 19 #include <net/netlink.h> 20 20 #include <net/pkt_sched.h> 21 21 22 - #define TCA_ACT_SIMP 22 23 - 24 22 #include <linux/tc_act/tc_defact.h> 25 23 #include <net/tc_act/tc_defact.h> 26 24
-2
tools/include/uapi/linux/tc_act/tc_bpf.h
··· 13 13 14 14 #include <linux/pkt_cls.h> 15 15 16 - #define TCA_ACT_BPF 13 17 - 18 16 struct tc_act_bpf { 19 17 tc_gen; 20 18 };