All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch net-next] net: sched: move block offload unbind after all chains are flushed
@ 2017-11-02 14:07 Jiri Pirko
  2017-11-03  6:47 ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Jiri Pirko @ 2017-11-02 14:07 UTC (permalink / raw)
  To: netdev; +Cc: davem, jhs, xiyou.wangcong, mlxsw, alexander.h.duyck, kubakici

From: Jiri Pirko <jiri@mellanox.com>

Currently, the offload unbind is done before the chains are flushed.
That causes driver to unregister block callback before it can get all
the callback calls done during flush, leaving the offloaded tps inside
the HW. So fix the order to prevent this situation and restore the
original behaviour.

Reported-by: Alexander Duyck <alexander.duyck@gmail.com>
Reported-by: Jakub Kicinski <kubakici@wp.pl>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
 net/sched/cls_api.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index a26c690..3364347 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -343,11 +343,11 @@ void tcf_block_put_ext(struct tcf_block *block,
 	if (!block)
 		return;
 
-	tcf_block_offload_unbind(block, q, ei);
-
 	list_for_each_entry_safe(chain, tmp, &block->chain_list, list)
 		tcf_chain_flush(chain);
 
+	tcf_block_offload_unbind(block, q, ei);
+
 	INIT_WORK(&block->work, tcf_block_put_final);
 	/* Wait for existing RCU callbacks to cool down, make sure their works
 	 * have been queued before this. We can not flush pending works here
-- 
2.9.5

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

* Re: [patch net-next] net: sched: move block offload unbind after all chains are flushed
  2017-11-02 14:07 [patch net-next] net: sched: move block offload unbind after all chains are flushed Jiri Pirko
@ 2017-11-03  6:47 ` David Miller
  2017-11-03  6:59   ` Jiri Pirko
  0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2017-11-03  6:47 UTC (permalink / raw)
  To: jiri; +Cc: netdev, jhs, xiyou.wangcong, mlxsw, alexander.h.duyck, kubakici

From: Jiri Pirko <jiri@resnulli.us>
Date: Thu,  2 Nov 2017 15:07:01 +0100

> From: Jiri Pirko <jiri@mellanox.com>
> 
> Currently, the offload unbind is done before the chains are flushed.
> That causes driver to unregister block callback before it can get all
> the callback calls done during flush, leaving the offloaded tps inside
> the HW. So fix the order to prevent this situation and restore the
> original behaviour.
> 
> Reported-by: Alexander Duyck <alexander.duyck@gmail.com>
> Reported-by: Jakub Kicinski <kubakici@wp.pl>
> Signed-off-by: Jiri Pirko <jiri@mellanox.com>

I'm pretty sure this was my fault during the merge, I had to pick
whether to do it before or after the offload unbind and I picked the
latter.

Applied, thank you.

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

* Re: [patch net-next] net: sched: move block offload unbind after all chains are flushed
  2017-11-03  6:47 ` David Miller
@ 2017-11-03  6:59   ` Jiri Pirko
  0 siblings, 0 replies; 3+ messages in thread
From: Jiri Pirko @ 2017-11-03  6:59 UTC (permalink / raw)
  To: David Miller
  Cc: netdev, jhs, xiyou.wangcong, mlxsw, alexander.h.duyck, kubakici

Fri, Nov 03, 2017 at 07:47:44AM CET, davem@davemloft.net wrote:
>From: Jiri Pirko <jiri@resnulli.us>
>Date: Thu,  2 Nov 2017 15:07:01 +0100
>
>> From: Jiri Pirko <jiri@mellanox.com>
>> 
>> Currently, the offload unbind is done before the chains are flushed.
>> That causes driver to unregister block callback before it can get all
>> the callback calls done during flush, leaving the offloaded tps inside
>> the HW. So fix the order to prevent this situation and restore the
>> original behaviour.
>> 
>> Reported-by: Alexander Duyck <alexander.duyck@gmail.com>
>> Reported-by: Jakub Kicinski <kubakici@wp.pl>
>> Signed-off-by: Jiri Pirko <jiri@mellanox.com>
>
>I'm pretty sure this was my fault during the merge, I had to pick
>whether to do it before or after the offload unbind and I picked the
>latter.

I also had it wrong in the original commit 8c4083b30e56fc71b0e94c26374b32d95d5ea461

>
>Applied, thank you.

Thanks.

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

end of thread, other threads:[~2017-11-03  6:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-02 14:07 [patch net-next] net: sched: move block offload unbind after all chains are flushed Jiri Pirko
2017-11-03  6:47 ` David Miller
2017-11-03  6:59   ` Jiri Pirko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.