mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-26 00:21:17 +00:00
net: flow_offload: add flow_block_cb_is_busy() and use it
This patch adds a function to check if flow block callback is already in use. Call this new function from flow_block_cb_setup_simple() and from drivers. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
722d36e6e2
commit
0d4fd02e71
7 changed files with 39 additions and 0 deletions
|
@ -961,6 +961,9 @@ static int dsa_slave_setup_tc_block(struct net_device *dev,
|
|||
|
||||
switch (f->command) {
|
||||
case FLOW_BLOCK_BIND:
|
||||
if (flow_block_cb_is_busy(cb, dev, &dsa_slave_block_cb_list))
|
||||
return -EBUSY;
|
||||
|
||||
block_cb = flow_block_cb_alloc(f->net, cb, dev, dev, NULL);
|
||||
if (IS_ERR(block_cb))
|
||||
return PTR_ERR(block_cb);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue