From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <stable-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id A587AA055A
	for <public@inbox.dpdk.org>; Thu, 27 Feb 2020 10:35:19 +0100 (CET)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 9C0771C01;
	Thu, 27 Feb 2020 10:35:19 +0100 (CET)
Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com
 [209.85.221.66]) by dpdk.org (Postfix) with ESMTP id 01C861C01
 for <stable@dpdk.org>; Thu, 27 Feb 2020 10:35:19 +0100 (CET)
Received: by mail-wr1-f66.google.com with SMTP id v4so2398832wrs.8
 for <stable@dpdk.org>; Thu, 27 Feb 2020 01:35:18 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:cc:subject:date:message-id:in-reply-to:references
 :mime-version:content-transfer-encoding;
 bh=UR2G8vIPHTIQs8R58bONg2CdG4Cwq2IHw5TTvFuqHqU=;
 b=N5LuHv9Zg+hyKgSIC7DOYMTmqSbf5hH+XrFjRUk85bWTnbywO9xpn5MdPnTim6d4B1
 VfSB3iYcnDjLiM7RS0EMxteW6UIbpkO1DMa6bLRTZKdZyuS4zFippphLsR7QqKFQENE9
 GyK4bpT3bQ1LLCBiSO7Roc5aE/rbF5x2udlSG2dBgzbnrXN8smqAPU0EZkguhurcx00c
 7QMGqI/qbS1eHbHGnYEj5B67pnjU0ndPnU1KpT7jdbHW+ZRcreqAfln48v8BfREUFlbN
 BF2cLOGsIY6KXXxu+/lsDNnsg9Bp11TJ5BMrl35uQ8PbyWqzX2P0HuiDi3s3MOeDU9HA
 Mhcg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to
 :references:mime-version:content-transfer-encoding;
 bh=UR2G8vIPHTIQs8R58bONg2CdG4Cwq2IHw5TTvFuqHqU=;
 b=e3xoxB3hNST/7xlyP+ODJcv+OJjxdNum5WNY3xjEhQCAx6SMfWobNaQpsPT2GEgFIz
 YuvOVSmw31ZXepd/fw+Q/peI9KY09uAE/OpVmEGOPaxaJUxDHmviFTD1vp2CEY6cOsNg
 iFCiiI3RczLdpzFsAIgwip0aqxBhbjp4CLeZIuE1WtIB2pYCTr/J7mR6Y2d/+4tIUuYp
 OW9t/2Z3glPiYeMSqcT11C+vsw6eRz2mvSagpsyZgsujPU53JJwwlKdeco4zitqtA908
 XrEEEqyE5nguAEoYtBHBeA7vxKd6y1ZGEYlO3A9vcPLJV1hf1DMnkKkGKt28sQUF26WC
 IY4A==
X-Gm-Message-State: APjAAAVB81PS05yUshYvDtDQrfLy5W/xVxtj4zF3izldNbZj05A4o75H
 tanUXdK2xdeODgvnFimR0mM=
X-Google-Smtp-Source: APXvYqxj+CH1B9ZSPFdBpOB8JH3dDF9HijPNipsiNuGQPC96hFOX72IITlR4tsRNFYrq/4JfNych7g==
X-Received: by 2002:a5d:4204:: with SMTP id n4mr3723339wrq.123.1582796118644; 
 Thu, 27 Feb 2020 01:35:18 -0800 (PST)
Received: from localhost ([88.98.246.218])
 by smtp.gmail.com with ESMTPSA id b197sm6255088wmd.10.2020.02.27.01.35.18
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 27 Feb 2020 01:35:18 -0800 (PST)
From: luca.boccassi@gmail.com
To: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Cc: Rahul Gupta <rahul.gupta@broadcom.com>,
 Ajit Khaparde <ajit.khaparde@broadcom.com>, dpdk stable <stable@dpdk.org>
Date: Thu, 27 Feb 2020 09:33:46 +0000
Message-Id: <20200227093402.17690-26-luca.boccassi@gmail.com>
X-Mailer: git-send-email 2.20.1
In-Reply-To: <20200227093402.17690-1-luca.boccassi@gmail.com>
References: <20200217174546.25334-54-luca.boccassi@gmail.com>
 <20200227093402.17690-1-luca.boccassi@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Subject: [dpdk-stable] patch 'net/bnxt: fix race condition when port is
	stopped' has been queued to stable release 19.11.1
