Skip to content

Commit eddd2cf

Browse files
Eli Cohendavem330
authored andcommitted
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>
1 parent 257eede commit eddd2cf

27 files changed

Lines changed: 30 additions & 30 deletions

‎include/net/act_api.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ static inline void tcf_tm_dump(struct tcf_t *dtm, const struct tcf_t *stm)
8080
struct tc_action_ops {
8181
struct list_head head;
8282
char kind[IFNAMSIZ];
83-
__u32 type; /* TBD to match kind */
83+
enum tca_id id; /* identifier should match kind */
8484
size_t size;
8585
struct module *owner;
8686
int (*act)(struct sk_buff *, const struct tc_action *,

‎include/net/tc_act/tc_csum.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ struct tcf_csum {
2121
static inline bool is_tcf_csum(const struct tc_action *a)
2222
{
2323
#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)
2525
return true;
2626
#endif
2727
return false;

‎include/net/tc_act/tc_gact.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ static inline bool __is_tcf_gact_act(const struct tc_action *a, int act,
2222
#ifdef CONFIG_NET_CLS_ACT
2323
struct tcf_gact *gact;
2424

25-
if (a->ops && a->ops->type != TCA_ACT_GACT)
25+
if (a->ops && a->ops->id != TCA_ID_GACT)
2626
return false;
2727

2828
gact = to_gact(a);

‎include/net/tc_act/tc_mirred.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ struct tcf_mirred {
1717
static inline bool is_tcf_mirred_egress_redirect(const struct tc_action *a)
1818
{
1919
#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)
2121
return to_mirred(a)->tcfm_eaction == TCA_EGRESS_REDIR;
2222
#endif
2323
return false;
@@ -26,7 +26,7 @@ static inline bool is_tcf_mirred_egress_redirect(const struct tc_action *a)
2626
static inline bool is_tcf_mirred_egress_mirror(const struct tc_action *a)
2727
{
2828
#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)
3030
return to_mirred(a)->tcfm_eaction == TCA_EGRESS_MIRROR;
3131
#endif
3232
return false;

‎include/net/tc_act/tc_pedit.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ struct tcf_pedit {
2323
static inline bool is_tcf_pedit(const struct tc_action *a)
2424
{
2525
#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)
2727
return true;
2828
#endif
2929
return false;

‎include/net/tc_act/tc_sample.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ struct tcf_sample {
2020
static inline bool is_tcf_sample(const struct tc_action *a)
2121
{
2222
#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;
2424
#else
2525
return false;
2626
#endif

‎include/net/tc_act/tc_skbedit.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ static inline bool is_tcf_skbedit_mark(const struct tc_action *a)
4444
#ifdef CONFIG_NET_CLS_ACT
4545
u32 flags;
4646

47-
if (a->ops && a->ops->type == TCA_ACT_SKBEDIT) {
47+
if (a->ops && a->ops->id == TCA_ID_SKBEDIT) {
4848
rcu_read_lock();
4949
flags = rcu_dereference(to_skbedit(a)->params)->flags;
5050
rcu_read_unlock();

‎include/net/tc_act/tc_tunnel_key.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ static inline bool is_tcf_tunnel_set(const struct tc_action *a)
3434
struct tcf_tunnel_key *t = to_tunnel_key(a);
3535
struct tcf_tunnel_key_params *params = rtnl_dereference(t->params);
3636

37-
if (a->ops && a->ops->type == TCA_ACT_TUNNEL_KEY)
37+
if (a->ops && a->ops->id == TCA_ID_TUNNEL_KEY)
3838
return params->tcft_action == TCA_TUNNEL_KEY_ACT_SET;
3939
#endif
4040
return false;
@@ -46,7 +46,7 @@ static inline bool is_tcf_tunnel_release(const struct tc_action *a)
4646
struct tcf_tunnel_key *t = to_tunnel_key(a);
4747
struct tcf_tunnel_key_params *params = rtnl_dereference(t->params);
4848

49-
if (a->ops && a->ops->type == TCA_ACT_TUNNEL_KEY)
49+
if (a->ops && a->ops->id == TCA_ID_TUNNEL_KEY)
5050
return params->tcft_action == TCA_TUNNEL_KEY_ACT_RELEASE;
5151
#endif
5252
return false;

‎include/net/tc_act/tc_vlan.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ struct tcf_vlan {
3030
static inline bool is_tcf_vlan(const struct tc_action *a)
3131
{
3232
#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)
3434
return true;
3535
#endif
3636
return false;

‎include/uapi/linux/pkt_cls.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ enum {
8585
#define TCA_ACT_SAMPLE 26
8686

8787
/* Action type identifiers*/
88-
enum {
88+
enum tca_id {
8989
TCA_ID_UNSPEC = 0,
9090
TCA_ID_POLICE = 1,
9191
TCA_ID_GACT = TCA_ACT_GACT,

0 commit comments

Comments
 (0)