summaryrefslogtreecommitdiffstats
path: root/net/dsa
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2019-07-09 16:55:48 -0400
committerDavid S. Miller <davem@davemloft.net>2019-07-09 17:38:50 -0400
commit0d4fd02e7199fbf57c0d175dd1890c82cd4a6f4f (patch)
treec06ac553a77c2ae6bc7e36db665d77fce29f2e1c /net/dsa
parent722d36e6e29e50c640c9f5ce186b8d8709cae1a6 (diff)
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>
Diffstat (limited to 'net/dsa')
-rw-r--r--net/dsa/slave.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 90c32fd680db..9bcb598fc840 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -961,6 +961,9 @@ static int dsa_slave_setup_tc_block(struct net_device *dev,
961 961
962 switch (f->command) { 962 switch (f->command) {
963 case FLOW_BLOCK_BIND: 963 case FLOW_BLOCK_BIND:
964 if (flow_block_cb_is_busy(cb, dev, &dsa_slave_block_cb_list))
965 return -EBUSY;
966
964 block_cb = flow_block_cb_alloc(f->net, cb, dev, dev, NULL); 967 block_cb = flow_block_cb_alloc(f->net, cb, dev, dev, NULL);
965 if (IS_ERR(block_cb)) 968 if (IS_ERR(block_cb))
966 return PTR_ERR(block_cb); 969 return PTR_ERR(block_cb);