X-BeenThere: stable@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches for DPDK stable branches <stable.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/stable>,
 <mailto:stable-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/stable/>
List-Post: <mailto:stable@dpdk.org>
List-Help: <mailto:stable-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/stable>,
 <mailto:stable-request@dpdk.org?subject=subscribe>
Errors-To: stable-bounces@dpdk.org
Sender: "stable" <stable-bounces@dpdk.org>

Hi,

FYI, your patch has been queued to stable release 19.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/29/20. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Thanks.

Luca Boccassi

---
>From b28f36ddb0add0ee4501fbe1acf46bc70b9898fc Mon Sep 17 00:00:00 2001
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Date: Thu, 20 Feb 2020 09:42:14 +0530
Subject: [PATCH] net/bnxt: fix race condition when port is stopped

[ upstream commit c696cc659337c682f1055e646600ab3dca733b0e ]

Fix a race condition between port stop and error recovery task. When io
forwarding is not started on Stingray devices, driver will not receive
the async event from FW when there is a FW reset. While exiting testpmd,
as part of port stop driver sees this event and this in turn causes a
race between port stop and error recovery task.

Fixed this by ignoring the fatal/non-fatal async event from FW while
stopping port.

Fixes: df6cd7c1f73a ("net/bnxt: handle reset notify async event from FW")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Rahul Gupta <rahul.gupta@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_cpr.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/bnxt/bnxt_cpr.c b/drivers/net/bnxt/bnxt_cpr.c
index bb316b9e05..c0e492e6c2 100644
--- a/drivers/net/bnxt/bnxt_cpr.c
+++ b/drivers/net/bnxt/bnxt_cpr.c
@@ -76,6 +76,12 @@ void bnxt_handle_async_event(struct bnxt *bp,
 		PMD_DRV_LOG(INFO, "Port conn async event\n");
 		break;
 	case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_RESET_NOTIFY:
+		/* Ignore reset notify async events when stopping the port */
+		if (!bp->eth_dev->data->dev_started) {
+			bp->flags |= BNXT_FLAG_FATAL_ERROR;
+			return;
+		}
+
 		event_data = rte_le_to_cpu_32(async_cmp->event_data1);
 		/* timestamp_lo/hi values are in units of 100ms */
 		bp->fw_reset_max_msecs = async_cmp->timestamp_hi ?
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-02-27 09:31:56.658991623 +0000
+++ 0026-net-bnxt-fix-race-condition-when-port-is-stopped.patch	2020-02-27 09:31:55.755946020 +0000
@@ -1,8 +1,10 @@
-From c696cc659337c682f1055e646600ab3dca733b0e Mon Sep 17 00:00:00 2001
+From b28f36ddb0add0ee4501fbe1acf46bc70b9898fc Mon Sep 17 00:00:00 2001
 From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
 Date: Thu, 20 Feb 2020 09:42:14 +0530
 Subject: [PATCH] net/bnxt: fix race condition when port is stopped
 
+[ upstream commit c696cc659337c682f1055e646600ab3dca733b0e ]
+
 Fix a race condition between port stop and error recovery task. When io
 forwarding is not started on Stingray devices, driver will not receive
 the async event from FW when there is a FW reset. While exiting testpmd,
@@ -13,7 +15,6 @@
 stopping port.
 
 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: Rahul Gupta <rahul.gupta@broadcom.com>
@@ -23,7 +24,7 @@
  1 file changed, 6 insertions(+)
 
 diff --git a/drivers/net/bnxt/bnxt_cpr.c b/drivers/net/bnxt/bnxt_cpr.c
-index 0f7b5e96ca..21565b1e24 100644
+index bb316b9e05..c0e492e6c2 100644
 --- a/drivers/net/bnxt/bnxt_cpr.c
 +++ b/drivers/net/bnxt/bnxt_cpr.c
 @@ -76,6 +76,12 @@ void bnxt_handle_async_event(struct bnxt *bp,