Skip to contentSkip to conversation

net: sched: move block offload unbind after all chains are flushed

PATCH Applied Jiri Pirko 2 participants 3 messages Nov 2, 2017 – Nov 3, 2017

Subsystems (3)
lore
Share & tools
lore

Jiri Pirko

author maintainer
#0 lore raw

PATCH 1/1 net: sched: move block offload unbind after all chains are flushed

From: Jiri Pirko <[email protected]>

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.

---
 net/sched/cls_api.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
net/sched/cls_api.c +2 -2
index a26c690..3364347 100644
@@ -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
Signature · 1 line
2.9.5
maintainer Applied
#1 lore raw

From: Jiri Pirko <[email protected]>
Date: Thu, 2 Nov 2017 15:07:01 +0100

Quoted 11 lines

From: Jiri Pirko <[email protected]>

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.

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.

author maintainer
#2 lore raw
Quoted 11 lines · Fri, Nov 03, 2017 at 07:47:44AM CET, [email protected] wrote:

From: Jiri Pirko <[email protected]>
Date: Thu, 2 Nov 2017 15:07:01 +0100

Quoted 8 lines

From: Jiri Pirko <[email protected]>

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.

Quoted 7 lines
Quoted 3 lines

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

Quoted 2 lines

Applied, thank you.

Thanks.