From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0B06BA0555 for ; Wed, 19 Feb 2020 16:57:26 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EED301B951; Wed, 19 Feb 2020 16:57:25 +0100 (CET) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by dpdk.org (Postfix) with ESMTP id C4E731B951 for ; Wed, 19 Feb 2020 16:57:24 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582127844; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=13GlTfH/WEqWsCm5j9cBZgFLx+KD+5pIWbpJhTXUpZA=; b=LL9sFEu2s7bt0gEcI5Y4AIelRBuWTF7I9Bw2BHr4wg9CLAoJv4aJSm9aoGcfTC4Ob8Xf9e SB7K/k00C/kD3HZlLkx/Q1CL+OOUfMkzaOn2U+X2RWFpC7aUTAjk6qAimprc5OaP109OTW fNUNANrZsjaU7qUhG/fWhiJT2ihMMro= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-253-JrLvykb-MTOiUmBKAUWooA-1; Wed, 19 Feb 2020 10:57:18 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0676F800D4E; Wed, 19 Feb 2020 15:57:17 +0000 (UTC) Received: from rh.redhat.com (unknown [10.33.36.109]) by smtp.corp.redhat.com (Postfix) with ESMTP id E7BEE8AC45; Wed, 19 Feb 2020 15:57:12 +0000 (UTC) From: Kevin Traynor To: Santoshkumar Karanappa Rastapur Cc: Somnath Kotur , dpdk stable Date: Wed, 19 Feb 2020 15:55:57 +0000 Message-Id: <20200219155607.20495-12-ktraynor@redhat.com> In-Reply-To: <20200219155607.20495-1-ktraynor@redhat.com> References: <20200219155607.20495-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: JrLvykb-MTOiUmBKAUWooA-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Subject: [dpdk-stable] patch 'net/bnxt: fix buffer allocation reattempt' has been queued to LTS release 18.11.7 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 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 Sender: "stable" Hi, FYI, your patch has been queued to LTS release 18.11.7 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/25/20. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasi= ng (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable-queue This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable-queue/commit/19562f083ea2f118b6= 1820482416db47aa88be19 Thanks. Kevin. --- >From 19562f083ea2f118b61820482416db47aa88be19 Mon Sep 17 00:00:00 2001 From: Santoshkumar Karanappa Rastapur Date: Thu, 6 Feb 2020 22:03:14 +0530 Subject: [PATCH] net/bnxt: fix buffer allocation reattempt [ upstream commit 01829dea7303bc91063c461a675856dbbbcc6460 ] In case of a buffer allocation failure, we reattempt buffer allocation before the Rx handler exits. We were not attempting this when producer index is greater than the number of buffers to allocate. Fixed it with correct checks. Fixes: d9dd0b29ed31 ("net/bnxt: fix Rx handling and buffer allocation logic= ") Signed-off-by: Santoshkumar Karanappa Rastapur Reviewed-by: Somnath Kotur --- drivers/net/bnxt/bnxt_rxr.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c index bcfbad135e..3a1d22354d 100644 --- a/drivers/net/bnxt/bnxt_rxr.c +++ b/drivers/net/bnxt/bnxt_rxr.c @@ -609,8 +609,9 @@ uint16_t bnxt_recv_pkts(void *rx_queue, struct rte_mbuf= **rx_pkts, =09/* Attempt to alloc Rx buf in case of a previous allocation failure. */ =09if (rc =3D=3D -ENOMEM) { -=09=09int i; +=09=09int i =3D RING_NEXT(rxr->rx_ring_struct, prod); +=09=09int cnt =3D nb_rx_pkts; =20 -=09=09for (i =3D prod; i <=3D nb_rx_pkts; -=09=09=09i =3D RING_NEXT(rxr->rx_ring_struct, i)) { +=09=09for (; cnt; +=09=09=09i =3D RING_NEXT(rxr->rx_ring_struct, i), cnt--) { =09=09=09struct bnxt_sw_rx_bd *rx_buf =3D &rxr->rx_buf_ring[i]; =20 --=20 2.21.1 --- Diff of the applied patch vs upstream commit (please double-check if non-= empty: --- --- -=092020-02-19 15:43:50.347081103 +0000 +++ 0012-net-bnxt-fix-buffer-allocation-reattempt.patch=092020-02-19 15:43:= 49.734141932 +0000 @@ -1 +1 @@ -From 01829dea7303bc91063c461a675856dbbbcc6460 Mon Sep 17 00:00:00 2001 +From 19562f083ea2f118b61820482416db47aa88be19 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 01829dea7303bc91063c461a675856dbbbcc6460 ] + @@ -12 +13,0 @@ -Cc: stable@dpdk.org @@ -21 +22 @@ -index 1f47db97ba..bef9720f59 100644 +index bcfbad135e..3a1d22354d 100644 @@ -24 +25 @@ -@@ -679,8 +679,9 @@ uint16_t bnxt_recv_pkts(void *rx_queue, struct rte_mbu= f **rx_pkts, +@@ -609,8 +609,9 @@ uint16_t bnxt_recv_pkts(void *rx_queue, struct rte_mbu= f **rx_pkts,