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

net: Change TCA_ACT_* to TCA_ID_* to match that of TCA_ID_POLICE

Modify the kernel users of the TCA_ACT_* macros to use TCA_ID_*. For
example, use TCA_ID_GACT instead of TCA_ACT_GACT. This will align with
TCA_ID_POLICE and also differentiates these identifier, used in struct
tc_action_ops type field, from other macros starting with TCA_ACT_.

To make things clearer, we name the enum defining the TCA_ID_*
identifiers and also change the "type" field of struct tc_action to
id.

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
eddd2cf1 257eeded

+30 -30
+1 -1
include/net/act_api.h
··· 80 80 struct tc_action_ops { 81 81 struct list_head head; 82 82 char kind[IFNAMSIZ]; 83 - __u32 type; /* TBD to match kind */ 83 + enum tca_id id; /* identifier should match kind */ 84 84 size_t size; 85 85 struct module *owner; 86 86 int (*act)(struct sk_buff *, const struct tc_action *,
+1 -1
include/net/tc_act/tc_csum.h
··· 21 21 static inline bool is_tcf_csum(const struct tc_action *a) 22 22 { 23 23 #ifdef CONFIG_NET_CLS_ACT 24 - if (a->ops && a->ops->type == TCA_ACT_CSUM) 24 + if (a->ops && a->ops->id == TCA_ID_CSUM) 25 25 return true; 26 26 #endif 27 27 return false;
+1 -1
include/net/tc_act/tc_gact.h
··· 22 22 #ifdef CONFIG_NET_CLS_ACT 23 23 struct tcf_gact *gact; 24 24 25 - if (a->ops && a->ops->type != TCA_ACT_GACT) 25 + if (a->ops && a->ops->id != TCA_ID_GACT) 26 26 return false; 27 27 28 28 gact = to_gact(a);
+2 -2
include/net/tc_act/tc_mirred.h
··· 17 17 static inline bool is_tcf_mirred_egress_redirect(const struct tc_action *a) 18 18 { 19 19 #ifdef CONFIG_NET_CLS_ACT 20 - if (a->ops && a->ops->type == TCA_ACT_MIRRED) 20 + if (a->ops && a->ops->id == TCA_ID_MIRRED) 21 21 return to_mirred(a)->tcfm_eaction == TCA_EGRESS_REDIR; 22 22 #endif 23 23 return false; ··· 26 26 static inline bool is_tcf_mirred_egress_mirror(const struct tc_action *a) 27 27 { 28 28 #ifdef CONFIG_NET_CLS_ACT 29 - if (a->ops && a->ops->type == TCA_ACT_MIRRED) 29 + if (a->ops && a->ops->id == TCA_ID_MIRRED) 30 30 return to_mirred(a)->tcfm_eaction == TCA_EGRESS_MIRROR; 31 31 #endif 32 32 return false;
+1 -1
include/net/tc_act/tc_pedit.h
··· 23 23 static inline bool is_tcf_pedit(const struct tc_action *a) 24 24 { 25 25 #ifdef CONFIG_NET_CLS_ACT 26 - if (a->ops && a->ops->type == TCA_ACT_PEDIT) 26 + if (a->ops && a->ops->id == TCA_ID_PEDIT) 27 27 return true; 28 28 #endif 29 29 return false;
+1 -1
include/net/tc_act/tc_sample.h
··· 20 20 static inline bool is_tcf_sample(const struct tc_action *a) 21 21 { 22 22 #ifdef CONFIG_NET_CLS_ACT 23 - return a->ops && a->ops->type == TCA_ACT_SAMPLE; 23 + return a->ops && a->ops->id == TCA_ID_SAMPLE; 24 24 #else 25 25 return false; 26 26 #endif
+1 -1
include/net/tc_act/tc_skbedit.h
··· 44 44 #ifdef CONFIG_NET_CLS_ACT 45 45 u32 flags; 46 46 47 - if (a->ops && a->ops->type == TCA_ACT_SKBEDIT) { 47 + if (a->ops && a->ops->id == TCA_ID_SKBEDIT) { 48 48 rcu_read_lock(); 49 49 flags = rcu_dereference(to_skbedit(a)->params)->flags; 50 50 rcu_read_unlock();
+2 -2
include/net/tc_act/tc_tunnel_key.h
··· 34 34 struct tcf_tunnel_key *t = to_tunnel_key(a); 35 35 struct tcf_tunnel_key_params *params = rtnl_dereference(t->params); 36 36 37 - if (a->ops && a->ops->type == TCA_ACT_TUNNEL_KEY) 37 + if (a->ops && a->ops->id == TCA_ID_TUNNEL_KEY) 38 38 return params->tcft_action == TCA_TUNNEL_KEY_ACT_SET; 39 39 #endif 40 40 return false; ··· 46 46 struct tcf_tunnel_key *t = to_tunnel_key(a); 47 47 struct tcf_tunnel_key_params *params = rtnl_dereference(t->params); 48 48 49 - if (a->ops && a->ops->type == TCA_ACT_TUNNEL_KEY) 49 + if (a->ops && a->ops->id == TCA_ID_TUNNEL_KEY) 50 50 return params->tcft_action == TCA_TUNNEL_KEY_ACT_RELEASE; 51 51 #endif 52 52 return false;
+1 -1
include/net/tc_act/tc_vlan.h
··· 30 30 static inline bool is_tcf_vlan(const struct tc_action *a) 31 31 { 32 32 #ifdef CONFIG_NET_CLS_ACT 33 - if (a->ops && a->ops->type == TCA_ACT_VLAN) 33 + if (a->ops && a->ops->id == TCA_ID_VLAN) 34 34 return true; 35 35 #endif 36 36 return false;
+1 -1
include/uapi/linux/pkt_cls.h
··· 85 85 #define TCA_ACT_SAMPLE 26 86 86 87 87 /* Action type identifiers*/ 88 - enum { 88 + enum tca_id { 89 89 TCA_ID_UNSPEC = 0, 90 90 TCA_ID_POLICE = 1, 91 91 TCA_ID_GACT = TCA_ACT_GACT,
+1 -1
net/sched/act_api.c
··· 543 543 544 544 write_lock(&act_mod_lock); 545 545 list_for_each_entry(a, &act_base, head) { 546 - if (act->type == a->type || (strcmp(act->kind, a->kind) == 0)) { 546 + if (act->id == a->id || (strcmp(act->kind, a->kind) == 0)) { 547 547 write_unlock(&act_mod_lock); 548 548 unregister_pernet_subsys(ops); 549 549 return -EEXIST;
+1 -1
net/sched/act_bpf.c
··· 396 396 397 397 static struct tc_action_ops act_bpf_ops __read_mostly = { 398 398 .kind = "bpf", 399 - .type = TCA_ACT_BPF, 399 + .id = TCA_ID_BPF, 400 400 .owner = THIS_MODULE, 401 401 .act = tcf_bpf_act, 402 402 .dump = tcf_bpf_dump,
+1 -1
net/sched/act_connmark.c
··· 204 204 205 205 static struct tc_action_ops act_connmark_ops = { 206 206 .kind = "connmark", 207 - .type = TCA_ACT_CONNMARK, 207 + .id = TCA_ID_CONNMARK, 208 208 .owner = THIS_MODULE, 209 209 .act = tcf_connmark_act, 210 210 .dump = tcf_connmark_dump,
+1 -1
net/sched/act_csum.c
··· 660 660 661 661 static struct tc_action_ops act_csum_ops = { 662 662 .kind = "csum", 663 - .type = TCA_ACT_CSUM, 663 + .id = TCA_ID_CSUM, 664 664 .owner = THIS_MODULE, 665 665 .act = tcf_csum_act, 666 666 .dump = tcf_csum_dump,
+1 -1
net/sched/act_gact.c
··· 253 253 254 254 static struct tc_action_ops act_gact_ops = { 255 255 .kind = "gact", 256 - .type = TCA_ACT_GACT, 256 + .id = TCA_ID_GACT, 257 257 .owner = THIS_MODULE, 258 258 .act = tcf_gact_act, 259 259 .stats_update = tcf_gact_stats_update,
+1 -1
net/sched/act_ife.c
··· 864 864 865 865 static struct tc_action_ops act_ife_ops = { 866 866 .kind = "ife", 867 - .type = TCA_ACT_IFE, 867 + .id = TCA_ID_IFE, 868 868 .owner = THIS_MODULE, 869 869 .act = tcf_ife_act, 870 870 .dump = tcf_ife_dump,
+2 -2
net/sched/act_ipt.c
··· 338 338 339 339 static struct tc_action_ops act_ipt_ops = { 340 340 .kind = "ipt", 341 - .type = TCA_ACT_IPT, 341 + .id = TCA_ID_IPT, 342 342 .owner = THIS_MODULE, 343 343 .act = tcf_ipt_act, 344 344 .dump = tcf_ipt_dump, ··· 387 387 388 388 static struct tc_action_ops act_xt_ops = { 389 389 .kind = "xt", 390 - .type = TCA_ACT_XT, 390 + .id = TCA_ID_XT, 391 391 .owner = THIS_MODULE, 392 392 .act = tcf_ipt_act, 393 393 .dump = tcf_ipt_dump,
+1 -1
net/sched/act_mirred.c
··· 400 400 401 401 static struct tc_action_ops act_mirred_ops = { 402 402 .kind = "mirred", 403 - .type = TCA_ACT_MIRRED, 403 + .id = TCA_ID_MIRRED, 404 404 .owner = THIS_MODULE, 405 405 .act = tcf_mirred_act, 406 406 .stats_update = tcf_stats_update,
+1 -1
net/sched/act_nat.c
··· 304 304 305 305 static struct tc_action_ops act_nat_ops = { 306 306 .kind = "nat", 307 - .type = TCA_ACT_NAT, 307 + .id = TCA_ID_NAT, 308 308 .owner = THIS_MODULE, 309 309 .act = tcf_nat_act, 310 310 .dump = tcf_nat_dump,
+1 -1
net/sched/act_pedit.c
··· 470 470 471 471 static struct tc_action_ops act_pedit_ops = { 472 472 .kind = "pedit", 473 - .type = TCA_ACT_PEDIT, 473 + .id = TCA_ID_PEDIT, 474 474 .owner = THIS_MODULE, 475 475 .act = tcf_pedit_act, 476 476 .dump = tcf_pedit_dump,
+1 -1
net/sched/act_police.c
··· 366 366 367 367 static struct tc_action_ops act_police_ops = { 368 368 .kind = "police", 369 - .type = TCA_ID_POLICE, 369 + .id = TCA_ID_POLICE, 370 370 .owner = THIS_MODULE, 371 371 .act = tcf_police_act, 372 372 .dump = tcf_police_dump,
+1 -1
net/sched/act_sample.c
··· 233 233 234 234 static struct tc_action_ops act_sample_ops = { 235 235 .kind = "sample", 236 - .type = TCA_ACT_SAMPLE, 236 + .id = TCA_ID_SAMPLE, 237 237 .owner = THIS_MODULE, 238 238 .act = tcf_sample_act, 239 239 .dump = tcf_sample_dump,
+1 -1
net/sched/act_simple.c
··· 195 195 196 196 static struct tc_action_ops act_simp_ops = { 197 197 .kind = "simple", 198 - .type = TCA_ACT_SIMP, 198 + .id = TCA_ID_SIMP, 199 199 .owner = THIS_MODULE, 200 200 .act = tcf_simp_act, 201 201 .dump = tcf_simp_dump,
+1 -1
net/sched/act_skbedit.c
··· 305 305 306 306 static struct tc_action_ops act_skbedit_ops = { 307 307 .kind = "skbedit", 308 - .type = TCA_ACT_SKBEDIT, 308 + .id = TCA_ID_SKBEDIT, 309 309 .owner = THIS_MODULE, 310 310 .act = tcf_skbedit_act, 311 311 .dump = tcf_skbedit_dump,
+1 -1
net/sched/act_skbmod.c
··· 260 260 261 261 static struct tc_action_ops act_skbmod_ops = { 262 262 .kind = "skbmod", 263 - .type = TCA_ACT_SKBMOD, 263 + .id = TCA_ACT_SKBMOD, 264 264 .owner = THIS_MODULE, 265 265 .act = tcf_skbmod_act, 266 266 .dump = tcf_skbmod_dump,
+1 -1
net/sched/act_tunnel_key.c
··· 563 563 564 564 static struct tc_action_ops act_tunnel_key_ops = { 565 565 .kind = "tunnel_key", 566 - .type = TCA_ACT_TUNNEL_KEY, 566 + .id = TCA_ID_TUNNEL_KEY, 567 567 .owner = THIS_MODULE, 568 568 .act = tunnel_key_act, 569 569 .dump = tunnel_key_dump,
+1 -1
net/sched/act_vlan.c
··· 297 297 298 298 static struct tc_action_ops act_vlan_ops = { 299 299 .kind = "vlan", 300 - .type = TCA_ACT_VLAN, 300 + .id = TCA_ID_VLAN, 301 301 .owner = THIS_MODULE, 302 302 .act = tcf_vlan_act, 303 303 .dump = tcf_vlan_dump,