From: Jie Liu <[email protected]>

sxe2_dev_close() calls sxe2_switchdev_uninit() and
sxe2_dev_pci_map_uinit() twice, and releases resources in an order
that does not match the initialization sequence.

Remove the duplicated calls and align the teardown order with the
device init order.

Fixes: 8cebf80f1e ("net/sxe2: support Rx interrupt")
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Jie Liu <[email protected]>
---
 drivers/net/sxe2/sxe2_ethdev.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/sxe2/sxe2_ethdev.c b/drivers/net/sxe2/sxe2_ethdev.c
index 575ad299f1..ce1e1cae34 100644
--- a/drivers/net/sxe2/sxe2_ethdev.c
+++ b/drivers/net/sxe2/sxe2_ethdev.c
@@ -2045,17 +2045,15 @@ static int32_t sxe2_dev_close(struct rte_eth_dev *dev)
        (void)sxe2_queues_release(dev);
        sxe2_mp_uninit(dev);
        (void)sxe2_sched_uinit(dev);
-       (void)sxe2_rss_disable(dev);
        (void)sxe2_flow_uninit(dev);
+       (void)sxe2_rss_disable(dev);
        (void)sxe2_udp_tunnel_port_clear(dev);
-       sxe2_vsi_uninit(dev);
        sxe2_security_uinit(dev);
        sxe2_intr_uninit(dev);
        (void)sxe2_switchdev_uninit(dev);
        sxe2_sw_uninit(dev);
-       (void)sxe2_switchdev_uninit(dev);
-       sxe2_dev_pci_map_uinit(dev);
        sxe2_eth_uinit(dev);
+       sxe2_vsi_uninit(dev);
        sxe2_dev_pci_map_uinit(dev);
        sxe2_free_repr_info(dev);
        sxe2_fc_state_uinit(dev);
-- 
2.52.0

Reply via email to