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 E60EFA0C4C; Thu, 2 Sep 2021 02:41:01 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C64514067E; Thu, 2 Sep 2021 02:41:01 +0200 (CEST) Received: from mail-il1-f179.google.com (mail-il1-f179.google.com [209.85.166.179]) by mails.dpdk.org (Postfix) with ESMTP id B8C8440142 for ; Thu, 2 Sep 2021 02:41:00 +0200 (CEST) Received: by mail-il1-f179.google.com with SMTP id a1so82261ilj.6 for ; Wed, 01 Sep 2021 17:41:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=S66zVlSUWqn7yag7CoGPelrdiApoMfQC3ZZ5kf+uwO4=; b=FzrCI85J5+TF5YvFfWDNqQNzw2H7GZ1/M9DFQm3T/kccdBZXKlSkeAtLv0LK0luk9F KGW32iEUOMAis52B/wbhg2XtlyOJ2KCa2b2lY6L8GOqSMxmbPGr+7kRXVtafVWqqBMaD ++Q4mPyNYuvV8TsWF1/CMQ31s/5Qe9xKg/NUI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=S66zVlSUWqn7yag7CoGPelrdiApoMfQC3ZZ5kf+uwO4=; b=MzNHZta8M50XfJpUMIR/0n5HW3U4P9Y1KR7TRbqQir6oiznxXHDw+N8+PdjpQ+CMvy 1tRo+XqQ+vbAI2XTcwRA6XMwZG6RfvaXLyiDWw4sHBgm8QRdUzSnIgv1TB2S4AhXtORf 5FaIbtSEDPqTC0Dd53UMsfv+cEI5fYVlys3Ne1gXBJX17eX9pWT54YbKtZm7o+gnRgnb v1b4FLiCgDtvp682LXSzTB59az/eYSo5yrwkn+AfZqeYd7rJBQDpFKfMYpcJp5tS8+Po CwrV4mbvxcOdKulboGITTN6ariBvWarWLEFEiiKphZupZUkPlS2PL8jdwE20bVRulyYA W+zQ== X-Gm-Message-State: AOAM530FvhjCYiJ9IAsv6pz/JvvSlU6bBc+HNxs7NeOmhx/IHBj+MBBs SFq0Rj2O6en5rjvZncOQkm4JUg+xeuL6xHXKbnAHqw== X-Google-Smtp-Source: ABdhPJwoL+3a1y+KP2SK7NhbfQYb1xcMSuf+7JW1J/WcXpOcQ0/ONb2UadIWBFJgiHldmsKrrsQNXcIapT7QviwkK28= X-Received: by 2002:a92:c60d:: with SMTP id p13mr350841ilm.8.1630543260032; Wed, 01 Sep 2021 17:41:00 -0700 (PDT) MIME-Version: 1.0 References: <20210901040001.18378-1-kalesh-anakkur.purayil@broadcom.com> In-Reply-To: <20210901040001.18378-1-kalesh-anakkur.purayil@broadcom.com> From: Ajit Khaparde Date: Wed, 1 Sep 2021 17:40:44 -0700 Message-ID: To: Kalesh A P Cc: dpdk-dev , Ferruh Yigit Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="000000000000d2439e05caf86f98" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [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" --000000000000d2439e05caf86f98 Content-Type: text/plain; charset="UTF-8" On Tue, Aug 31, 2021 at 8:39 PM Kalesh A P wrote: > > 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 Patch applied to dpdk-next-net-brcm. Thanks > --- > 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 > --000000000000d2439e05caf86f98--