DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v2] net/bnxt: fix to cancel recovery alarm in port close
@ 2020-02-28 10:21 Kalesh A P
  2020-03-03  3:57 ` Ajit Khaparde
  0 siblings, 1 reply; 2+ messages in thread
From: Kalesh A P @ 2020-02-28 10:21 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, ajit.khaparde

From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>

There is a race condition when port is closed while error recovery
is happening in driver. Fixed this by canceling the recovery threads
during port close.

Fixes: df6cd7c1f73a ("net/bnxt: handle reset notify async event from FW")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
---
v1->v2: fixed the "Fixes" tagline as pointed by Kevin Traynor

 drivers/net/bnxt/bnxt_ethdev.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 18aa313..b8b30ed 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -133,6 +133,7 @@ static int bnxt_init_resources(struct bnxt *bp, bool reconfig_dev);
 static int bnxt_uninit_resources(struct bnxt *bp, bool reconfig_dev);
 static void bnxt_cancel_fw_health_check(struct bnxt *bp);
 static int bnxt_restore_vlan_filters(struct bnxt *bp);
+static void bnxt_dev_recover(void *arg);
 
 int is_bnxt_in_error(struct bnxt *bp)
 {
@@ -980,6 +981,10 @@ static void bnxt_dev_close_op(struct rte_eth_dev *eth_dev)
 {
 	struct bnxt *bp = eth_dev->data->dev_private;
 
+	/* cancel the recovery handler before remove dev */
+	rte_eal_alarm_cancel(bnxt_dev_reset_and_resume, (void *)bp);
+	rte_eal_alarm_cancel(bnxt_dev_recover, (void *)bp);
+
 	if (eth_dev->data->dev_started)
 		bnxt_dev_stop_op(eth_dev);
 
-- 
2.10.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH v2] net/bnxt: fix to cancel recovery alarm in port close
  2020-02-28 10:21 [dpdk-dev] [PATCH v2] net/bnxt: fix to cancel recovery alarm in port close Kalesh A P
@ 2020-03-03  3:57 ` Ajit Khaparde
  0 siblings, 0 replies; 2+ messages in thread
From: Ajit Khaparde @ 2020-03-03  3:57 UTC (permalink / raw)
  To: Kalesh A P; +Cc: dpdk-dev, Ferruh Yigit

On Fri, Feb 28, 2020 at 2:04 AM Kalesh A P <
kalesh-anakkur.purayil@broadcom.com> wrote:

> From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
>
> There is a race condition when port is closed while error recovery
> is happening in driver. Fixed this by canceling the recovery threads
> during port close.
>
> Fixes: df6cd7c1f73a ("net/bnxt: handle reset notify async event from FW")
> Cc: stable@dpdk.org
>
> Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
> Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
> Reviewed-by: Santoshkumar Karanappa Rastapur <
> santosh.rastapur@broadcom.com>
>
Applied to dpdk-next-net-brcm


> ---
> v1->v2: fixed the "Fixes" tagline as pointed by Kevin Traynor
>
>  drivers/net/bnxt/bnxt_ethdev.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/drivers/net/bnxt/bnxt_ethdev.c
> b/drivers/net/bnxt/bnxt_ethdev.c
> index 18aa313..b8b30ed 100644
> --- a/drivers/net/bnxt/bnxt_ethdev.c
> +++ b/drivers/net/bnxt/bnxt_ethdev.c
> @@ -133,6 +133,7 @@ static int bnxt_init_resources(struct bnxt *bp, bool
> reconfig_dev);
>  static int bnxt_uninit_resources(struct bnxt *bp, bool reconfig_dev);
>  static void bnxt_cancel_fw_health_check(struct bnxt *bp);
>  static int bnxt_restore_vlan_filters(struct bnxt *bp);
> +static void bnxt_dev_recover(void *arg);
>
>  int is_bnxt_in_error(struct bnxt *bp)
>  {
> @@ -980,6 +981,10 @@ static void bnxt_dev_close_op(struct rte_eth_dev
> *eth_dev)
>  {
>         struct bnxt *bp = eth_dev->data->dev_private;
>
> +       /* cancel the recovery handler before remove dev */
> +       rte_eal_alarm_cancel(bnxt_dev_reset_and_resume, (void *)bp);
> +       rte_eal_alarm_cancel(bnxt_dev_recover, (void *)bp);
> +
>         if (eth_dev->data->dev_started)
>                 bnxt_dev_stop_op(eth_dev);
>
> --
> 2.10.1
>
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-03-03  3:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-28 10:21 [dpdk-dev] [PATCH v2] net/bnxt: fix to cancel recovery alarm in port close Kalesh A P
2020-03-03  3:57 ` 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).