Skip to content

Commit a7042cf

Browse files
vbnogueiradavem330
authored andcommitted
net/sched: cls_api: Expose tc block to the datapath
The datapath can now find the block of the port in which the packet arrived at. In the next patch we show a possible usage of this patch in a new version of mirred that multicasts to all ports except for the port in which the packet arrived on. Co-developed-by: Jamal Hadi Salim <[email protected]> Signed-off-by: Jamal Hadi Salim <[email protected]> Co-developed-by: Pedro Tammela <[email protected]> Signed-off-by: Pedro Tammela <[email protected]> Signed-off-by: Victor Nogueira <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 913b47d commit a7042cf

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

include/net/sch_generic.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,8 @@ struct tcf_block {
484484
struct mutex proto_destroy_lock; /* Lock for proto_destroy hashtable. */
485485
};
486486

487+
struct tcf_block *tcf_block_lookup(struct net *net, u32 block_index);
488+
487489
static inline bool lockdep_tcf_chain_is_locked(struct tcf_chain *chain)
488490
{
489491
return lockdep_is_held(&chain->filter_chain_lock);

net/sched/cls_api.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1011,12 +1011,13 @@ static struct tcf_block *tcf_block_create(struct net *net, struct Qdisc *q,
10111011
return block;
10121012
}
10131013

1014-
static struct tcf_block *tcf_block_lookup(struct net *net, u32 block_index)
1014+
struct tcf_block *tcf_block_lookup(struct net *net, u32 block_index)
10151015
{
10161016
struct tcf_net *tn = net_generic(net, tcf_net_id);
10171017

10181018
return idr_find(&tn->idr, block_index);
10191019
}
1020+
EXPORT_SYMBOL(tcf_block_lookup);
10201021

10211022
static struct tcf_block *tcf_block_refcnt_get(struct net *net, u32 block_index)
10221023
{

0 commit comments

Comments
 (0)