patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Kevin Traynor <ktraynor@redhat.com>
To: Anatoly Burakov <anatoly.burakov@intel.com>
Cc: Vipin Padmam Ramesh <vipinp@vmware.com>, dpdk stable <stable@dpdk.org>
Subject: patch 'fbarray: fix incorrect lookbehind behavior' has been queued to stable release 21.11.8
Date: Fri, 23 Aug 2024 17:18:19 +0100	[thread overview]
Message-ID: <20240823161929.1004778-71-ktraynor@redhat.com> (raw)
In-Reply-To: <20240823161929.1004778-1-ktraynor@redhat.com>

Hi,

FYI, your patch has been queued to stable release 21.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/28/24. 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.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/5bc9924c52d50593a476ebaf94c5342daa85a84f

Thanks.

Kevin

---
From 5bc9924c52d50593a476ebaf94c5342daa85a84f Mon Sep 17 00:00:00 2001
From: Anatoly Burakov <anatoly.burakov@intel.com>
Date: Mon, 8 Jul 2024 17:07:33 +0100
Subject: [PATCH] fbarray: fix incorrect lookbehind behavior

[ upstream commit 8e3712928716a1deb8857c971865aa15dc436b04 ]

Currently, whenever first bit of current index mask is set
(meaning, there is potentially a run starting at the start of the mask),
lookbehind loop is entered.
In that loop, if the last bit of lookbehind mask is not set,
the lookbehind is stopped, and the current lookbehind mask index
is assigned to current index mask.
However, because at that point we are inside a while-loop that
decrements current index mask after each iteration,
this results in erroneous mask index decrement.

Fix lookbehind to avoid erroneous decrement, and add corresponding
unit test.

Fixes: e1ca5dc86226 ("fbarray: add reverse finding of chunk")

Signed-off-by: Vipin Padmam Ramesh <vipinp@vmware.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 app/test/test_fbarray.c             | 24 ++++++++++++++++++++++++
 lib/eal/common/eal_common_fbarray.c |  3 ++-
 2 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/app/test/test_fbarray.c b/app/test/test_fbarray.c
index fff44816a1..f448d4f196 100644
--- a/app/test/test_fbarray.c
+++ b/app/test/test_fbarray.c
@@ -112,4 +112,12 @@ static int lookahead_test_setup(void)
 }
 
+static int lookbehind_test_setup(void)
+{
+	/* set index 63 as used */
+	param.start = 63;
+	param.end = 63;
+	return init_array();
+}
+
 static int test_invalid(void)
 {
@@ -733,4 +741,19 @@ static int test_lookahead(void)
 }
 
