summaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorWANG Cong <xiyou.wangcong@gmail.com>2014-01-09 16:13:59 -0800
committerDavid S. Miller <davem@davemloft.net>2014-01-13 11:50:14 -0800
commitddafd34f419546f1eb7c343178685f059c3cf127 (patch)
tree56eacb6abe0c856904632e437baf6cef62cbb39c /include/net
parent600adc18eba823f9fd8ed5fec8b04f11dddf3884 (diff)
downloadop-kernel-dev-ddafd34f419546f1eb7c343178685f059c3cf127.zip
op-kernel-dev-ddafd34f419546f1eb7c343178685f059c3cf127.tar.gz
net_sched: act: move idx_gen into struct tcf_hashinfo
There is no need to store the index separatedly since tcf_hashinfo is allocated statically too. 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 'include/net')
-rw-r--r--include/net/act_api.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/include/net/act_api.h b/include/net/act_api.h
index d34e1f4..268f9e6 100644
--- a/include/net/act_api.h
+++ b/include/net/act_api.h
@@ -39,6 +39,7 @@ struct tcf_hashinfo {
struct hlist_head *htab;
unsigned int hmask;
spinlock_t lock;
+ u32 index;
};
static inline unsigned int tcf_hash(u32 index, unsigned int hmask)
@@ -51,6 +52,7 @@ static inline int tcf_hashinfo_init(struct tcf_hashinfo *hf, unsigned int mask)
int i;
spin_lock_init(&hf->lock);
+ hf->index = 0;
hf->hmask = mask;
hf->htab = kzalloc((mask + 1) * sizeof(struct hlist_head),
GFP_KERNEL);
@@ -105,13 +107,12 @@ struct tcf_common *tcf_hash_lookup(u32 index, struct tcf_hashinfo *hinfo);
void tcf_hash_destroy(struct tcf_common *p, struct tcf_hashinfo *hinfo);
int tcf_hash_release(struct tcf_common *p, int bind,
struct tcf_hashinfo *hinfo);
-u32 tcf_hash_new_index(u32 *idx_gen, struct tcf_hashinfo *hinfo);
+u32 tcf_hash_new_index(struct tcf_hashinfo *hinfo);
struct tcf_common *tcf_hash_check(u32 index, struct tc_action *a,
int bind, struct tcf_hashinfo *hinfo);
struct tcf_common *tcf_hash_create(u32 index, struct nlattr *est,
struct tc_action *a, int size,
- int bind, u32 *idx_gen,
- struct tcf_hashinfo *hinfo);
+ int bind, struct tcf_hashinfo *hinfo);
void tcf_hash_insert(struct tcf_common *p, struct tcf_hashinfo *hinfo);
int tcf_register_action(struct tc_action_ops *a);
OpenPOWER on IntegriCloud