netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] nfp: flower: verify that block cb is not busy before binding
@ 2019-08-19  7:33 Vlad Buslov
  2019-08-19 20:29 ` Jakub Kicinski
  2019-08-20  1:16 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Vlad Buslov @ 2019-08-19  7:33 UTC (permalink / raw)
  To: netdev
  Cc: jhs, xiyou.wangcong, jiri, davem, jakub.kicinski, pablo, Vlad Buslov

When processing FLOW_BLOCK_BIND command on indirect block, check that flow
block cb is not busy.

Fixes: 0d4fd02e7199 ("net: flow_offload: add flow_block_cb_is_busy() and use it")
Reported-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Vlad Buslov <vladbu@mellanox.com>
---
 drivers/net/ethernet/netronome/nfp/flower/offload.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/ethernet/netronome/nfp/flower/offload.c b/drivers/net/ethernet/netronome/nfp/flower/offload.c
index e209f150c5f2..9917d64694c6 100644
--- a/drivers/net/ethernet/netronome/nfp/flower/offload.c
+++ b/drivers/net/ethernet/netronome/nfp/flower/offload.c
@@ -1416,6 +1416,13 @@ nfp_flower_setup_indr_tc_block(struct net_device *netdev, struct nfp_app *app,
 
 	switch (f->command) {
 	case FLOW_BLOCK_BIND:
+		cb_priv = nfp_flower_indr_block_cb_priv_lookup(app, netdev);
+		if (cb_priv &&
+		    flow_block_cb_is_busy(nfp_flower_setup_indr_block_cb,
+					  cb_priv,
+					  &nfp_block_cb_list))
+			return -EBUSY;
+
 		cb_priv = kmalloc(sizeof(*cb_priv), GFP_KERNEL);
 		if (!cb_priv)
 			return -ENOMEM;
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net] nfp: flower: verify that block cb is not busy before binding
  2019-08-19  7:33 [PATCH net] nfp: flower: verify that block cb is not busy before binding Vlad Buslov
@ 2019-08-19 20:29 ` Jakub Kicinski
  2019-08-20  1:16 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Jakub Kicinski @ 2019-08-19 20:29 UTC (permalink / raw)
  To: Vlad Buslov; +Cc: netdev, jhs, xiyou.wangcong, jiri, davem, pablo

On Mon, 19 Aug 2019 10:33:04 +0300, Vlad Buslov wrote:
> When processing FLOW_BLOCK_BIND command on indirect block, check that flow
> block cb is not busy.
> 
> Fixes: 0d4fd02e7199 ("net: flow_offload: add flow_block_cb_is_busy() and use it")
> Reported-by: Jakub Kicinski <jakub.kicinski@netronome.com>
> Signed-off-by: Vlad Buslov <vladbu@mellanox.com>

Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>

Thank you!

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] nfp: flower: verify that block cb is not busy before binding
  2019-08-19  7:33 [PATCH net] nfp: flower: verify that block cb is not busy before binding Vlad Buslov
  2019-08-19 20:29 ` Jakub Kicinski
@ 2019-08-20  1:16 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2019-08-20  1:16 UTC (permalink / raw)
  To: vladbu; +Cc: netdev, jhs, xiyou.wangcong, jiri, jakub.kicinski, pablo

From: Vlad Buslov <vladbu@mellanox.com>
Date: Mon, 19 Aug 2019 10:33:04 +0300

> When processing FLOW_BLOCK_BIND command on indirect block, check that flow
> block cb is not busy.
> 
> Fixes: 0d4fd02e7199 ("net: flow_offload: add flow_block_cb_is_busy() and use it")
> Reported-by: Jakub Kicinski <jakub.kicinski@netronome.com>
> Signed-off-by: Vlad Buslov <vladbu@mellanox.com>

Applied.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-08-20  1:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-19  7:33 [PATCH net] nfp: flower: verify that block cb is not busy before binding Vlad Buslov
2019-08-19 20:29 ` Jakub Kicinski
2019-08-20  1:16 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).