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 D4790A0C4D; Wed, 1 Sep 2021 05:39:33 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9F0EA4013F; Wed, 1 Sep 2021 05:39:33 +0200 (CEST) Received: from relay.smtp-ext.broadcom.com (saphodev.broadcom.com [192.19.11.229]) by mails.dpdk.org (Postfix) with ESMTP id 7395B40041 for ; Wed, 1 Sep 2021 05:39:32 +0200 (CEST) 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 C0D3F80C0; Tue, 31 Aug 2021 20:39:30 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com C0D3F80C0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1630467571; bh=HSkxa4QyyNw4suSZxrzW6SJVReAgpIMN8Brt0+B8LJI=; h=From:To:Cc:Subject:Date:From; b=Fy8Yh9iNUhP/sea/LbTi7+xLArMwUxydPsldTS8aE14O1u/mC5Zbw5p9XJAsVcrI6 I0ssXr4jUNHZrSC5qdRpgUQ0YvoAcz+Bd8qaTHCJvQnqwrZEYg5IoYSQZuQv+Fe0Xp P/Ndz5QZujr0nAvLm00ZD2t2+nafzAmSV7/vL1e4= From: Kalesh A P To: dev@dpdk.org Cc: ferruh.yigit@intel.com, ajit.khaparde@broadcom.com Date: Wed, 1 Sep 2021 09:30:01 +0530 Message-Id: <20210901040001.18378-1-kalesh-anakkur.purayil@broadcom.com> X-Mailer: git-send-email 2.10.1 Subject: [dpdk-dev] [PATCH] net/bnxt: fix double allocation of ring groups 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" From: Kalesh AP After commit "d68249f88266", driver allocates ring groups in bnxt_alloc_hwrm_rx_ring(). But during port start, driver invokes bnxt_alloc_hwrm_rx_ring() followed by bnxt_alloc_all_hwrm_ring_grps(). This will cause the FW command failure in bnxt_alloc_all_hwrm_ring_grps(). To fix this, just don't create the ring group if it is already created. Fixes: d68249f88266 ("net/bnxt: update ring group after ring stop start") Cc: stable@dpdk.org Signed-off-by: Kalesh AP Reviewed-by: Ajit Khaparde Reviewed-by: Lance Richardson --- drivers/net/bnxt/bnxt_hwrm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c index f29d574..f65dc72 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -1864,6 +1864,10 @@ int bnxt_hwrm_ring_grp_alloc(struct bnxt *bp, unsigned int idx) struct hwrm_ring_grp_alloc_input req = {.req_type = 0 }; struct hwrm_ring_grp_alloc_output *resp = bp->hwrm_cmd_resp_addr; + /* Don't attempt to re-create the ring group if it is already created */ + if (bp->grp_info[idx].fw_grp_id != INVALID_HW_RING_ID) + return 0; + HWRM_PREP(&req, HWRM_RING_GRP_ALLOC, BNXT_USE_CHIMP_MB); req.cr = rte_cpu_to_le_16(bp->grp_info[idx].cp_fw_ring_id); -- 2.10.1