[v2] net/bonding: fix flow flush order on bonded device close

Message ID 20221019111805.1070381-1-ivan.malov@oktetlabs.ru (mailing list archive)
State Accepted, archived
Delegated to: Andrew Rybchenko
Headers
Series [v2] net/bonding: fix flow flush order on bonded device close |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-testing warning apply patch failure

Commit Message

Ivan Malov Oct. 19, 2022, 11:18 a.m. UTC
  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 <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
 drivers/net/bonding/rte_eth_bond_pmd.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
  

Comments

Andrew Rybchenko Oct. 20, 2022, 6:34 a.m. UTC | #1
On 10/19/22 14:18, Ivan Malov wrote:
> 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 <ivan.malov@oktetlabs.ru>
> Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>

Applied to dpdk-next-net/main, thanks.
  

Patch

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