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 F423BA0C4C for ; Wed, 1 Dec 2021 07:02:06 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BD5F54067B; Wed, 1 Dec 2021 07:02:06 +0100 (CET) Received: from relay.smtp-ext.broadcom.com (lpdvsmtp11.broadcom.com [192.19.166.231]) by mails.dpdk.org (Postfix) with ESMTP id 236604067B for ; Wed, 1 Dec 2021 07:02:05 +0100 (CET) Received: from dhcp-10-123-153-55.dhcp.broadcom.net (dhcp-10-123-153-55.dhcp.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 05E31C0027C4; Tue, 30 Nov 2021 22:02:02 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com 05E31C0027C4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1638338524; bh=KLnS7Kw+2qpOS5oeUtS9CwjdlJmuTvgg2+cQHzi8118=; h=From:To:Cc:Subject:Date:From; b=d3akEwyXYsYizAQwHJd+npjHNdupUPZwo6FlWojvJOh8fUn/bZlmFPlxKusVflv98 sONBpHeSaOzqG6V3LBrtb1fyW6uu9XJbfOXARML6FD/rPZt2aw827V0BRUXq7kyqSj V8gmFL+iYAzNqhIMWSM+ZHfaTULVcqjtlMzS98JE= From: Somnath Kotur To: stable@dpdk.org Cc: Somnath Kotur , Ajit Khaparde , Kalesh AP Subject: [PATCH 19.11] net/bnxt: fix Rx next consumer index in mbuf alloc fail Date: Wed, 1 Dec 2021 11:25:16 +0530 Message-Id: <20211201055516.24523-1-somnath.kotur@broadcom.com> X-Mailer: git-send-email 2.28.0.450.g3a238e5 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org [ upstream commit a7e21843f0f6067ebe36eafff9b8319092db3fc4 ] The driver internal variable to track the next consumer index on the Rx ring was not being set if there was an mbuf allocation failure. In that scenario, eventually it would fall out of sync with the actual consumer index and raise a false alarm on Thor needlessly causing a segmentation fault with testpmd Fixes: 03c8f2fe111c ("net/bnxt: detect bad opaque in Rx completion") Cc: stable@dpdk.org Signed-off-by: Somnath Kotur Signed-off-by: Ajit Khaparde Reviewed-by: Kalesh AP --- drivers/net/bnxt/bnxt_rxr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c index f830bb6702..1e0640829f 100644 --- a/drivers/net/bnxt/bnxt_rxr.c +++ b/drivers/net/bnxt/bnxt_rxr.c @@ -684,12 +684,12 @@ static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt, goto rx; } rxr->rx_prod = prod; +rx: rxr->rx_next_cons = RING_NEXT(rxr->rx_ring_struct, cons); /* * All MBUFs are allocated with the same size under DPDK, * no optimization for rx_copy_thresh */ -rx: *rx_pkt = mbuf; next_rx: -- 2.28.0.497.g54e85e7