From: Jiri Pirko Subject: [patch net-next] net: sched: move block offload unbind after all chains are flushed Date: Thu, 2 Nov 2017 15:07:01 +0100 Message-ID: <20171102140701.1485-1-jiri@resnulli.us> Cc: davem@davemloft.net, jhs@mojatatu.com, xiyou.wangcong@gmail.com, mlxsw@mellanox.com, alexander.h.duyck@intel.com, kubakici@wp.pl To: netdev@vger.kernel.org Return-path: Received: from mail-wm0-f66.google.com ([74.125.82.66]:47521 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751898AbdKBOHD (ORCPT ); Thu, 2 Nov 2017 10:07:03 -0400 Received: by mail-wm0-f66.google.com with SMTP id r196so11379187wmf.2 for ; Thu, 02 Nov 2017 07:07:03 -0700 (PDT) Sender: netdev-owner@vger.kernel.org List-ID: From: Jiri Pirko 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 Reported-by: Jakub Kicinski Signed-off-by: Jiri Pirko --- 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