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>
This commit is contained in:

committed by
David S. Miller

parent
600adc18eb
commit
ddafd34f41
@@ -41,7 +41,6 @@ struct tcf_police {
|
||||
container_of(pc, struct tcf_police, common)
|
||||
|
||||
#define POL_TAB_MASK 15
|
||||
static u32 police_idx_gen;
|
||||
static struct tcf_hashinfo police_hash_info;
|
||||
|
||||
/* old policer structure from before tc actions */
|
||||
@@ -251,7 +250,7 @@ override:
|
||||
|
||||
police->tcfp_t_c = ktime_to_ns(ktime_get());
|
||||
police->tcf_index = parm->index ? parm->index :
|
||||
tcf_hash_new_index(&police_idx_gen, &police_hash_info);
|
||||
tcf_hash_new_index(&police_hash_info);
|
||||
h = tcf_hash(police->tcf_index, POL_TAB_MASK);
|
||||
spin_lock_bh(&police_hash_info.lock);
|
||||
hlist_add_head(&police->tcf_head, &police_hash_info.htab[h]);
|
||||
|
Reference in New Issue
Block a user