* [dpdk-stable] [PATCH] net/bnxt: fix nested lock at bond mode
@ 2021-07-03 9:57 Weifeng Li
2021-07-03 10:20 ` [dpdk-stable] [PATCH v2] " Weifeng Li
0 siblings, 1 reply; 3+ messages in thread
From: Weifeng Li @ 2021-07-03 9:57 UTC (permalink / raw)
To: ajit.khaparde, somnath.kotur; +Cc: dev, liweifeng96, stable
Bnxt regist lsc callback (bond_ethdev_lsc_event_callback) when
working at bond mode. This callback will dead lock when lsc
interrupt triggerred.
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 <liweifeng96@126.com>
---
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 2c7fd78..f4c9c72 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 495c6cd..619b7b8 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -1844,11 +1844,6 @@ int bnxt_link_update_op(struct rte_eth_dev *eth_dev, int wait_to_complete)
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);
}
--
1.8.3.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* [dpdk-stable] [PATCH v2] net/bnxt: fix nested lock at bond mode
2021-07-03 9:57 [dpdk-stable] [PATCH] net/bnxt: fix nested lock at bond mode Weifeng Li
@ 2021-07-03 10:20 ` Weifeng Li
2021-07-13 4:22 ` Ajit Khaparde
0 siblings, 1 reply; 3+ messages in thread
From: Weifeng Li @ 2021-07-03 10:20 UTC (permalink / raw)
To: ajit.khaparde, somnath.kotur; +Cc: dev, liweifeng96, stable
Bnxt register 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 <liweifeng96@126.com>
---
v2: fix coding style issues
---
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 2c7fd78..f4c9c72 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 495c6cd..619b7b8 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -1844,11 +1844,6 @@ int bnxt_link_update_op(struct rte_eth_dev *eth_dev, int wait_to_complete)
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);
}
--
1.8.3.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-stable] [PATCH v2] net/bnxt: fix nested lock at bond mode
2021-07-03 10:20 ` [dpdk-stable] [PATCH v2] " Weifeng Li
@ 2021-07-13 4:22 ` Ajit Khaparde
0 siblings, 0 replies; 3+ messages in thread
From: Ajit Khaparde @ 2021-07-13 4:22 UTC (permalink / raw)
To: Weifeng Li; +Cc: Somnath Kotur, dpdk-dev, dpdk stable
[-- Attachment #1: Type: text/plain, Size: 2383 bytes --]
On Sat, Jul 3, 2021 at 3:21 AM Weifeng Li <liweifeng96@126.com> wrote:
> Bnxt register 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 <liweifeng96@126.com>
>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Updated the commit headline to "fix nested lock during bonding" during
merge.
Patch applied to dpdk-next-net-brcm. Thanks
> ---
> v2: fix coding style issues
> ---
> 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 2c7fd78..f4c9c72 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 495c6cd..619b7b8 100644
> --- a/drivers/net/bnxt/bnxt_ethdev.c
> +++ b/drivers/net/bnxt/bnxt_ethdev.c
> @@ -1844,11 +1844,6 @@ int bnxt_link_update_op(struct rte_eth_dev
> *eth_dev, int wait_to_complete)
> 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);
> }
>
> --
> 1.8.3.1
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-07-13 4:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-03 9:57 [dpdk-stable] [PATCH] net/bnxt: fix nested lock at bond mode Weifeng Li
2021-07-03 10:20 ` [dpdk-stable] [PATCH v2] " Weifeng Li
2021-07-13 4:22 ` Ajit Khaparde
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).