+static int test_lookbehind(void)
+{
+	int ret, free_len = 2;
+
+	/* run regular test first */
+	ret = test_find();
+	if (ret != TEST_SUCCESS)
+		return ret;
+
+	/* test if we can find free chunk while crossing mask boundary */
+	TEST_ASSERT_EQUAL(rte_fbarray_find_prev_n_free(&param.arr, param.start + 1, free_len),
+			param.start - free_len, "Free chunk index is wrong\n");
+	return TEST_SUCCESS;
+}
+
 static struct unit_test_suite fbarray_test_suite = {
 	.suite_name = "fbarray autotest",
@@ -747,4 +770,5 @@ static struct unit_test_suite fbarray_test_suite = {
 		TEST_CASE_ST(empty_msk_test_setup, reset_array, test_empty),
 		TEST_CASE_ST(lookahead_test_setup, reset_array, test_lookahead),
+		TEST_CASE_ST(lookbehind_test_setup, reset_array, test_lookbehind),
 		TEST_CASES_END()
 	}
diff --git a/lib/eal/common/eal_common_fbarray.c b/lib/eal/common/eal_common_fbarray.c
index b59dd68d3e..0013ef2c55 100644
--- a/lib/eal/common/eal_common_fbarray.c
+++ b/lib/eal/common/eal_common_fbarray.c
@@ -516,5 +516,6 @@ find_prev_n(const struct rte_fbarray *arr, unsigned int start, unsigned int n,
 				 */
 				ignore_msk = UINT64_MAX << need;
-				msk_idx = lookbehind_idx;
+				/* outer loop will decrement msk_idx so add 1 */
+				msk_idx = lookbehind_idx + 1;
 				break;
 			}
-- 
2.46.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-08-23 17:18:11.920925613 +0100
+++ 0071-fbarray-fix-incorrect-lookbehind-behavior.patch	2024-08-23 17:18:09.749430207 +0100
@@ -1 +1 @@
-From 8e3712928716a1deb8857c971865aa15dc436b04 Mon Sep 17 00:00:00 2001
+From 5bc9924c52d50593a476ebaf94c5342daa85a84f Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 8e3712928716a1deb8857c971865aa15dc436b04 ]
+
@@ -20 +21,0 @@
-Cc: stable@dpdk.org
@@ -30 +31 @@
-index bf89b99e5b..147d6e2a07 100644
+index fff44816a1..f448d4f196 100644
@@ -73 +74 @@
-index 2680b34823..b4f0b0b0c3 100644
+index b59dd68d3e..0013ef2c55 100644
@@ -76 +77 @@
-@@ -513,5 +513,6 @@ find_prev_n(const struct rte_fbarray *arr, unsigned int start, unsigned int n,
+@@ -516,5 +516,6 @@ find_prev_n(const struct rte_fbarray *arr, unsigned int start, unsigned int n,


  parent reply	other threads:[~2024-08-23 16:22 UTC|newest]

Thread overview: 143+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-23 16:17 patch 'bus/pci: fix build with musl 1.2.4 / Alpine 3.19' " Kevin Traynor
2024-08-23 16:17 ` patch 'eal/unix: support ZSTD compression for firmware' " Kevin Traynor
2024-08-23 16:17 ` patch 'pcapng: add memcpy check' " Kevin Traynor
2024-08-23 16:17 ` patch 'net/virtio-user: " Kevin Traynor
2024-08-23 16:17 ` patch 'eal/windows: install sched.h file' " Kevin Traynor
2024-08-23 16:17 ` patch 'latencystats: fix literal float suffix' " Kevin Traynor
2024-08-23 16:17 ` patch 'net/hns3: fix offload flag of IEEE 1588' " Kevin Traynor
2024-08-23 16:17 ` patch 'net/hns3: fix Rx timestamp flag' " Kevin Traynor
2024-08-23 16:17 ` patch 'net/hns3: fix double free for Rx/Tx queue' " Kevin Traynor
2024-08-23 16:17 ` patch 'net/hns3: fix variable overflow' " Kevin Traynor
2024-08-23 16:17 ` patch 'net/hns3: disable SCTP verification tag for RSS hash input' " Kevin Traynor
2024-08-23 16:17 ` patch 'net/af_packet: align Rx/Tx structs to cache line' " Kevin Traynor
2024-08-23 16:17 ` patch 'doc: fix testpmd ring size command' " Kevin Traynor
2024-08-23 16:17 ` patch 'net/af_xdp: fix port ID in Rx mbuf' " Kevin Traynor
2024-08-23 16:17 ` patch 'net/af_xdp: count mbuf allocation failures' " Kevin Traynor
2024-08-23 16:17 ` patch 'net/tap: fix file descriptor check in isolated flow' " Kevin Traynor
2024-08-23 16:17 ` patch 'net/axgbe: fix MDIO access for non-zero ports and CL45 PHYs' " Kevin Traynor
2024-08-23 16:17 ` patch 'net/axgbe: reset link when link never comes back' " Kevin Traynor
2024-08-23 16:17 ` patch 'net/axgbe: fix fluctuations for 1G Bel Fuse SFP' " Kevin Traynor
2024-08-23 16:17 ` patch 'net/axgbe: update DMA coherency values' " Kevin Traynor
2024-08-23 16:17 ` patch 'net/axgbe: disable interrupts during device removal' " Kevin Traynor
2024-08-23 16:17 ` patch 'net/axgbe: fix SFP codes check for DAC cables' " Kevin Traynor
2024-08-23 16:17 ` patch 'net/axgbe: fix connection for SFP+ active " Kevin Traynor
2024-08-23 16:17 ` patch 'net/axgbe: check only minimum speed for " Kevin Traynor
2024-08-23 16:17 ` patch 'net/axgbe: fix Tx flow on 30H HW' " Kevin Traynor
2024-08-23 16:17 ` patch 'net/axgbe: delay AN timeout during KR training' " Kevin Traynor
2024-08-23 16:17 ` patch 'net/axgbe: fix linkup in PHY status' " Kevin Traynor
2024-08-23 16:17 ` patch 'net/ice: fix check for outer UDP checksum offload' " Kevin Traynor
2024-08-23 16:17 ` patch 'app/testpmd: fix outer IP " Kevin Traynor
2024-08-23 16:17 ` patch 'net/i40e: fix outer UDP checksum offload for X710' " Kevin Traynor
2024-08-23 16:17 ` patch 'app/testpmd: fix lcore ID restriction' " Kevin Traynor
2024-08-23 16:17 ` patch 'hash: fix return code description in Doxygen' " Kevin Traynor
2024-08-23 16:17 ` patch 'hash: check name when creating a hash' " Kevin Traynor
2024-08-23 16:17 ` patch 'vhost: fix build with GCC 13' " Kevin Traynor
2024-08-23 16:17 ` patch 'vhost: cleanup resubmit info before inflight setup' " Kevin Traynor
2024-08-23 16:17 ` patch 'net/virtio: fix MAC table update' " Kevin Traynor
2024-08-23 16:17 ` patch 'event/sw: fix warning from useless snprintf' " Kevin Traynor
2024-08-23 16:17 ` patch 'eal: fix logs for '--lcores'' " Kevin Traynor
2024-08-23 16:17 ` patch 'net/fm10k: fix cleanup during init failure' " Kevin Traynor
2024-08-23 16:17 ` patch 'net/ixgbe: do not update link status in secondary process' " Kevin Traynor
2024-08-23 16:17 ` patch 'net/ixgbe: do not create delayed interrupt handler twice' " Kevin Traynor
2024-08-23 16:17 ` patch 'net/e1000/base: fix link power down' " Kevin Traynor
2024-08-23 16:17 ` patch 'net/ixgbe/base: revert advertising for X550 2.5G/5G' " Kevin Traynor
2024-08-23 16:17 ` patch 'net/ixgbe/base: fix 5G link speed reported on VF' " Kevin Traynor
2024-08-23 16:17 ` patch 'net/ixgbe/base: fix PHY ID for X550' " Kevin Traynor
2024-08-23 16:17 ` patch 'net/cnxk: fix RSS config' " Kevin Traynor
2024-08-23 16:17 ` patch 'net/cnxk: fix outbound security with higher packet burst' " Kevin Traynor
2024-08-23 16:17 ` patch 'net/cnxk: fix promiscuous state after MAC change' " Kevin Traynor
2024-08-23 16:17 ` patch 'hash: fix RCU reclamation size' " Kevin Traynor
2024-08-23 16:17 ` patch 'common/mlx5: fix unsigned/signed mismatch' " Kevin Traynor
2024-08-23 16:17 ` patch 'net/mlx5: fix indexed pool with invalid index' " Kevin Traynor
2024-08-23 16:18 ` patch 'net/mlx5: fix hash Rx queue release in flow sample' " Kevin Traynor
2024-08-23 16:18 ` patch 'telemetry: lower log level on socket error' " Kevin Traynor
2024-08-23 16:18 ` patch 'app/bbdev: fix interrupt tests' " Kevin Traynor
2024-08-23 16:18 ` patch 'dmadev: fix structure alignment' " Kevin Traynor
2024-08-23 16:18 ` patch 'vdpa/sfc: remove dead code' " Kevin Traynor
2024-08-23 16:18 ` patch 'bpf: fix MOV instruction evaluation' " Kevin Traynor
2024-08-23 16:18 ` patch 'bpf: fix load hangs with six IPv6 addresses' " Kevin Traynor
2024-08-23 16:18 ` patch 'telemetry: fix connection parameter parsing' " Kevin Traynor
2024-08-23 16:18 ` patch 'baseband/la12xx: forbid secondary process' " Kevin Traynor
2024-08-23 16:18 ` patch 'crypto/cnxk: fix minimal input normalization' " Kevin Traynor
2024-08-23 16:18 ` patch 'cryptodev: fix build without crypto callbacks' " Kevin Traynor
2024-08-23 16:18 ` patch 'cryptodev: validate crypto callbacks from next node' " Kevin Traynor
2024-08-23 16:18 ` patch 'crypto/openssl: optimize 3DES-CTR context init' " Kevin Traynor
2024-08-23 16:18 ` patch 'crypto/openssl: set cipher padding once' " Kevin Traynor
2024-09-04 14:24   ` Kevin Traynor
2024-08-23 16:18 ` patch 'common/dpaax/caamflib: fix PDCP-SDAP watchdog error' " Kevin Traynor
2024-08-23 16:18 ` patch 'common/dpaax/caamflib: fix PDCP AES-AES " Kevin Traynor
2024-08-23 16:18 ` patch 'crypto/dpaa2_sec: fix event queue user context' " Kevin Traynor
2024-08-23 16:18 ` patch 'examples/ipsec-secgw: fix SA salt endianness' " Kevin Traynor
2024-08-26  8:07   ` [EXTERNAL] " Akhil Goyal
2024-08-26 11:06     ` Kevin Traynor
2024-08-23 16:18 ` patch 'fbarray: fix incorrect lookahead behavior' " Kevin Traynor
2024-08-23 16:18 ` Kevin Traynor [this message]
2024-08-23 16:18 ` patch 'fbarray: fix lookahead ignore mask handling' " Kevin Traynor
2024-08-23 16:18 ` patch 'fbarray: fix lookbehind " Kevin Traynor
2024-08-23 16:18 ` patch 'eal/linux: lower log level on allocation attempt failure' " Kevin Traynor
2024-08-23 16:18 ` patch 'app/testpmd: fix help string of BPF load command' " Kevin Traynor
2024-08-23 16:18 ` patch 'bus/dpaa: fix bus scan for DMA devices' " Kevin Traynor
2024-08-23 16:18 ` patch 'bus/dpaa: fix memory leak in bus scan' " Kevin Traynor
2024-08-23 16:18 ` patch 'common/dpaax: fix IOVA table cleanup' " Kevin Traynor
2024-08-23 16:18 ` patch 'common/dpaax: fix node array overrun' " Kevin Traynor
2024-08-23 16:18 ` patch 'bus/dpaa: remove redundant file descriptor check' " Kevin Traynor
2024-08-23 16:18 ` patch 'fbarray: fix finding for unaligned length' " Kevin Traynor
2024-08-23 16:18 ` patch 'buildtools: fix build with clang 17 and ASan' " Kevin Traynor
2024-08-23 16:18 ` patch 'net/ice/base: fix pointer to variable outside scope' " Kevin Traynor
2024-08-23 16:18 ` patch 'net/ice/base: fix sign extension' " Kevin Traynor
2024-08-23 16:18 ` patch 'net/ice/base: fix size when allocating children arrays' " Kevin Traynor
2024-08-23 16:18 ` patch 'net/ice/base: fix GCS descriptor field offsets' " Kevin Traynor
2024-08-23 16:18 ` patch 'net/ice/base: fix return type of bitmap hamming weight' " Kevin Traynor
2024-08-23 16:18 ` patch 'net/ice/base: fix check for existing switch rule' " Kevin Traynor
2024-08-23 16:18 ` patch 'net/ice/base: fix potential TLV length overflow' " Kevin Traynor
2024-08-23 16:18 ` patch 'net/ice/base: fix board type definition' " Kevin Traynor
2024-08-23 16:18 ` patch 'net/ice/base: fix masking when reading context' " Kevin Traynor
2024-08-23 16:18 ` patch 'app/testpmd: handle IEEE1588 init failure' " Kevin Traynor
2024-08-23 16:18 ` patch 'app/testpmd: fix parsing for connection tracking item' " Kevin Traynor
2024-08-23 16:18 ` patch 'net/txgbe: fix tunnel packet parsing' " Kevin Traynor
2024-08-23 16:18 ` patch 'net/txgbe: fix flow filters in VT mode' " Kevin Traynor
2024-08-23 16:18 ` patch 'net/txgbe: fix Tx hang on queue disable' " Kevin Traynor
2024-08-23 16:18 ` patch 'net/txgbe: restrict configuration of VLAN strip offload' " Kevin Traynor
2024-08-23 16:18 ` patch 'net/txgbe: reconfigure more MAC Rx registers' " Kevin Traynor
2024-08-23 16:18 ` patch 'net/txgbe: fix VF promiscuous and allmulticast' " Kevin Traynor
2024-08-23 16:18 ` patch 'net/ngbe: keep PHY power down while device probing' " Kevin Traynor
2024-08-23 16:18 ` patch 'net/txgbe: fix hotplug remove' " Kevin Traynor
2024-08-23 16:18 ` patch 'net/ngbe: " Kevin Traynor
2024-08-23 16:18 ` patch 'net/txgbe: fix MTU range' " Kevin Traynor
2024-08-23 16:18 ` patch 'net/ngbe: " Kevin Traynor
2024-08-23 16:18 ` patch 'net/txgbe: fix memory leaks' " Kevin Traynor
2024-08-23 16:18 ` patch 'net/ngbe: " Kevin Traynor
2024-08-23 16:18 ` patch 'net/txgbe: fix Rx interrupt' " Kevin Traynor
2024-08-23 16:18 ` patch 'net/vmxnet3: fix init logs' " Kevin Traynor
2024-08-23 16:18 ` patch 'net/ena: fix bad checksum handling' " Kevin Traynor
2024-08-26 10:26   ` Brandes, Shai
2024-08-26 11:17     ` Kevin Traynor
2024-09-02 13:01       ` Brandes, Shai
2024-09-04 14:30         ` Kevin Traynor
2024-08-23 16:18 ` patch 'net/ena: fix return value check' " Kevin Traynor
2024-08-23 16:18 ` patch 'net/nfp: fix disabling 32-bit build' " Kevin Traynor
2024-08-23 16:19 ` patch 'test/crypto: fix allocation comment' " Kevin Traynor
2024-08-23 16:19 ` patch 'doc: fix typo in l2fwd-crypto guide' " Kevin Traynor
2024-08-23 16:19 ` patch 'test/crypto: fix asymmetric capability test' " Kevin Traynor
2024-08-23 16:19 ` patch 'net/ice: fix memory leaks in raw pattern parsing' " Kevin Traynor
2024-08-23 16:19 ` patch 'net/ice: fix return value for " Kevin Traynor
2024-08-23 16:19 ` patch 'net/mlx5: fix Arm build with GCC 9.1' " Kevin Traynor
2024-08-23 16:19 ` patch 'net/mlx5: fix MTU configuration' " Kevin Traynor
2024-08-23 16:19 ` patch 'net/mlx5: fix end condition of reading xstats' " Kevin Traynor
2024-08-23 16:19 ` patch 'net/mlx5: fix uplink port probing in bonding mode' " Kevin Traynor
2024-08-23 16:19 ` patch 'common/mlx5: remove unneeded field when modify RQ table' " Kevin Traynor
2024-08-23 16:19 ` patch 'net/hns3: check Rx DMA address alignmnent' " Kevin Traynor
2024-08-23 16:19 ` patch 'net/ark: fix index arithmetic' " Kevin Traynor
2024-08-23 16:19 ` patch 'ethdev: fix GENEVE option item conversion' " Kevin Traynor
2024-08-23 16:19 ` patch 'app/testpmd: fix build on signed comparison' " Kevin Traynor
2024-08-23 16:19 ` patch 'bus/pci: fix UIO resource mapping in secondary process' " Kevin Traynor
2024-08-23 16:19 ` patch 'bus/pci: fix FD " Kevin Traynor
2024-08-23 16:19 ` patch 'app/dumpcap: handle SIGTERM and SIGHUP' " Kevin Traynor
2024-08-23 16:19 ` patch 'app/pdump: " Kevin Traynor
2024-08-23 16:19 ` patch 'malloc: fix multi-process wait condition handling' " Kevin Traynor
2024-08-23 16:19 ` patch 'bus/vdev: fix device reinitialization' " Kevin Traynor
2024-08-23 16:19 ` patch 'net/hns3: fix uninitialized variable in FEC query' " Kevin Traynor
2024-08-23 16:19 ` patch 'net/ice/base: fix temporary failures reading NVM' " Kevin Traynor
2024-08-23 16:19 ` patch 'doc: remove reference to mbuf pkt field' " Kevin Traynor
2024-08-23 16:19 ` patch 'examples/ipsec-secgw: revert SA salt endianness' " Kevin Traynor
2024-08-23 16:19 ` patch 'doc: add baseline mode in l3fwd-power guide' " Kevin Traynor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240823161929.1004778-71-ktraynor@redhat.com \
    --to=ktraynor@redhat.com \
    --cc=anatoly.burakov@intel.com \
    --cc=stable@dpdk.org \
    --cc=vipinp@vmware.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).