Skip to content

Commit 7fa9d97

Browse files
jpirkodavem330
authored andcommitted
net: sched: cls_u32: use block instead of q in tc_u_common
tc_u_common is now per-q. With blocks, it has to be converted to be per-block. Signed-off-by: Jiri Pirko <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c195456 commit 7fa9d97

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

net/sched/cls_u32.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ struct tc_u_hnode {
9393

9494
struct tc_u_common {
9595
struct tc_u_hnode __rcu *hlist;
96-
struct Qdisc *q;
96+
struct tcf_block *block;
9797
int refcnt;
9898
struct idr handle_idr;
9999
struct hlist_node hnode;
@@ -335,11 +335,7 @@ static struct hlist_head *tc_u_common_hash;
335335

336336
static unsigned int tc_u_hash(const struct tcf_proto *tp)
337337
{
338-
struct net_device *dev = tp->q->dev_queue->dev;
339-
u32 qhandle = tp->q->handle;
340-
int ifindex = dev->ifindex;
341-
342-
return hash_64((u64)ifindex << 32 | qhandle, U32_HASH_SHIFT);
338+
return hash_64((u64) tp->chain->block, U32_HASH_SHIFT);
343339
}
344340

345341
static struct tc_u_common *tc_u_common_find(const struct tcf_proto *tp)
@@ -349,7 +345,7 @@ static struct tc_u_common *tc_u_common_find(const struct tcf_proto *tp)
349345

350346
h = tc_u_hash(tp);
351347
hlist_for_each_entry(tc, &tc_u_common_hash[h], hnode) {
352-
if (tc->q == tp->q)
348+
if (tc->block == tp->chain->block)
353349
return tc;
354350
}
355351
return NULL;
@@ -378,7 +374,7 @@ static int u32_init(struct tcf_proto *tp)
378374
kfree(root_ht);
379375
return -ENOBUFS;
380376
}
381-
tp_c->q = tp->q;
377+
tp_c->block = tp->chain->block;
382378
INIT_HLIST_NODE(&tp_c->hnode);
383379
idr_init(&tp_c->handle_idr);
384380

0 commit comments

Comments
 (0)