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: sta...@dpdk.org

Signed-off-by: Ivan Malov <ivan.ma...@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybche...@oktetlabs.ru>
---
 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

Reply via email to