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 40E29A0C41; Wed, 17 Nov 2021 05:05:28 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 00AFB41144; Wed, 17 Nov 2021 05:05:28 +0100 (CET) Received: from mail-il1-f175.google.com (mail-il1-f175.google.com [209.85.166.175]) by mails.dpdk.org (Postfix) with ESMTP id 18A6541143 for ; Wed, 17 Nov 2021 05:05:26 +0100 (CET) Received: by mail-il1-f175.google.com with SMTP id w15so1387048ill.2 for ; Tue, 16 Nov 2021 20:05:26 -0800 (PST) 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=TH+Qkra5i51ggQsGeUglTiLb8vAzW8KBVLGVtLZcFSM=; b=KF/75tvvesglhllNn1NwG+h8Kkm3EpluGbsTskAe2IM16Ss2iGDPF+aS3UPbfmzcFG 3x+0gllf9gC2Kimut3CyjNC5Sp11kK1qunJtWLXLHsh1Itb5k3zNWxpCosVQgkqaVlX9 ciyK5n9V+MyLCYKMi5MDlI8YxGS2DETJGHB14= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=TH+Qkra5i51ggQsGeUglTiLb8vAzW8KBVLGVtLZcFSM=; b=FmIPZt5oAgLaShQ9dwb545JeKXs7Tk6fBNngXY3DPks0nog/K+h0fEUXwUCNLxZek0 94NTGKpE7RCatvDhemQnwHe/q5Y8sN+wJ/SKAhox2pr7AeCv1tXn5ncFuE1Tr9IbIeWs rY0rPlcLNWTeqzKRTZABsbWb+qJ69V5sY1tDpixUkb7Wv4lD3MfXqo6mHnS8bSxjIrpv reOi4J1t3tpWd7X+Xwv6dbwCcLvpE5lJpXWpuOogeHsHB3PYZpxMKSQX+Cb5Iiq3VL9o nspJFcAyeESGDykW8uVL0prqA95ovyAAlpWrrPbcnRONyThnDt9iyvOVuW7iTK5tMp8s epYw== X-Gm-Message-State: AOAM531rWsMeeyASEbvE1hI37OrN92NhdakCgLcyCn0/S033kTItuJu0 dbZgXm7MyiVHdFemD6tq7/M7HxMDHeVcELFAkpmnNw== X-Google-Smtp-Source: ABdhPJwiEeOWcW0kSS0Fs7YP8t8wOJh6x8JtBV/J2jkUwL0snZY48yWQ/mjmEq0I+6xEEtM5r+WYetteXJlrpGUxF64= X-Received: by 2002:a92:d5c1:: with SMTP id d1mr8373792ilq.311.1637121925407; Tue, 16 Nov 2021 20:05:25 -0800 (PST) MIME-Version: 1.0 References: <20211117031206.11727-1-somnath.kotur@broadcom.com> In-Reply-To: <20211117031206.11727-1-somnath.kotur@broadcom.com> From: Ajit Khaparde Date: Tue, 16 Nov 2021 20:05:09 -0800 Message-ID: Subject: Re: [PATCH] net/bnxt: fix to set Rx next cons in mbuf alloc fail case To: Somnath Kotur Cc: dpdk-dev , Ferruh Yigit , dpdk stable , Kalesh Anakkur Purayil Content-Type: text/plain; charset="UTF-8" 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 On Tue, Nov 16, 2021 at 7:18 PM Somnath Kotur wrote: > > 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: Ajit Khaparde > Reviewed-by: Kalesh Anakkur Purayil Patch applied to dpdk-next-net-brcm. Thanks > --- > 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 8bc8ddc353..e461500ceb 100644 > --- a/drivers/net/bnxt/bnxt_rxr.c > +++ b/drivers/net/bnxt/bnxt_rxr.c > @@ -1008,6 +1008,7 @@ static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt, > goto rx; > } > rxr->rx_raw_prod = raw_prod; > +rx: > rxr->rx_next_cons = RING_IDX(rxr->rx_ring_struct, RING_NEXT(cons)); > > if (BNXT_TRUFLOW_EN(bp) && (BNXT_VF_IS_TRUSTED(bp) || BNXT_PF(bp)) && > @@ -1026,7 +1027,6 @@ static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt, > * 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 >