From 8117f5f61a7399fb160cc48d05daf6e0aac734f8 Mon Sep 17 00:00:00 2001 From: Weifeng Li Date: Sat, 3 Jul 2021 06:20:42 -0400 Subject: [PATCH] net/bnxt: fix nested lock during bonding Bnxt PMD registers LSC callback (bond_ethdev_lsc_event_callback) when working at bond mode. This callback will dead lock when LSC interrupt triggered. lsc interrupt -> bnxt_handle_async_event -> bnxt_link_update_op -> bond_ethdev_lsc_event_callback (lsc_lock) -> bnxt_link_update_op -> bond_ethdev_lsc_event_callback (lsc_lock dead lock) Fixes: c2faa1d1969e ("net/bnxt: add support for LSC interrupt event") Cc: stable@dpdk.org Signed-off-by: Weifeng Li Acked-by: Ajit Khaparde --- drivers/net/bnxt/bnxt_cpr.c | 2 ++ drivers/net/bnxt/bnxt_ethdev.c | 5 ----- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/net/bnxt/bnxt_cpr.c b/drivers/net/bnxt/bnxt_cpr.c index 2c7fd78c3d..f4c9c72664 100644 --- a/drivers/net/bnxt/bnxt_cpr.c +++ b/drivers/net/bnxt/bnxt_cpr.c @@ -111,6 +111,8 @@ void bnxt_handle_async_event(struct bnxt *bp, case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_CHANGE: /* FALLTHROUGH */ bnxt_link_update_op(bp->eth_dev, 0); + rte_eth_dev_callback_process(bp->eth_dev, + RTE_ETH_EVENT_INTR_LSC, NULL); break; case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_UNLOAD: PMD_DRV_LOG(INFO, "Async event: PF driver unloaded\n"); diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index ee69296926..19d52fa82b 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -1843,11 +1843,6 @@ out: if (new.link_status != eth_dev->data->dev_link.link_status || new.link_speed != eth_dev->data->dev_link.link_speed) { rte_eth_linkstatus_set(eth_dev, &new); - - rte_eth_dev_callback_process(eth_dev, - RTE_ETH_EVENT_INTR_LSC, - NULL); - bnxt_print_link_info(eth_dev); } -- 2.20.1