From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B4BEFA0584; Wed, 19 Oct 2022 13:18:10 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 58473427FF; Wed, 19 Oct 2022 13:18:10 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 19E80410D1; Wed, 19 Oct 2022 13:18:08 +0200 (CEST) Received: from bree.oktetlabs.ru (bree.oktetlabs.ru [192.168.34.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPS id 3D43262; Wed, 19 Oct 2022 14:18:07 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 3D43262 Authentication-Results: shelob.oktetlabs.ru/3D43262; dkim=none; dkim-atps=neutral From: Ivan Malov To: dev@dpdk.org Cc: Chas Williams <3chas3@gmail.com>, "Min Hu (Connor)" , stable@dpdk.org, Andrew Rybchenko , Chas Williams , Declan Doherty , Matan Azrad Subject: [PATCH v2] net/bonding: fix flow flush order on bonded device close Date: Wed, 19 Oct 2022 14:18:05 +0300 Message-Id: <20221019111805.1070381-1-ivan.malov@oktetlabs.ru> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220911122221.3993511-1-ivan.malov@oktetlabs.ru> References: <20220911122221.3993511-1-ivan.malov@oktetlabs.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The current code first removes all back-end devices of the bonded device and then invokes flush operation to remove flows in such back-end devices, which makes no sense. Fix that by re-ordering the steps accordingly. Fixes: 49dad9028e2a ("net/bonding: support flow API") Cc: stable@dpdk.org Signed-off-by: Ivan Malov Reviewed-by: Andrew Rybchenko --- drivers/net/bonding/rte_eth_bond_pmd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index 486b7fc9f7..51d543e5de 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -2156,6 +2156,9 @@ bond_ethdev_cfg_cleanup(struct rte_eth_dev *dev) int skipped = 0; struct rte_flow_error ferror; + /* Flush flows in all back-end devices before removing them */ + bond_flow_ops.flush(dev, &ferror); + while (internals->slave_count != skipped) { uint16_t port_id = internals->slaves[skipped].port_id; @@ -2173,7 +2176,6 @@ bond_ethdev_cfg_cleanup(struct rte_eth_dev *dev) skipped++; } } - bond_flow_ops.flush(dev, &ferror); } int -- 2.30.2