Skip to content

Commit ec0595c

Browse files
congwangdavem330
authored andcommitted
net_sched: get rid of struct tcf_common
After the previous patch, struct tc_action should be enough to represent the generic tc action, tcf_common is not necessary any more. This patch gets rid of it to make tc action code more readable. Cc: Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent a85a970 commit ec0595c

File tree

15 files changed

+114
-122
lines changed

15 files changed

+114
-122
lines changed

include/net/act_api.h

Lines changed: 30 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -22,42 +22,39 @@ struct tc_action_ops;
2222

2323
struct tc_action {
2424
const struct tc_action_ops *ops;
25-
__u32 type; /* for backward compat(TCA_OLD_COMPAT) */
26-
__u32 order;
27-
struct list_head list;
28-
struct tcf_hashinfo *hinfo;
29-
};
30-
31-
struct tcf_common {
32-
struct tc_action tcfc_act;
33-
struct hlist_node tcfc_head;
34-
u32 tcfc_index;
35-
int tcfc_refcnt;
36-
int tcfc_bindcnt;
37-
u32 tcfc_capab;
38-
int tcfc_action;
39-
struct tcf_t tcfc_tm;
40-
struct gnet_stats_basic_packed tcfc_bstats;
41-
struct gnet_stats_queue tcfc_qstats;
42-
struct gnet_stats_rate_est64 tcfc_rate_est;
43-
spinlock_t tcfc_lock;
44-
struct rcu_head tcfc_rcu;
25+
__u32 type; /* for backward compat(TCA_OLD_COMPAT) */
26+
__u32 order;
27+
struct list_head list;
28+
struct tcf_hashinfo *hinfo;
29+
30+
struct hlist_node tcfa_head;
31+
u32 tcfa_index;
32+
int tcfa_refcnt;
33+
int tcfa_bindcnt;
34+
u32 tcfa_capab;
35+
int tcfa_action;
36+
struct tcf_t tcfa_tm;
37+
struct gnet_stats_basic_packed tcfa_bstats;
38+
struct gnet_stats_queue tcfa_qstats;
39+
struct gnet_stats_rate_est64 tcfa_rate_est;
40+
spinlock_t tcfa_lock;
41+
struct rcu_head tcfa_rcu;
4542
struct gnet_stats_basic_cpu __percpu *cpu_bstats;
4643
struct gnet_stats_queue __percpu *cpu_qstats;
4744
};
48-
#define tcf_act common.tcfc_act
49-
#define tcf_head common.tcfc_head
50-
#define tcf_index common.tcfc_index
51-
#define tcf_refcnt common.tcfc_refcnt
52-
#define tcf_bindcnt common.tcfc_bindcnt
53-
#define tcf_capab common.tcfc_capab
54-
#define tcf_action common.tcfc_action
55-
#define tcf_tm common.tcfc_tm
56-
#define tcf_bstats common.tcfc_bstats
57-
#define tcf_qstats common.tcfc_qstats
58-
#define tcf_rate_est common.tcfc_rate_est
59-
#define tcf_lock common.tcfc_lock
60-
#define tcf_rcu common.tcfc_rcu
45+
#define tcf_act common.tcfa_act
46+
#define tcf_head common.tcfa_head
47+
#define tcf_index common.tcfa_index
48+
#define tcf_refcnt common.tcfa_refcnt
49+
#define tcf_bindcnt common.tcfa_bindcnt
50+
#define tcf_capab common.tcfa_capab
51+
#define tcf_action common.tcfa_action
52+
#define tcf_tm common.tcfa_tm
53+
#define tcf_bstats common.tcfa_bstats
54+
#define tcf_qstats common.tcfa_qstats
55+
#define tcf_rate_est common.tcfa_rate_est
56+
#define tcf_lock common.tcfa_lock
57+
#define tcf_rcu common.tcfa_rcu
6158

6259
static inline unsigned int tcf_hash(u32 index, unsigned int hmask)
6360
{

include/net/tc_act/tc_bpf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include <net/act_api.h>
1515

1616
struct tcf_bpf {
17-
struct tcf_common common;
17+
struct tc_action common;
1818
struct bpf_prog __rcu *filter;
1919
union {
2020
u32 bpf_fd;

include/net/tc_act/tc_connmark.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include <net/act_api.h>
55

66
struct tcf_connmark_info {
7-
struct tcf_common common;
7+
struct tc_action common;
88
struct net *net;
99
u16 zone;
1010
};

include/net/tc_act/tc_csum.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include <net/act_api.h>
66

77
struct tcf_csum {
8-
struct tcf_common common;
8+
struct tc_action common;
99

1010
u32 update_flags;
1111
};

include/net/tc_act/tc_defact.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include <net/act_api.h>
55

66
struct tcf_defact {
7-
struct tcf_common common;
7+
struct tc_action common;
88
u32 tcfd_datalen;
99
void *tcfd_defdata;
1010
};

include/net/tc_act/tc_gact.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include <linux/tc_act/tc_gact.h>
66

77
struct tcf_gact {
8-
struct tcf_common common;
8+
struct tc_action common;
99
#ifdef CONFIG_GACT_PROB
1010
u16 tcfg_ptype;
1111
u16 tcfg_pval;

include/net/tc_act/tc_ife.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#define IFE_METAHDRLEN 2
1010
struct tcf_ife_info {
11-
struct tcf_common common;
11+
struct tc_action common;
1212
u8 eth_dst[ETH_ALEN];
1313
u8 eth_src[ETH_ALEN];
1414
u16 eth_type;

include/net/tc_act/tc_ipt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
struct xt_entry_target;
77

88
struct tcf_ipt {
9-
struct tcf_common common;
9+
struct tc_action common;
1010
u32 tcfi_hook;
1111
char *tcfi_tname;
1212
struct xt_entry_target *tcfi_t;

include/net/tc_act/tc_mirred.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include <linux/tc_act/tc_mirred.h>
66

77
struct tcf_mirred {
8-
struct tcf_common common;
8+
struct tc_action common;
99
int tcfm_eaction;
1010
int tcfm_ifindex;
1111
int tcfm_ok_push;

include/net/tc_act/tc_nat.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include <net/act_api.h>
66

77
struct tcf_nat {
8-
struct tcf_common common;
8+
struct tc_action common;
99

1010
__be32 old_addr;
1111
__be32 new_addr;

0 commit comments

Comments
 (0)