From: Kalesh A P <kalesh-anakkur.purayil@broadcom.com>
To: stable@dpdk.org
Cc: luca.boccassi@gmail.com, ajit.khaparde@broadcom.com
Subject: [dpdk-stable] [PATCH 19.11 2/2] net/bnxt: fix recovery alarm race condition in port close
Date: Wed, 11 Mar 2020 09:26:59 +0530 [thread overview]
Message-ID: <20200311035659.24583-3-kalesh-anakkur.purayil@broadcom.com> (raw)
In-Reply-To: <20200311035659.24583-1-kalesh-anakkur.purayil@broadcom.com>
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
[ upstream commit 28124d9cdc729dc07dfebddf0b3e2aecfc021dee ]
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")
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>
---
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 c0b965b..dedb012 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)
{
@@ -963,6 +964,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
next prev parent reply other threads:[~2020-03-11 3:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-11 3:56 [dpdk-stable] [PATCH 19.11 0/2] bnxt fixes for 19.11 Kalesh A P
2020-03-11 3:56 ` [dpdk-stable] [PATCH 19.11 1/2] net/bnxt: fix MAC address setting when port is stopped Kalesh A P
2020-03-11 3:56 ` Kalesh A P [this message]
2020-03-11 10:42 ` [dpdk-stable] [PATCH 19.11 0/2] bnxt fixes for 19.11 Luca Boccassi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200311035659.24583-3-kalesh-anakkur.purayil@broadcom.com \
--to=kalesh-anakkur.purayil@broadcom.com \
--cc=ajit.khaparde@broadcom.com \
--cc=luca.boccassi@gmail.com \
--cc=stable@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).