From: Jie Liu <[email protected]>

Add sxe2_stats_init() call in sxe2_repr_dev_init to set up the
statistics infrastructure for representor devices, and add the
l_init_irq_ctxt_err error path to uninitialize the software irq
context if stats initialization fails.

Cc: [email protected]
Signed-off-by: Jie Liu <[email protected]>
---
 drivers/net/sxe2/sxe2_ethdev_repr.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/sxe2/sxe2_ethdev_repr.c 
b/drivers/net/sxe2/sxe2_ethdev_repr.c
index f32318b731..c698baafe0 100644
--- a/drivers/net/sxe2/sxe2_ethdev_repr.c
+++ b/drivers/net/sxe2/sxe2_ethdev_repr.c
@@ -483,8 +483,16 @@ int32_t sxe2_repr_dev_init(struct rte_eth_dev *dev,
                goto l_init_sw_err;
        }
 
+       ret = sxe2_stats_init(dev);
+       if (ret) {
+               PMD_LOG_ERR(INIT, "Failed to initialize stats, ret=[%d]", ret);
+               goto l_init_irq_ctxt_err;
+       }
+
        goto l_end;
 
+l_init_irq_ctxt_err:
+       sxe2_sw_irq_ctxt_uninit(dev);
 l_init_sw_err:
        sxe2_eth_uinit(dev);
 l_init_eth_err:
-- 
2.52.0

Reply via email to