aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorWANG Cong <xiyou.wangcong@gmail.com>2014-01-17 14:37:02 -0500
committerDavid S. Miller <davem@davemloft.net>2014-01-21 17:43:16 -0500
commitc779f7af99f73abb7270dcaa4c29178ab5ef7472 (patch)
tree166e92b6b61aa2259c91e96fac1683ffe2fb8c13 /net
parent75e4364f67d9cb996f9a6ff982ad9b3700648591 (diff)
net_sched: act: fetch hinfo from a->ops->hinfo
Every action ops has a pointer to hash info, so we don't need to hard-code it in each module. Cc: Jamal Hadi Salim <jhs@mojatatu.com> Cc: David S. Miller <davem@davemloft.net> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/sched/act_api.c23
-rw-r--r--net/sched/act_csum.c9
-rw-r--r--net/sched/act_gact.c11
-rw-r--r--net/sched/act_ipt.c7
-rw-r--r--net/sched/act_mirred.c7
-rw-r--r--net/sched/act_nat.c9
-rw-r--r--net/sched/act_pedit.c9
-rw-r--r--net/sched/act_police.c18
-rw-r--r--net/sched/act_simple.c7
-rw-r--r--net/sched/act_skbedit.c9
10 files changed, 51 insertions, 58 deletions
diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index 35f89e9ce49c..b94825322d4d 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -62,8 +62,9 @@ int tcf_hash_release(struct tcf_common *p, int bind,
62EXPORT_SYMBOL(tcf_hash_release); 62EXPORT_SYMBOL(tcf_hash_release);
63 63
64static int tcf_dump_walker(struct sk_buff *skb, struct netlink_callback *cb, 64static int tcf_dump_walker(struct sk_buff *skb, struct netlink_callback *cb,
65 struct tc_action *a, struct tcf_hashinfo *hinfo) 65 struct tc_action *a)
66{ 66{
67 struct tcf_hashinfo *hinfo = a->ops->hinfo;
67 struct hlist_head *head; 68 struct hlist_head *head;
68 struct tcf_common *p; 69 struct tcf_common *p;
69 int err = 0, index = -1, i = 0, s_i = 0, n_i = 0; 70 int err = 0, index = -1, i = 0, s_i = 0, n_i = 0;
@@ -109,9 +110,9 @@ nla_put_failure:
109 goto done; 110 goto done;
110} 111}
111 112
112static int tcf_del_walker(struct sk_buff *skb, struct tc_action *a, 113static int tcf_del_walker(struct sk_buff *skb, struct tc_action *a)
113 struct tcf_hashinfo *hinfo)
114{ 114{
115 struct tcf_hashinfo *hinfo = a->ops->hinfo;
115 struct hlist_head *head; 116 struct hlist_head *head;
116 struct hlist_node *n; 117 struct hlist_node *n;
117 struct tcf_common *p; 118 struct tcf_common *p;
@@ -145,12 +146,10 @@ nla_put_failure:
145static int tcf_generic_walker(struct sk_buff *skb, struct netlink_callback *cb, 146static int tcf_generic_walker(struct sk_buff *skb, struct netlink_callback *cb,
146 int type, struct tc_action *a) 147 int type, struct tc_action *a)
147{ 148{
148 struct tcf_hashinfo *hinfo = a->ops->hinfo;
149
150 if (type == RTM_DELACTION) { 149 if (type == RTM_DELACTION) {
151 return tcf_del_walker(skb, a, hinfo); 150 return tcf_del_walker(skb, a);
152 } else if (type == RTM_GETACTION) { 151 } else if (type == RTM_GETACTION) {
153 return tcf_dump_walker(skb, cb, a, hinfo); 152 return tcf_dump_walker(skb, cb, a);
154 } else { 153 } else {
155 WARN(1, "tcf_generic_walker: unknown action %d\n", type); 154 WARN(1, "tcf_generic_walker: unknown action %d\n", type);
156 return -EINVAL; 155 return -EINVAL;
@@ -199,9 +198,9 @@ static int tcf_hash_search(struct tc_action *a, u32 index)
199 return 0; 198 return 0;
200} 199}
201 200
202struct tcf_common *tcf_hash_check(u32 index, struct tc_action *a, int bind, 201struct tcf_common *tcf_hash_check(u32 index, struct tc_action *a, int bind)
203 struct tcf_hashinfo *hinfo)
204{ 202{
203 struct tcf_hashinfo *hinfo = a->ops->hinfo;
205 struct tcf_common *p = NULL; 204 struct tcf_common *p = NULL;
206 if (index && (p = tcf_hash_lookup(index, hinfo)) != NULL) { 205 if (index && (p = tcf_hash_lookup(index, hinfo)) != NULL) {
207 if (bind) 206 if (bind)
@@ -214,9 +213,9 @@ struct tcf_common *tcf_hash_check(u32 index, struct tc_action *a, int bind,
214EXPORT_SYMBOL(tcf_hash_check); 213EXPORT_SYMBOL(tcf_hash_check);
215 214
216struct tcf_common *tcf_hash_create(u32 index, struct nlattr *est, 215struct tcf_common *tcf_hash_create(u32 index, struct nlattr *est,
217 struct tc_action *a, int size, int bind, 216 struct tc_action *a, int size, int bind)
218 struct tcf_hashinfo *hinfo)
219{ 217{
218 struct tcf_hashinfo *hinfo = a->ops->hinfo;
220 struct tcf_common *p = kzalloc(size, GFP_KERNEL); 219 struct tcf_common *p = kzalloc(size, GFP_KERNEL);
221 220
222 if (unlikely(!p)) 221 if (unlikely(!p))
@@ -495,6 +494,7 @@ struct tc_action *tcf_action_init_1(struct net *net, struct nlattr *nla,
495 if (a == NULL) 494 if (a == NULL)
496 goto err_mod; 495 goto err_mod;
497 496
497 a->ops = a_o;
498 INIT_LIST_HEAD(&a->list); 498 INIT_LIST_HEAD(&a->list);
499 /* backward compatibility for policer */ 499 /* backward compatibility for policer */
500 if (name == NULL) 500 if (name == NULL)
@@ -510,7 +510,6 @@ struct tc_action *tcf_action_init_1(struct net *net, struct nlattr *nla,
510 */ 510 */
511 if (err != ACT_P_CREATED) 511 if (err != ACT_P_CREATED)
512 module_put(a_o->owner); 512 module_put(a_o->owner);
513 a->ops = a_o;
514 513
515 return a; 514 return a;
516 515
diff --git a/net/sched/act_csum.c b/net/sched/act_csum.c
index 9d5c1d343fe2..2210187c45c2 100644
--- a/net/sched/act_csum.c
+++ b/net/sched/act_csum.c
@@ -63,17 +63,16 @@ static int tcf_csum_init(struct net *n, struct nlattr *nla, struct nlattr *est,
63 return -EINVAL; 63 return -EINVAL;
64 parm = nla_data(tb[TCA_CSUM_PARMS]); 64 parm = nla_data(tb[TCA_CSUM_PARMS]);
65 65
66 pc = tcf_hash_check(parm->index, a, bind, &csum_hash_info); 66 pc = tcf_hash_check(parm->index, a, bind);
67 if (!pc) { 67 if (!pc) {
68 pc = tcf_hash_create(parm->index, est, a, sizeof(*p), bind, 68 pc = tcf_hash_create(parm->index, est, a, sizeof(*p), bind);
69 &csum_hash_info);
70 if (IS_ERR(pc)) 69 if (IS_ERR(pc))
71 return PTR_ERR(pc); 70 return PTR_ERR(pc);
72 ret = ACT_P_CREATED; 71 ret = ACT_P_CREATED;
73 } else { 72 } else {
74 if (bind)/* dont override defaults */ 73 if (bind)/* dont override defaults */
75 return 0; 74 return 0;
76 tcf_hash_release(pc, bind, &csum_hash_info); 75 tcf_hash_release(pc, bind, a->ops->hinfo);
77 if (!ovr) 76 if (!ovr)
78 return -EEXIST; 77 return -EEXIST;
79 } 78 }
@@ -85,7 +84,7 @@ static int tcf_csum_init(struct net *n, struct nlattr *nla, struct nlattr *est,
85 spin_unlock_bh(&p->tcf_lock); 84 spin_unlock_bh(&p->tcf_lock);
86 85
87 if (ret == ACT_P_CREATED) 86 if (ret == ACT_P_CREATED)
88 tcf_hash_insert(pc, &csum_hash_info); 87 tcf_hash_insert(pc, a->ops->hinfo);
89 88
90 return ret; 89 return ret;
91} 90}
diff --git a/net/sched/act_gact.c b/net/sched/act_gact.c
index 72c49de50616..a0eed30d5811 100644
--- a/net/sched/act_gact.c
+++ b/net/sched/act_gact.c
@@ -86,17 +86,16 @@ static int tcf_gact_init(struct net *net, struct nlattr *nla,
86 } 86 }
87#endif 87#endif
88 88
89 pc = tcf_hash_check(parm->index, a, bind, &gact_hash_info); 89 pc = tcf_hash_check(parm->index, a, bind);
90 if (!pc) { 90 if (!pc) {
91 pc = tcf_hash_create(parm->index, est, a, sizeof(*gact), 91 pc = tcf_hash_create(parm->index, est, a, sizeof(*gact), bind);
92 bind, &gact_hash_info);
93 if (IS_ERR(pc)) 92 if (IS_ERR(pc))
94 return PTR_ERR(pc); 93 return PTR_ERR(pc);
95 ret = ACT_P_CREATED; 94 ret = ACT_P_CREATED;
96 } else { 95 } else {
97 if (bind)/* dont override defaults */ 96 if (bind)/* dont override defaults */
98 return 0; 97 return 0;
99 tcf_hash_release(pc, bind, &gact_hash_info); 98 tcf_hash_release(pc, bind, a->ops->hinfo);
100 if (!ovr) 99 if (!ovr)
101 return -EEXIST; 100 return -EEXIST;
102 } 101 }
@@ -114,7 +113,7 @@ static int tcf_gact_init(struct net *net, struct nlattr *nla,
114#endif 113#endif
115 spin_unlock_bh(&gact->tcf_lock); 114 spin_unlock_bh(&gact->tcf_lock);
116 if (ret == ACT_P_CREATED) 115 if (ret == ACT_P_CREATED)
117 tcf_hash_insert(pc, &gact_hash_info); 116 tcf_hash_insert(pc, a->ops->hinfo);
118 return ret; 117 return ret;
119} 118}
120 119
@@ -123,7 +122,7 @@ static int tcf_gact_cleanup(struct tc_action *a, int bind)
123 struct tcf_gact *gact = a->priv; 122 struct tcf_gact *gact = a->priv;
124 123
125 if (gact) 124 if (gact)
126 return tcf_hash_release(&gact->common, bind, &gact_hash_info); 125 return tcf_hash_release(&gact->common, bind, a->ops->hinfo);
127 return 0; 126 return 0;
128} 127}
129 128
diff --git a/net/sched/act_ipt.c b/net/sched/act_ipt.c
index 67d701e0a2bd..0a6d62174027 100644
--- a/net/sched/act_ipt.c
+++ b/net/sched/act_ipt.c
@@ -125,10 +125,9 @@ static int tcf_ipt_init(struct net *net, struct nlattr *nla, struct nlattr *est,
125 if (tb[TCA_IPT_INDEX] != NULL) 125 if (tb[TCA_IPT_INDEX] != NULL)
126 index = nla_get_u32(tb[TCA_IPT_INDEX]); 126 index = nla_get_u32(tb[TCA_IPT_INDEX]);
127 127
128 pc = tcf_hash_check(index, a, bind, &ipt_hash_info); 128 pc = tcf_hash_check(index, a, bind);
129 if (!pc) { 129 if (!pc) {
130 pc = tcf_hash_create(index, est, a, sizeof(*ipt), bind, 130 pc = tcf_hash_create(index, est, a, sizeof(*ipt), bind);
131 &ipt_hash_info);
132 if (IS_ERR(pc)) 131 if (IS_ERR(pc))
133 return PTR_ERR(pc); 132 return PTR_ERR(pc);
134 ret = ACT_P_CREATED; 133 ret = ACT_P_CREATED;
@@ -171,7 +170,7 @@ static int tcf_ipt_init(struct net *net, struct nlattr *nla, struct nlattr *est,
171 ipt->tcfi_hook = hook; 170 ipt->tcfi_hook = hook;
172 spin_unlock_bh(&ipt->tcf_lock); 171 spin_unlock_bh(&ipt->tcf_lock);
173 if (ret == ACT_P_CREATED) 172 if (ret == ACT_P_CREATED)
174 tcf_hash_insert(pc, &ipt_hash_info); 173 tcf_hash_insert(pc, a->ops->hinfo);
175 return ret; 174 return ret;
176 175
177err3: 176err3:
diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c
index 376234ee8514..0b2c6d39d396 100644
--- a/net/sched/act_mirred.c
+++ b/net/sched/act_mirred.c
@@ -101,12 +101,11 @@ static int tcf_mirred_init(struct net *net, struct nlattr *nla,
101 dev = NULL; 101 dev = NULL;
102 } 102 }
103 103
104 pc = tcf_hash_check(parm->index, a, bind, &mirred_hash_info); 104 pc = tcf_hash_check(parm->index, a, bind);
105 if (!pc) { 105 if (!pc) {
106 if (dev == NULL) 106 if (dev == NULL)
107 return -EINVAL; 107 return -EINVAL;
108 pc = tcf_hash_create(parm->index, est, a, sizeof(*m), bind, 108 pc = tcf_hash_create(parm->index, est, a, sizeof(*m), bind);
109 &mirred_hash_info);
110 if (IS_ERR(pc)) 109 if (IS_ERR(pc))
111 return PTR_ERR(pc); 110 return PTR_ERR(pc);
112 ret = ACT_P_CREATED; 111 ret = ACT_P_CREATED;
@@ -132,7 +131,7 @@ static int tcf_mirred_init(struct net *net, struct nlattr *nla,
132 spin_unlock_bh(&m->tcf_lock); 131 spin_unlock_bh(&m->tcf_lock);
133 if (ret == ACT_P_CREATED) { 132 if (ret == ACT_P_CREATED) {
134 list_add(&m->tcfm_list, &mirred_list); 133 list_add(&m->tcfm_list, &mirred_list);
135 tcf_hash_insert(pc, &mirred_hash_info); 134 tcf_hash_insert(pc, a->ops->hinfo);
136 } 135 }
137 136
138 return ret; 137 return ret;
diff --git a/net/sched/act_nat.c b/net/sched/act_nat.c
index 46e1aa36b147..81f0404bb335 100644
--- a/net/sched/act_nat.c
+++ b/net/sched/act_nat.c
@@ -57,17 +57,16 @@ static int tcf_nat_init(struct net *net, struct nlattr *nla, struct nlattr *est,
57 return -EINVAL; 57 return -EINVAL;
58 parm = nla_data(tb[TCA_NAT_PARMS]); 58 parm = nla_data(tb[TCA_NAT_PARMS]);
59 59
60 pc = tcf_hash_check(parm->index, a, bind, &nat_hash_info); 60 pc = tcf_hash_check(parm->index, a, bind);
61 if (!pc) { 61 if (!pc) {
62 pc = tcf_hash_create(parm->index, est, a, sizeof(*p), bind, 62 pc = tcf_hash_create(parm->index, est, a, sizeof(*p), bind);
63 &nat_hash_info);
64 if (IS_ERR(pc)) 63 if (IS_ERR(pc))
65 return PTR_ERR(pc); 64 return PTR_ERR(pc);
66 ret = ACT_P_CREATED; 65 ret = ACT_P_CREATED;
67 } else { 66 } else {
68 if (bind) 67 if (bind)
69 return 0; 68 return 0;
70 tcf_hash_release(pc, bind, &nat_hash_info); 69 tcf_hash_release(pc, bind, a->ops->hinfo);
71 if (!ovr) 70 if (!ovr)
72 return -EEXIST; 71 return -EEXIST;
73 } 72 }
@@ -83,7 +82,7 @@ static int tcf_nat_init(struct net *net, struct nlattr *nla, struct nlattr *est,
83 spin_unlock_bh(&p->tcf_lock); 82 spin_unlock_bh(&p->tcf_lock);
84 83
85 if (ret == ACT_P_CREATED) 84 if (ret == ACT_P_CREATED)
86 tcf_hash_insert(pc, &nat_hash_info); 85 tcf_hash_insert(pc, a->ops->hinfo);
87 86
88 return ret; 87 return ret;
89} 88}
diff --git a/net/sched/act_pedit.c b/net/sched/act_pedit.c
index 109265d7c14b..be3f0f6875bb 100644
--- a/net/sched/act_pedit.c
+++ b/net/sched/act_pedit.c
@@ -57,12 +57,11 @@ static int tcf_pedit_init(struct net *net, struct nlattr *nla,
57 if (nla_len(tb[TCA_PEDIT_PARMS]) < sizeof(*parm) + ksize) 57 if (nla_len(tb[TCA_PEDIT_PARMS]) < sizeof(*parm) + ksize)
58 return -EINVAL; 58 return -EINVAL;
59 59
60 pc = tcf_hash_check(parm->index, a, bind, &pedit_hash_info); 60 pc = tcf_hash_check(parm->index, a, bind);
61 if (!pc) { 61 if (!pc) {
62 if (!parm->nkeys) 62 if (!parm->nkeys)
63 return -EINVAL; 63 return -EINVAL;
64 pc = tcf_hash_create(parm->index, est, a, sizeof(*p), bind, 64 pc = tcf_hash_create(parm->index, est, a, sizeof(*p), bind);
65 &pedit_hash_info);
66 if (IS_ERR(pc)) 65 if (IS_ERR(pc))
67 return PTR_ERR(pc); 66 return PTR_ERR(pc);
68 p = to_pedit(pc); 67 p = to_pedit(pc);
@@ -77,7 +76,7 @@ static int tcf_pedit_init(struct net *net, struct nlattr *nla,
77 ret = ACT_P_CREATED; 76 ret = ACT_P_CREATED;
78 } else { 77 } else {
79 p = to_pedit(pc); 78 p = to_pedit(pc);
80 tcf_hash_release(pc, bind, &pedit_hash_info); 79 tcf_hash_release(pc, bind, a->ops->hinfo);
81 if (bind) 80 if (bind)
82 return 0; 81 return 0;
83 if (!ovr) 82 if (!ovr)
@@ -101,7 +100,7 @@ static int tcf_pedit_init(struct net *net, struct nlattr *nla,
101 memcpy(p->tcfp_keys, parm->keys, ksize); 100 memcpy(p->tcfp_keys, parm->keys, ksize);
102 spin_unlock_bh(&p->tcf_lock); 101 spin_unlock_bh(&p->tcf_lock);
103 if (ret == ACT_P_CREATED) 102 if (ret == ACT_P_CREATED)
104 tcf_hash_insert(pc, &pedit_hash_info); 103 tcf_hash_insert(pc, a->ops->hinfo);
105 return ret; 104 return ret;
106} 105}
107 106
diff --git a/net/sched/act_police.c b/net/sched/act_police.c
index 85437ba5c64b..c7093896cf14 100644
--- a/net/sched/act_police.c
+++ b/net/sched/act_police.c
@@ -59,17 +59,18 @@ struct tc_police_compat {
59static int tcf_act_police_walker(struct sk_buff *skb, struct netlink_callback *cb, 59static int tcf_act_police_walker(struct sk_buff *skb, struct netlink_callback *cb,
60 int type, struct tc_action *a) 60 int type, struct tc_action *a)
61{ 61{
62 struct tcf_hashinfo *hinfo = a->ops->hinfo;
62 struct hlist_head *head; 63 struct hlist_head *head;
63 struct tcf_common *p; 64 struct tcf_common *p;
64 int err = 0, index = -1, i = 0, s_i = 0, n_i = 0; 65 int err = 0, index = -1, i = 0, s_i = 0, n_i = 0;
65 struct nlattr *nest; 66 struct nlattr *nest;
66 67
67 spin_lock_bh(&police_hash_info.lock); 68 spin_lock_bh(&hinfo->lock);
68 69
69 s_i = cb->args[0]; 70 s_i = cb->args[0];
70 71
71 for (i = 0; i < (POL_TAB_MASK + 1); i++) { 72 for (i = 0; i < (POL_TAB_MASK + 1); i++) {
72 head = &police_hash_info.htab[tcf_hash(i, POL_TAB_MASK)]; 73 head = &hinfo->htab[tcf_hash(i, POL_TAB_MASK)];
73 74
74 hlist_for_each_entry_rcu(p, head, tcfc_head) { 75 hlist_for_each_entry_rcu(p, head, tcfc_head) {
75 index++; 76 index++;
@@ -94,7 +95,7 @@ static int tcf_act_police_walker(struct sk_buff *skb, struct netlink_callback *c
94 } 95 }
95 } 96 }
96done: 97done:
97 spin_unlock_bh(&police_hash_info.lock); 98 spin_unlock_bh(&hinfo->lock);
98 if (n_i) 99 if (n_i)
99 cb->args[0] += n_i; 100 cb->args[0] += n_i;
100 return n_i; 101 return n_i;
@@ -121,6 +122,7 @@ static int tcf_act_police_locate(struct net *net, struct nlattr *nla,
121 struct tc_police *parm; 122 struct tc_police *parm;
122 struct tcf_police *police; 123 struct tcf_police *police;
123 struct qdisc_rate_table *R_tab = NULL, *P_tab = NULL; 124 struct qdisc_rate_table *R_tab = NULL, *P_tab = NULL;
125 struct tcf_hashinfo *hinfo = a->ops->hinfo;
124 int size; 126 int size;
125 127
126 if (nla == NULL) 128 if (nla == NULL)
@@ -140,7 +142,7 @@ static int tcf_act_police_locate(struct net *net, struct nlattr *nla,
140 if (parm->index) { 142 if (parm->index) {
141 struct tcf_common *pc; 143 struct tcf_common *pc;
142 144
143 pc = tcf_hash_lookup(parm->index, &police_hash_info); 145 pc = tcf_hash_lookup(parm->index, hinfo);
144 if (pc != NULL) { 146 if (pc != NULL) {
145 a->priv = pc; 147 a->priv = pc;
146 police = to_police(pc); 148 police = to_police(pc);
@@ -236,11 +238,11 @@ override:
236 238
237 police->tcfp_t_c = ktime_to_ns(ktime_get()); 239 police->tcfp_t_c = ktime_to_ns(ktime_get());
238 police->tcf_index = parm->index ? parm->index : 240 police->tcf_index = parm->index ? parm->index :
239 tcf_hash_new_index(&police_hash_info); 241 tcf_hash_new_index(a->ops->hinfo);
240 h = tcf_hash(police->tcf_index, POL_TAB_MASK); 242 h = tcf_hash(police->tcf_index, POL_TAB_MASK);
241 spin_lock_bh(&police_hash_info.lock); 243 spin_lock_bh(&hinfo->lock);
242 hlist_add_head(&police->tcf_head, &police_hash_info.htab[h]); 244 hlist_add_head(&police->tcf_head, &hinfo->htab[h]);
243 spin_unlock_bh(&police_hash_info.lock); 245 spin_unlock_bh(&hinfo->lock);
244 246
245 a->priv = police; 247 a->priv = police;
246 return ret; 248 return ret;
diff --git a/net/sched/act_simple.c b/net/sched/act_simple.c
index 92236daaac8d..8ef2f1fcbfba 100644
--- a/net/sched/act_simple.c
+++ b/net/sched/act_simple.c
@@ -114,10 +114,9 @@ static int tcf_simp_init(struct net *net, struct nlattr *nla,
114 parm = nla_data(tb[TCA_DEF_PARMS]); 114 parm = nla_data(tb[TCA_DEF_PARMS]);
115 defdata = nla_data(tb[TCA_DEF_DATA]); 115 defdata = nla_data(tb[TCA_DEF_DATA]);
116 116
117 pc = tcf_hash_check(parm->index, a, bind, &simp_hash_info); 117 pc = tcf_hash_check(parm->index, a, bind);
118 if (!pc) { 118 if (!pc) {
119 pc = tcf_hash_create(parm->index, est, a, sizeof(*d), bind, 119 pc = tcf_hash_create(parm->index, est, a, sizeof(*d), bind);
120 &simp_hash_info);
121 if (IS_ERR(pc)) 120 if (IS_ERR(pc))
122 return PTR_ERR(pc); 121 return PTR_ERR(pc);
123 122
@@ -145,7 +144,7 @@ static int tcf_simp_init(struct net *net, struct nlattr *nla,
145 } 144 }
146 145
147 if (ret == ACT_P_CREATED) 146 if (ret == ACT_P_CREATED)
148 tcf_hash_insert(pc, &simp_hash_info); 147 tcf_hash_insert(pc, a->ops->hinfo);
149 return ret; 148 return ret;
150} 149}
151 150
diff --git a/net/sched/act_skbedit.c b/net/sched/act_skbedit.c
index c36b5209bc15..98725080b5aa 100644
--- a/net/sched/act_skbedit.c
+++ b/net/sched/act_skbedit.c
@@ -100,10 +100,9 @@ static int tcf_skbedit_init(struct net *net, struct nlattr *nla,
100 100
101 parm = nla_data(tb[TCA_SKBEDIT_PARMS]); 101 parm = nla_data(tb[TCA_SKBEDIT_PARMS]);
102 102
103 pc = tcf_hash_check(parm->index, a, bind, &skbedit_hash_info); 103 pc = tcf_hash_check(parm->index, a, bind);
104 if (!pc) { 104 if (!pc) {
105 pc = tcf_hash_create(parm->index, est, a, sizeof(*d), bind, 105 pc = tcf_hash_create(parm->index, est, a, sizeof(*d), bind);
106 &skbedit_hash_info);
107 if (IS_ERR(pc)) 106 if (IS_ERR(pc))
108 return PTR_ERR(pc); 107 return PTR_ERR(pc);
109 108
@@ -113,7 +112,7 @@ static int tcf_skbedit_init(struct net *net, struct nlattr *nla,
113 d = to_skbedit(pc); 112 d = to_skbedit(pc);
114 if (bind) 113 if (bind)
115 return 0; 114 return 0;
116 tcf_hash_release(pc, bind, &skbedit_hash_info); 115 tcf_hash_release(pc, bind, a->ops->hinfo);
117 if (!ovr) 116 if (!ovr)
118 return -EEXIST; 117 return -EEXIST;
119 } 118 }
@@ -133,7 +132,7 @@ static int tcf_skbedit_init(struct net *net, struct nlattr *nla,
133 spin_unlock_bh(&d->tcf_lock); 132 spin_unlock_bh(&d->tcf_lock);
134 133
135 if (ret == ACT_P_CREATED) 134 if (ret == ACT_P_CREATED)
136 tcf_hash_insert(pc, &skbedit_hash_info); 135 tcf_hash_insert(pc, a->ops->hinfo);
137 return ret; 136 return ret;
138} 137}
139 138