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 F0EB5A00C3; Thu, 20 Jan 2022 09:53:34 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 974BB426DE; Thu, 20 Jan 2022 09:53:29 +0100 (CET) Received: from relay.smtp-ext.broadcom.com (relay.smtp-ext.broadcom.com [192.19.166.231]) by mails.dpdk.org (Postfix) with ESMTP id 856E2426D5 for ; Thu, 20 Jan 2022 09:53:26 +0100 (CET) Received: from dhcp-10-123-153-22.dhcp.broadcom.net (bgccx-dev-host-lnx2.bec.broadcom.net [10.123.153.22]) by relay.smtp-ext.broadcom.com (Postfix) with ESMTP id CBA07C000C77; Thu, 20 Jan 2022 00:53:24 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com CBA07C000C77 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1642668805; bh=RooFCbt3sEZYueS9tgDnUcIXVcWyecX7o0SsGt04uiw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SXR0tIBWpBGl3xzq3WHD/CMmSUN134KjT1Ihxd8sLXcSvw2BInIhWZw8wLHfmlxBd 7dobGdImrUeWw0JGLbUri0RDvq3Fujr47GKzQr+joaTYjtqtly+cPyP3m3t30lewaW LCIBxHTnWUKBiOcXK5MLthBhP8A7qZEQjmbVe3Js= From: Kalesh A P To: dev@dpdk.org Cc: ferruh.yigit@intel.com, ajit.khaparde@broadcom.com Subject: [dpdk-dev] [PATCH 2/4] net/bnxt: handle ring cleanup in case of error Date: Thu, 20 Jan 2022 14:42:26 +0530 Message-Id: <20220120091228.7076-3-kalesh-anakkur.purayil@broadcom.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20220120091228.7076-1-kalesh-anakkur.purayil@broadcom.com> References: <20220120091228.7076-1-kalesh-anakkur.purayil@broadcom.com> 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 From: Kalesh AP In bnxt_alloc_mem(), after bnxt_alloc_async_ring_struct(), any of the functions failure causes an error: bnxt_hwrm_ring_free(): hwrm_ring_free nq failed. rc:1 Fix this by initializing ring->fw_ring_id to INVALID_HW_RING_ID in bnxt_alloc_async_ring_struct(). Fixes: bd0a14c99f65 ("net/bnxt: use dedicated CPR for async events") Cc: stable@dpdk.org Signed-off-by: Kalesh AP Reviewed-by: Ajit Khaparde Reviewed-by: Somnath Kotur --- drivers/net/bnxt/bnxt_ring.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/bnxt/bnxt_ring.c b/drivers/net/bnxt/bnxt_ring.c index dc437f3..5c6c27f 100644 --- a/drivers/net/bnxt/bnxt_ring.c +++ b/drivers/net/bnxt/bnxt_ring.c @@ -851,6 +851,7 @@ int bnxt_alloc_async_ring_struct(struct bnxt *bp) ring->ring_mask = ring->ring_size - 1; ring->vmem_size = 0; ring->vmem = NULL; + ring->fw_ring_id = INVALID_HW_RING_ID; bp->async_cp_ring = cpr; cpr->cp_ring_struct = ring; -- 2.10.1