From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E90CEA0C58; Mon, 23 Aug 2021 17:47:44 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A36164014D; Mon, 23 Aug 2021 17:47:44 +0200 (CEST) Received: from relay.smtp-ext.broadcom.com (lpdvacalvio01.broadcom.com [192.19.166.228]) by mails.dpdk.org (Postfix) with ESMTP id A964540142; Mon, 23 Aug 2021 17:47:43 +0200 (CEST) Received: from dhcp-10-123-153-55.dhcp.broadcom.net (bgccx-dev-host-lnx35.bec.broadcom.net [10.123.153.55]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by relay.smtp-ext.broadcom.com (Postfix) with ESMTPS id 4337D7A20; Mon, 23 Aug 2021 08:47:41 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com 4337D7A20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1629733663; bh=l/F8yM9QCKbWEOmLZLU53uSsFiHoBZRVQb/200WmYI4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y2bwg5Xlk+a7TquTYVtHjXEjBh9du0xBrrb6qrGOrQwZndgR1VUnoltk29bVARD08 gID+U9rrTIQRbKJoE6Pe4S41VOcbSxi+U7LkWeq+W1EDCKEXiiKTQBlPqnAQybTxbW 5vdiRC6t0Aq15krJ3846evF8BzS2oi9BtHGBpKY4= From: Somnath Kotur To: dev@dpdk.org Cc: ferruh.yigit@intel.com, Somnath Kotur , stable@dpdk.org, Kalesh AP , Ajit Khaparde Date: Mon, 23 Aug 2021 21:13:17 +0530 Message-Id: <20210823154317.338-1-somnath.kotur@broadcom.com> X-Mailer: git-send-email 2.28.0.450.g3a238e5 In-Reply-To: <20210810060731.30127-1-somnath.kotur@broadcom.com> References: <20210810060731.30127-1-somnath.kotur@broadcom.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v4] net/bnxt: fix crash after port stop/start X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On chips like Thor, port stop/start sequence could result in a crash in the application. This is because of false detection of a bad opaque in the Rx completion and the subsequent kicking-in of the ring reset code to recover from the condition. The root cause being that the port stop/start would result in the HW starting with fresh values, while the driver internal tracker variable `rx_next_cons` is still pointing to a stale value. Fix this by reseting rx_next_cons to 0 in bnxt_init_one_rx_ring() Fixes: 03c8f2fe111c ("net/bnxt: detect bad opaque in Rx completion") Cc: stable@dpdk.org Signed-off-by: Somnath Kotur Reviewed-by: Kalesh AP Reviewed-by: Ajit Khaparde --- v4: Updated commit log as requested by Ferruh v3: Updated commit log and summary as requested by Ferruh v2: Updated commit log as requested by Ferruh drivers/net/bnxt/bnxt_rxr.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c index aea71703d1..73fbdd17d1 100644 --- a/drivers/net/bnxt/bnxt_rxr.c +++ b/drivers/net/bnxt/bnxt_rxr.c @@ -1379,6 +1379,9 @@ int bnxt_init_one_rx_ring(struct bnxt_rx_queue *rxq) } PMD_DRV_LOG(DEBUG, "TPA alloc Done!\n"); + /* Explicitly reset this driver internal tracker on a ring init */ + rxr->rx_next_cons = 0; + return 0; } -- 2.28.0.497.g54e85e7