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 333A6A0553 for ; Mon, 17 Feb 2020 18:46:25 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 28CA31DAA7; Mon, 17 Feb 2020 18:46:25 +0100 (CET) Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) by dpdk.org (Postfix) with ESMTP id 5B7A51DAA7 for ; Mon, 17 Feb 2020 18:46:24 +0100 (CET) Received: by mail-wm1-f42.google.com with SMTP id t14so171185wmi.5 for ; Mon, 17 Feb 2020 09:46:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7aCkPyBoeY6D3D9E2nUS55An9VBD6iZwHj5cwKl8JpU=; b=panT+NM/A3jyRuV00r33ohaIOHRLQpO2aCu1cGjbcFM5kI4zCQvyQRIm+W7xQQaUl8 +DOcyjeCWoBAdotiRMsZdkhn6tDDzHbrE8yOqP61K85zz/CgMwsBIuBHu3N8J9u5wv9J uR2uTBpkzkGJmbI9kcUTG9bxgAgOPHHsev+JGZYKCvpbUHHUS9aPXs0Qu9WES9j9RGY1 Qp+8fYbjzVHM6GYOIjJeNu6y170sFMf7wlK85843vt9xIzIuoIOC4knqihjOXS86p/OR iA6rGuwqOVVcRgLKaYLxGlfwtFGf/ymhFtPNPfjudQWvB2xN8Qc0HYNKMIDXp61CFAqI hT/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7aCkPyBoeY6D3D9E2nUS55An9VBD6iZwHj5cwKl8JpU=; b=hTLj106Qe3BuU69tJAo8e23Hv0wohBReymiG4VO/Ypd/M3VWfibYFloKH/zn/zpmVO F2s/UDgGAOtb/Yw+1SMEiYL+QlBuKreVeRnbK1wM5VLFo3SWAhigpqsi78igORNKO4Ee 5QyBieAbCzUz4+pPasY4oVXxY1OBGaCtiq8arALQ8HKoih/oGK/IdzXhQSq4vs8Naj9x m0vek2eueniImVa1oG1js9MTSPQVFbEaQVxGjJ0BdyD2zT8bj9dJFbzmzVXgJfnc1fd1 bfEomyXwlkhPC9GXPqVgwk8SaQHjXHauYF/xBxtA3GINt2qQv73JNxpjDbLseedVTP+D ztxA== X-Gm-Message-State: APjAAAWrZ/MARCyCr5A5G4zwLjcDmUkTAtbtA1vGU5N4sYBQ2KHLOKoN 57IkiigCOHSp/4IxYaz8EWwv9NDMGmfiPw== X-Google-Smtp-Source: APXvYqxd6CLkA7FcuhLA0YcH/iw2q8Hmww9FLFR+qCdH9keeWKqjEQZBAufojLmYv8aAwL3l2GrnUQ== X-Received: by 2002:a7b:c7c9:: with SMTP id z9mr131357wmk.175.1581961584095; Mon, 17 Feb 2020 09:46:24 -0800 (PST) Received: from localhost (userh634.uk.uudial.com. [194.69.103.7]) by smtp.gmail.com with ESMTPSA id k16sm2064344wru.0.2020.02.17.09.46.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2020 09:46:23 -0800 (PST) From: luca.boccassi@gmail.com To: Santoshkumar Karanappa Rastapur Cc: Somnath Kotur , dpdk stable Date: Mon, 17 Feb 2020 17:45:13 +0000 Message-Id: <20200217174546.25334-21-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200217174546.25334-1-luca.boccassi@gmail.com> References: <20200211112216.3929-190-luca.boccassi@gmail.com> <20200217174546.25334-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/bnxt: fix buffer allocation reattempt' has been queued to stable release 19.11.1 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 stable release 19.11.1 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/19/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 rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Thanks. Luca Boccassi --- >From 7f16d7d4c86a42b09cb6bfad2e4a650d2d9f8d49 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 3b713c2427..7338a81029 100644 --- a/drivers/net/bnxt/bnxt_rxr.c +++ b/drivers/net/bnxt/bnxt_rxr.c @@ -678,10 +678,11 @@ uint16_t bnxt_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, /* Attempt to alloc Rx buf in case of a previous allocation failure. */ if (rc == -ENOMEM) { - int i; + int i = RING_NEXT(rxr->rx_ring_struct, prod); + int cnt = nb_rx_pkts; - for (i = prod; i <= nb_rx_pkts; - i = RING_NEXT(rxr->rx_ring_struct, i)) { + for (; cnt; + i = RING_NEXT(rxr->rx_ring_struct, i), cnt--) { struct bnxt_sw_rx_bd *rx_buf = &rxr->rx_buf_ring[i]; /* Buffer already allocated for this index. */ -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-02-17 17:00:15.913570477 +0000 +++ 0021-net-bnxt-fix-buffer-allocation-reattempt.patch 2020-02-17 17:00:15.307950455 +0000 @@ -1,15 +1,16 @@ -From 01829dea7303bc91063c461a675856dbbbcc6460 Mon Sep 17 00:00:00 2001 +From 7f16d7d4c86a42b09cb6bfad2e4a650d2d9f8d49 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") -Cc: stable@dpdk.org Signed-off-by: Santoshkumar Karanappa Rastapur Reviewed-by: Somnath Kotur @@ -18,7 +19,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 1f47db97ba..bef9720f59 100644 +index 3b713c2427..7338a81029 100644 --- a/drivers/net/bnxt/bnxt_rxr.c +++ b/drivers/net/bnxt/bnxt_rxr.c @@ -678,10 +678,11 @@ uint16_t bnxt_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,