patches for DPDK stable branches
 help / color / mirror / Atom feed
* patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6
@ 2024-06-24 23:57 luca.boccassi
  2024-06-24 23:57 ` patch 'bus/pci: fix build with musl 1.2.4 / Alpine 3.19' " luca.boccassi
                   ` (79 more replies)
  0 siblings, 80 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:57 UTC (permalink / raw)
  To: Christian Ehrhardt; +Cc: Luca Boccassi, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/9dc3826a4a05b41de3325af68b61cb00599f4e90

Thanks.

Luca Boccassi

---
From 9dc3826a4a05b41de3325af68b61cb00599f4e90 Mon Sep 17 00:00:00 2001
From: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Date: Tue, 28 Nov 2023 15:40:45 +0100
Subject: [PATCH] test: force IOVA mode on PPC64 without huge pages

[ upstream commit 6b07762e949036389030cf5a1a9bb8a1e4d6ee2d ]

On ppc64, without huge pages, pa would be the default but fails like:
  EAL: Cannot use IOVA as 'PA' since physical addresses are not available

On a normal system setup we'd expect an admin to set up huge pages
and for the unlikely case that they do not do that set iova=va themselves.
But the testing infrastructure does not have this conscious
admin that will do that, so fix test execution that by adjusting the
tests arguments accordingly if the conditions are met.

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Acked-by: Luca Boccassi <bluca@debian.org>
---
 app/test/meson.build | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/app/test/meson.build b/app/test/meson.build
index 4e39c9e7cf..eee02cd8ff 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -474,15 +474,21 @@ dpdk_test = executable('dpdk-test',
              driver_install_path),
         install: true)
 
-has_hugepage = run_command(py3, 'has_hugepage.py', check: true).stdout().strip() != '0'
-message('hugepage availability: @0@'.format(has_hugepage))
-
 # some perf tests (eg: memcpy perf autotest)take very long
 # to complete, so timeout to 10 minutes
 timeout_seconds = 600
 timeout_seconds_fast = 10
 
 test_no_huge_args = ['--no-huge', '-m', '2048']
+has_hugepage = run_command(py3, 'has_hugepage.py', check: true).stdout().strip() != '0'
+message('hugepage availability: @0@'.format(has_hugepage))
+if not has_hugepage
+    if arch_subdir == 'ppc'
+        # On ppc64, without huge pages, PA would be the default but fails like:
+        # EAL: Cannot use IOVA as 'PA' since physical addresses are not available
+        test_no_huge_args += '--iova-mode=va'
+    endif
+endif
 
 foreach arg : fast_tests
     test_args = []
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:13.345210209 +0100
+++ 0001-test-force-IOVA-mode-on-PPC64-without-huge-pages.patch	2024-06-25 00:22:13.053182958 +0100
@@ -1 +1 @@
-From 6b07762e949036389030cf5a1a9bb8a1e4d6ee2d Mon Sep 17 00:00:00 2001
+From 9dc3826a4a05b41de3325af68b61cb00599f4e90 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 6b07762e949036389030cf5a1a9bb8a1e4d6ee2d ]
+
@@ -18,2 +20,2 @@
- app/test/suites/meson.build | 7 +++++++
- 1 file changed, 7 insertions(+)
+ app/test/meson.build | 12 +++++++++---
+ 1 file changed, 9 insertions(+), 3 deletions(-)
@@ -21,5 +23,16 @@
-diff --git a/app/test/suites/meson.build b/app/test/suites/meson.build
-index 478f245a54..191702cf76 100644
---- a/app/test/suites/meson.build
-+++ b/app/test/suites/meson.build
-@@ -9,6 +9,13 @@ timeout_seconds_fast = 10
+diff --git a/app/test/meson.build b/app/test/meson.build
+index 4e39c9e7cf..eee02cd8ff 100644
+--- a/app/test/meson.build
++++ b/app/test/meson.build
+@@ -474,15 +474,21 @@ dpdk_test = executable('dpdk-test',
+              driver_install_path),
+         install: true)
+ 
+-has_hugepage = run_command(py3, 'has_hugepage.py', check: true).stdout().strip() != '0'
+-message('hugepage availability: @0@'.format(has_hugepage))
+-
+ # some perf tests (eg: memcpy perf autotest)take very long
+ # to complete, so timeout to 10 minutes
+ timeout_seconds = 600
+ timeout_seconds_fast = 10
+ 
@@ -27,2 +40,2 @@
- has_hugepage = run_command(has_hugepages_cmd, check: true).stdout().strip() != '0'
- message('hugepage availability: @0@'.format(has_hugepage))
++has_hugepage = run_command(py3, 'has_hugepage.py', check: true).stdout().strip() != '0'
++message('hugepage availability: @0@'.format(has_hugepage))
@@ -37,2 +50,2 @@
- # process source files to determine the different unit test suites
- # - fast_tests
+ foreach arg : fast_tests
+     test_args = []

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'bus/pci: fix build with musl 1.2.4 / Alpine 3.19' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
@ 2024-06-24 23:57 ` luca.boccassi
  2024-06-24 23:57 ` patch 'eal/unix: support ZSTD compression for firmware' " luca.boccassi
                   ` (78 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:57 UTC (permalink / raw)
  To: David Marchand
  Cc: Bruce Richardson, Patrick Robb, Thomas Monjalon, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/502049c8b3e997a10a3e77ad87d714ec2df63235

Thanks.

Luca Boccassi

---
From 502049c8b3e997a10a3e77ad87d714ec2df63235 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Mon, 29 Apr 2024 12:00:59 +0200
Subject: [PATCH] bus/pci: fix build with musl 1.2.4 / Alpine 3.19

[ upstream commit 884f83ccf74b5364430d3b21c653d5f6e359e091 ]

Following an upgrade of musl, pread64/pwrite64 wrappers are not provided
anymore. Switch to POSIX pread/pwrite.

Bugzilla ID: 1422

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Patrick Robb <probb@iol.unh.edu>
Tested-by: Thomas Monjalon <thomas@monjalon.net>
---
 drivers/bus/pci/linux/pci_vfio.c | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci_vfio.c
index fe83e1a04e..44c132ae8a 100644
--- a/drivers/bus/pci/linux/pci_vfio.c
+++ b/drivers/bus/pci/linux/pci_vfio.c
@@ -53,7 +53,7 @@ pci_vfio_read_config(const struct rte_intr_handle *intr_handle,
 	if (vfio_dev_fd < 0)
 		return -1;
 
-	return pread64(vfio_dev_fd, buf, len,
+	return pread(vfio_dev_fd, buf, len,
 	       VFIO_GET_REGION_ADDR(VFIO_PCI_CONFIG_REGION_INDEX) + offs);
 }
 
@@ -66,7 +66,7 @@ pci_vfio_write_config(const struct rte_intr_handle *intr_handle,
 	if (vfio_dev_fd < 0)
 		return -1;
 
-	return pwrite64(vfio_dev_fd, buf, len,
+	return pwrite(vfio_dev_fd, buf, len,
 	       VFIO_GET_REGION_ADDR(VFIO_PCI_CONFIG_REGION_INDEX) + offs);
 }
 
@@ -80,7 +80,7 @@ pci_vfio_get_msix_bar(int fd, struct pci_msix_table *msix_table)
 	uint8_t cap_id, cap_offset;
 
 	/* read PCI capability pointer from config space */
-	ret = pread64(fd, &reg, sizeof(reg),
+	ret = pread(fd, &reg, sizeof(reg),
 			VFIO_GET_REGION_ADDR(VFIO_PCI_CONFIG_REGION_INDEX) +
 			PCI_CAPABILITY_LIST);
 	if (ret != sizeof(reg)) {
@@ -95,7 +95,7 @@ pci_vfio_get_msix_bar(int fd, struct pci_msix_table *msix_table)
 	while (cap_offset) {
 
 		/* read PCI capability ID */
-		ret = pread64(fd, &reg, sizeof(reg),
+		ret = pread(fd, &reg, sizeof(reg),
 				VFIO_GET_REGION_ADDR(VFIO_PCI_CONFIG_REGION_INDEX) +
 				cap_offset);
 		if (ret != sizeof(reg)) {
@@ -109,7 +109,7 @@ pci_vfio_get_msix_bar(int fd, struct pci_msix_table *msix_table)
 
 		/* if we haven't reached MSI-X, check next capability */
 		if (cap_id != PCI_CAP_ID_MSIX) {
-			ret = pread64(fd, &reg, sizeof(reg),
+			ret = pread(fd, &reg, sizeof(reg),
 					VFIO_GET_REGION_ADDR(VFIO_PCI_CONFIG_REGION_INDEX) +
 					cap_offset);
 			if (ret != sizeof(reg)) {
@@ -126,7 +126,7 @@ pci_vfio_get_msix_bar(int fd, struct pci_msix_table *msix_table)
 		/* else, read table offset */
 		else {
 			/* table offset resides in the next 4 bytes */
-			ret = pread64(fd, &reg, sizeof(reg),
+			ret = pread(fd, &reg, sizeof(reg),
 					VFIO_GET_REGION_ADDR(VFIO_PCI_CONFIG_REGION_INDEX) +
 					cap_offset + 4);
 			if (ret != sizeof(reg)) {
@@ -135,7 +135,7 @@ pci_vfio_get_msix_bar(int fd, struct pci_msix_table *msix_table)
 				return -1;
 			}
 
-			ret = pread64(fd, &flags, sizeof(flags),
+			ret = pread(fd, &flags, sizeof(flags),
 					VFIO_GET_REGION_ADDR(VFIO_PCI_CONFIG_REGION_INDEX) +
 					cap_offset + 2);
 			if (ret != sizeof(flags)) {
@@ -162,7 +162,7 @@ pci_vfio_enable_bus_memory(int dev_fd)
 	uint16_t cmd;
 	int ret;
 
-	ret = pread64(dev_fd, &cmd, sizeof(cmd),
+	ret = pread(dev_fd, &cmd, sizeof(cmd),
 		      VFIO_GET_REGION_ADDR(VFIO_PCI_CONFIG_REGION_INDEX) +
 		      PCI_COMMAND);
 
@@ -175,7 +175,7 @@ pci_vfio_enable_bus_memory(int dev_fd)
 		return 0;
 
 	cmd |= PCI_COMMAND_MEMORY;
-	ret = pwrite64(dev_fd, &cmd, sizeof(cmd),
+	ret = pwrite(dev_fd, &cmd, sizeof(cmd),
 		       VFIO_GET_REGION_ADDR(VFIO_PCI_CONFIG_REGION_INDEX) +
 		       PCI_COMMAND);
 
@@ -194,7 +194,7 @@ pci_vfio_set_bus_master(int dev_fd, bool op)
 	uint16_t reg;
 	int ret;
 
-	ret = pread64(dev_fd, &reg, sizeof(reg),
+	ret = pread(dev_fd, &reg, sizeof(reg),
 			VFIO_GET_REGION_ADDR(VFIO_PCI_CONFIG_REGION_INDEX) +
 			PCI_COMMAND);
 	if (ret != sizeof(reg)) {
@@ -208,7 +208,7 @@ pci_vfio_set_bus_master(int dev_fd, bool op)
 	else
 		reg &= ~(PCI_COMMAND_MASTER);
 
-	ret = pwrite64(dev_fd, &reg, sizeof(reg),
+	ret = pwrite(dev_fd, &reg, sizeof(reg),
 			VFIO_GET_REGION_ADDR(VFIO_PCI_CONFIG_REGION_INDEX) +
 			PCI_COMMAND);
 
@@ -464,7 +464,7 @@ pci_vfio_is_ioport_bar(int vfio_dev_fd, int bar_index)
 	uint32_t ioport_bar;
 	int ret;
 
-	ret = pread64(vfio_dev_fd, &ioport_bar, sizeof(ioport_bar),
+	ret = pread(vfio_dev_fd, &ioport_bar, sizeof(ioport_bar),
 			  VFIO_GET_REGION_ADDR(VFIO_PCI_CONFIG_REGION_INDEX)
 			  + PCI_BASE_ADDRESS_0 + bar_index*4);
 	if (ret != sizeof(ioport_bar)) {
@@ -1133,7 +1133,7 @@ pci_vfio_ioport_read(struct rte_pci_ioport *p,
 	if (vfio_dev_fd < 0)
 		return;
 
-	if (pread64(vfio_dev_fd, data,
+	if (pread(vfio_dev_fd, data,
 		    len, p->base + offset) <= 0)
 		RTE_LOG(ERR, EAL,
 			"Can't read from PCI bar (%" PRIu64 ") : offset (%x)\n",
@@ -1150,7 +1150,7 @@ pci_vfio_ioport_write(struct rte_pci_ioport *p,
 	if (vfio_dev_fd < 0)
 		return;
 
-	if (pwrite64(vfio_dev_fd, data,
+	if (pwrite(vfio_dev_fd, data,
 		     len, p->base + offset) <= 0)
 		RTE_LOG(ERR, EAL,
 			"Can't write to PCI bar (%" PRIu64 ") : offset (%x)\n",
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:13.380509740 +0100
+++ 0002-bus-pci-fix-build-with-musl-1.2.4-Alpine-3.19.patch	2024-06-25 00:22:13.057183040 +0100
@@ -1 +1 @@
-From 884f83ccf74b5364430d3b21c653d5f6e359e091 Mon Sep 17 00:00:00 2001
+From 502049c8b3e997a10a3e77ad87d714ec2df63235 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 884f83ccf74b5364430d3b21c653d5f6e359e091 ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -17,2 +18,2 @@
- drivers/bus/pci/linux/pci_vfio.c | 18 +++++++++---------
- 1 file changed, 9 insertions(+), 9 deletions(-)
+ drivers/bus/pci/linux/pci_vfio.c | 28 ++++++++++++++--------------
+ 1 file changed, 14 insertions(+), 14 deletions(-)
@@ -21 +22 @@
-index 87c16e6603..05b03a9667 100644
+index fe83e1a04e..44c132ae8a 100644
@@ -24,2 +25,2 @@
-@@ -80,7 +80,7 @@ pci_vfio_read_config(const struct rte_pci_device *dev,
- 	if ((uint64_t)len + offs > size)
+@@ -53,7 +53,7 @@ pci_vfio_read_config(const struct rte_intr_handle *intr_handle,
+ 	if (vfio_dev_fd < 0)
@@ -28,2 +29,3 @@
--	return pread64(fd, buf, len, offset + offs);
-+	return pread(fd, buf, len, offset + offs);
+-	return pread64(vfio_dev_fd, buf, len,
++	return pread(vfio_dev_fd, buf, len,
+ 	       VFIO_GET_REGION_ADDR(VFIO_PCI_CONFIG_REGION_INDEX) + offs);
@@ -32,3 +34,2 @@
- int
-@@ -101,7 +101,7 @@ pci_vfio_write_config(const struct rte_pci_device *dev,
- 	if ((uint64_t)len + offs > size)
+@@ -66,7 +66,7 @@ pci_vfio_write_config(const struct rte_intr_handle *intr_handle,
+ 	if (vfio_dev_fd < 0)
@@ -37,2 +38,3 @@
--	return pwrite64(fd, buf, len, offset + offs);
-+	return pwrite(fd, buf, len, offset + offs);
+-	return pwrite64(vfio_dev_fd, buf, len,
++	return pwrite(vfio_dev_fd, buf, len,
+ 	       VFIO_GET_REGION_ADDR(VFIO_PCI_CONFIG_REGION_INDEX) + offs);
@@ -41,4 +43,2 @@
- /* get PCI BAR number where MSI-X interrupts are */
-@@ -155,7 +155,7 @@ pci_vfio_enable_bus_memory(struct rte_pci_device *dev, int dev_fd)
- 		return -1;
- 	}
+@@ -80,7 +80,7 @@ pci_vfio_get_msix_bar(int fd, struct pci_msix_table *msix_table)
+ 	uint8_t cap_id, cap_offset;
@@ -46,2 +46,50 @@
--	ret = pread64(dev_fd, &cmd, sizeof(cmd), offset + RTE_PCI_COMMAND);
-+	ret = pread(dev_fd, &cmd, sizeof(cmd), offset + RTE_PCI_COMMAND);
+ 	/* read PCI capability pointer from config space */
+-	ret = pread64(fd, &reg, sizeof(reg),
++	ret = pread(fd, &reg, sizeof(reg),
+ 			VFIO_GET_REGION_ADDR(VFIO_PCI_CONFIG_REGION_INDEX) +
+ 			PCI_CAPABILITY_LIST);
+ 	if (ret != sizeof(reg)) {
+@@ -95,7 +95,7 @@ pci_vfio_get_msix_bar(int fd, struct pci_msix_table *msix_table)
+ 	while (cap_offset) {
+ 
+ 		/* read PCI capability ID */
+-		ret = pread64(fd, &reg, sizeof(reg),
++		ret = pread(fd, &reg, sizeof(reg),
+ 				VFIO_GET_REGION_ADDR(VFIO_PCI_CONFIG_REGION_INDEX) +
+ 				cap_offset);
+ 		if (ret != sizeof(reg)) {
+@@ -109,7 +109,7 @@ pci_vfio_get_msix_bar(int fd, struct pci_msix_table *msix_table)
+ 
+ 		/* if we haven't reached MSI-X, check next capability */
+ 		if (cap_id != PCI_CAP_ID_MSIX) {
+-			ret = pread64(fd, &reg, sizeof(reg),
++			ret = pread(fd, &reg, sizeof(reg),
+ 					VFIO_GET_REGION_ADDR(VFIO_PCI_CONFIG_REGION_INDEX) +
+ 					cap_offset);
+ 			if (ret != sizeof(reg)) {
+@@ -126,7 +126,7 @@ pci_vfio_get_msix_bar(int fd, struct pci_msix_table *msix_table)
+ 		/* else, read table offset */
+ 		else {
+ 			/* table offset resides in the next 4 bytes */
+-			ret = pread64(fd, &reg, sizeof(reg),
++			ret = pread(fd, &reg, sizeof(reg),
+ 					VFIO_GET_REGION_ADDR(VFIO_PCI_CONFIG_REGION_INDEX) +
+ 					cap_offset + 4);
+ 			if (ret != sizeof(reg)) {
+@@ -135,7 +135,7 @@ pci_vfio_get_msix_bar(int fd, struct pci_msix_table *msix_table)
+ 				return -1;
+ 			}
+ 
+-			ret = pread64(fd, &flags, sizeof(flags),
++			ret = pread(fd, &flags, sizeof(flags),
+ 					VFIO_GET_REGION_ADDR(VFIO_PCI_CONFIG_REGION_INDEX) +
+ 					cap_offset + 2);
+ 			if (ret != sizeof(flags)) {
+@@ -162,7 +162,7 @@ pci_vfio_enable_bus_memory(int dev_fd)
+ 	uint16_t cmd;
+ 	int ret;
+ 
+-	ret = pread64(dev_fd, &cmd, sizeof(cmd),
++	ret = pread(dev_fd, &cmd, sizeof(cmd),
+ 		      VFIO_GET_REGION_ADDR(VFIO_PCI_CONFIG_REGION_INDEX) +
+ 		      PCI_COMMAND);
@@ -49,3 +97 @@
- 	if (ret != sizeof(cmd)) {
- 		RTE_LOG(ERR, EAL, "Cannot read command from PCI config space!\n");
-@@ -166,7 +166,7 @@ pci_vfio_enable_bus_memory(struct rte_pci_device *dev, int dev_fd)
+@@ -175,7 +175,7 @@ pci_vfio_enable_bus_memory(int dev_fd)
@@ -54,9 +100,27 @@
- 	cmd |= RTE_PCI_COMMAND_MEMORY;
--	ret = pwrite64(dev_fd, &cmd, sizeof(cmd), offset + RTE_PCI_COMMAND);
-+	ret = pwrite(dev_fd, &cmd, sizeof(cmd), offset + RTE_PCI_COMMAND);
- 
- 	if (ret != sizeof(cmd)) {
- 		RTE_LOG(ERR, EAL, "Cannot write command to PCI config space!\n");
-@@ -425,7 +425,7 @@ pci_vfio_is_ioport_bar(const struct rte_pci_device *dev, int vfio_dev_fd,
- 		return -1;
- 	}
+ 	cmd |= PCI_COMMAND_MEMORY;
+-	ret = pwrite64(dev_fd, &cmd, sizeof(cmd),
++	ret = pwrite(dev_fd, &cmd, sizeof(cmd),
+ 		       VFIO_GET_REGION_ADDR(VFIO_PCI_CONFIG_REGION_INDEX) +
+ 		       PCI_COMMAND);
+ 
+@@ -194,7 +194,7 @@ pci_vfio_set_bus_master(int dev_fd, bool op)
+ 	uint16_t reg;
+ 	int ret;
+ 
+-	ret = pread64(dev_fd, &reg, sizeof(reg),
++	ret = pread(dev_fd, &reg, sizeof(reg),
+ 			VFIO_GET_REGION_ADDR(VFIO_PCI_CONFIG_REGION_INDEX) +
+ 			PCI_COMMAND);
+ 	if (ret != sizeof(reg)) {
+@@ -208,7 +208,7 @@ pci_vfio_set_bus_master(int dev_fd, bool op)
+ 	else
+ 		reg &= ~(PCI_COMMAND_MASTER);
+ 
+-	ret = pwrite64(dev_fd, &reg, sizeof(reg),
++	ret = pwrite(dev_fd, &reg, sizeof(reg),
+ 			VFIO_GET_REGION_ADDR(VFIO_PCI_CONFIG_REGION_INDEX) +
+ 			PCI_COMMAND);
+ 
+@@ -464,7 +464,7 @@ pci_vfio_is_ioport_bar(int vfio_dev_fd, int bar_index)
+ 	uint32_t ioport_bar;
+ 	int ret;
@@ -66 +130,2 @@
- 			  offset + RTE_PCI_BASE_ADDRESS_0 + bar_index * 4);
+ 			  VFIO_GET_REGION_ADDR(VFIO_PCI_CONFIG_REGION_INDEX)
+ 			  + PCI_BASE_ADDRESS_0 + bar_index*4);
@@ -68,2 +133 @@
- 		RTE_LOG(ERR, EAL, "Cannot read command (%x) from config space!\n",
-@@ -1276,7 +1276,7 @@ pci_vfio_ioport_read(struct rte_pci_ioport *p,
+@@ -1133,7 +1133,7 @@ pci_vfio_ioport_read(struct rte_pci_ioport *p,
@@ -78 +142 @@
-@@ -1293,7 +1293,7 @@ pci_vfio_ioport_write(struct rte_pci_ioport *p,
+@@ -1150,7 +1150,7 @@ pci_vfio_ioport_write(struct rte_pci_ioport *p,
@@ -87,18 +150,0 @@
-@@ -1324,7 +1324,7 @@ pci_vfio_mmio_read(const struct rte_pci_device *dev, int bar,
- 	if ((uint64_t)len + offs > size)
- 		return -1;
- 
--	return pread64(fd, buf, len, offset + offs);
-+	return pread(fd, buf, len, offset + offs);
- }
- 
- int
-@@ -1344,7 +1344,7 @@ pci_vfio_mmio_write(const struct rte_pci_device *dev, int bar,
- 	if ((uint64_t)len + offs > size)
- 		return -1;
- 
--	return pwrite64(fd, buf, len, offset + offs);
-+	return pwrite(fd, buf, len, offset + offs);
- }
- 
- int

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'eal/unix: support ZSTD compression for firmware' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
  2024-06-24 23:57 ` patch 'bus/pci: fix build with musl 1.2.4 / Alpine 3.19' " luca.boccassi
@ 2024-06-24 23:57 ` luca.boccassi
  2024-06-24 23:57 ` patch 'pcapng: add memcpy check' " luca.boccassi
                   ` (77 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:57 UTC (permalink / raw)
  To: David Marchand; +Cc: Bruce Richardson, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/73c189a0674d34b631241c3757e0a1ec13809c00

Thanks.

Luca Boccassi

---
From 73c189a0674d34b631241c3757e0a1ec13809c00 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Tue, 7 May 2024 13:01:53 +0200
Subject: [PATCH] eal/unix: support ZSTD compression for firmware

[ upstream commit 6f80df8cb0f889203d7cd27766abcc6ebc720e33 ]

Ubuntu 24.04 started to compress firmware files with ZSTD compression.

Bugzilla ID: 1437

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 lib/eal/unix/eal_firmware.c | 23 +++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/lib/eal/unix/eal_firmware.c b/lib/eal/unix/eal_firmware.c
index 1a7cf8e7b7..9fc2f7763a 100644
--- a/lib/eal/unix/eal_firmware.c
+++ b/lib/eal/unix/eal_firmware.c
@@ -15,6 +15,8 @@
 
 #include "eal_firmware.h"
 
+static const char * const compression_suffixes[] = { "xz", "zst" };
+
 #ifdef RTE_HAS_LIBARCHIVE
 
 struct firmware_read_ctx {
@@ -36,7 +38,11 @@ firmware_open(struct firmware_read_ctx *ctx, const char *name, size_t blocksize)
 
 	err = archive_read_support_filter_xz(ctx->a);
 	if (err != ARCHIVE_OK && err != ARCHIVE_WARN)
-		goto error;
+		RTE_LOG(DEBUG, EAL, "could not initialise libarchive for xz compression\n");
+
+	err = archive_read_support_filter_zstd(ctx->a);
+	if (err != ARCHIVE_OK && err != ARCHIVE_WARN)
+		RTE_LOG(DEBUG, EAL, "could not initialise libarchive for zstd compression\n");
 
 	if (archive_read_open_filename(ctx->a, name, blocksize) != ARCHIVE_OK)
 		goto error;
@@ -147,16 +153,21 @@ rte_firmware_read(const char *name, void **buf, size_t *bufsz)
 
 	ret = firmware_read(name, buf, bufsz);
 	if (ret < 0) {
-		snprintf(path, sizeof(path), "%s.xz", name);
-		path[PATH_MAX - 1] = '\0';
+		unsigned int i;
+
+		for (i = 0; i < RTE_DIM(compression_suffixes); i++) {
+			snprintf(path, sizeof(path), "%s.%s", name, compression_suffixes[i]);
+			path[PATH_MAX - 1] = '\0';
+			if (access(path, F_OK) != 0)
+				continue;
 #ifndef RTE_HAS_LIBARCHIVE
-		if (access(path, F_OK) == 0) {
 			RTE_LOG(WARNING, EAL, "libarchive not linked, %s cannot be decompressed\n",
 				path);
-		}
 #else
-		ret = firmware_read(path, buf, bufsz);
+			ret = firmware_read(path, buf, bufsz);
 #endif
+			break;
+		}
 	}
 	return ret;
 }
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:13.416458958 +0100
+++ 0003-eal-unix-support-ZSTD-compression-for-firmware.patch	2024-06-25 00:22:13.061183121 +0100
@@ -1 +1 @@
-From 6f80df8cb0f889203d7cd27766abcc6ebc720e33 Mon Sep 17 00:00:00 2001
+From 73c189a0674d34b631241c3757e0a1ec13809c00 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 6f80df8cb0f889203d7cd27766abcc6ebc720e33 ]
+
@@ -9 +10,0 @@
-Cc: stable@dpdk.org
@@ -18 +19 @@
-index 1d47e879c8..0d69b1e3f0 100644
+index 1a7cf8e7b7..9fc2f7763a 100644
@@ -21 +22,2 @@
-@@ -16,6 +16,8 @@
+@@ -15,6 +15,8 @@
+ 
@@ -23 +24,0 @@
- #include "eal_private.h"
@@ -30 +31 @@
-@@ -37,7 +39,11 @@ firmware_open(struct firmware_read_ctx *ctx, const char *name, size_t blocksize)
+@@ -36,7 +38,11 @@ firmware_open(struct firmware_read_ctx *ctx, const char *name, size_t blocksize)
@@ -35 +36 @@
-+		EAL_LOG(DEBUG, "could not initialise libarchive for xz compression");
++		RTE_LOG(DEBUG, EAL, "could not initialise libarchive for xz compression\n");
@@ -39 +40 @@
-+		EAL_LOG(DEBUG, "could not initialise libarchive for zstd compression");
++		RTE_LOG(DEBUG, EAL, "could not initialise libarchive for zstd compression\n");
@@ -43 +44 @@
-@@ -148,16 +154,21 @@ rte_firmware_read(const char *name, void **buf, size_t *bufsz)
+@@ -147,16 +153,21 @@ rte_firmware_read(const char *name, void **buf, size_t *bufsz)
@@ -58 +59 @@
- 			EAL_LOG(WARNING, "libarchive not linked, %s cannot be decompressed",
+ 			RTE_LOG(WARNING, EAL, "libarchive not linked, %s cannot be decompressed\n",

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'pcapng: add memcpy check' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
  2024-06-24 23:57 ` patch 'bus/pci: fix build with musl 1.2.4 / Alpine 3.19' " luca.boccassi
  2024-06-24 23:57 ` patch 'eal/unix: support ZSTD compression for firmware' " luca.boccassi
@ 2024-06-24 23:57 ` luca.boccassi
  2024-06-24 23:57 ` patch 'net/virtio-user: " luca.boccassi
                   ` (76 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:57 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/461739eed3b49b2106ec8c8074f04daaa00d4a95

Thanks.

Luca Boccassi

---
From 461739eed3b49b2106ec8c8074f04daaa00d4a95 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Mon, 20 May 2024 18:01:03 -0700
Subject: [PATCH] pcapng: add memcpy check

[ upstream commit 06f69f8fdbd218ed7a7d664ee49bd27ee1641cdd ]

When adding option with no data, the rte_pcapng_add_option would
call memcpy with src of NULL and size of zero. This generates a
warning if fortify is enabled.

Bugzilla ID: 1446
Fixes: 8d23ce8f5ee9 ("pcapng: add new library for writing pcapng files")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/pcapng/rte_pcapng.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/pcapng/rte_pcapng.c b/lib/pcapng/rte_pcapng.c
index 80d08e1a3b..d8fd36799b 100644
--- a/lib/pcapng/rte_pcapng.c
+++ b/lib/pcapng/rte_pcapng.c
@@ -110,7 +110,8 @@ pcapng_add_option(struct pcapng_option *popt, uint16_t code,
 {
 	popt->code = code;
 	popt->length = len;
-	memcpy(popt->data, data, len);
+	if (len > 0)
+		memcpy(popt->data, data, len);
 
 	return (struct pcapng_option *)((uint8_t *)popt + pcapng_optlen(len));
 }
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:13.451616314 +0100
+++ 0004-pcapng-add-memcpy-check.patch	2024-06-25 00:22:13.061183121 +0100
@@ -1 +1 @@
-From 06f69f8fdbd218ed7a7d664ee49bd27ee1641cdd Mon Sep 17 00:00:00 2001
+From 461739eed3b49b2106ec8c8074f04daaa00d4a95 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 06f69f8fdbd218ed7a7d664ee49bd27ee1641cdd ]
+
@@ -12 +13,0 @@
-Cc: stable@dpdk.org
@@ -20 +21 @@
-index f74ec939a9..7254defce7 100644
+index 80d08e1a3b..d8fd36799b 100644
@@ -23 +24 @@
-@@ -128,7 +128,8 @@ pcapng_add_option(struct pcapng_option *popt, uint16_t code,
+@@ -110,7 +110,8 @@ pcapng_add_option(struct pcapng_option *popt, uint16_t code,

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/virtio-user: add memcpy check' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (2 preceding siblings ...)
  2024-06-24 23:57 ` patch 'pcapng: add memcpy check' " luca.boccassi
@ 2024-06-24 23:57 ` luca.boccassi
  2024-06-24 23:57 ` patch 'eal/windows: install sched.h file' " luca.boccassi
                   ` (75 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:57 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/7cc8737e523e7d68601dda1fe40aa3205cb0a8b9

Thanks.

Luca Boccassi

---
From 7cc8737e523e7d68601dda1fe40aa3205cb0a8b9 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Mon, 20 May 2024 18:01:04 -0700
Subject: [PATCH] net/virtio-user: add memcpy check

[ upstream commit 0ad961387e94a9ccfc1484a1d742d6f79eda9cd9 ]

If fortify is enabled, it will generate a warning if memcpy
src is NULL even if size is zero. This happens if the MP message
sync is called with no file descriptors.

Bugzilla ID: 1446
Fixes: 6a84c37e3975 ("net/virtio-user: add vhost-user adapter layer")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/virtio/virtio_user/vhost_user.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/virtio/virtio_user/vhost_user.c b/drivers/net/virtio/virtio_user/vhost_user.c
index 3c05ac9cc0..c10252506b 100644
--- a/drivers/net/virtio/virtio_user/vhost_user.c
+++ b/drivers/net/virtio/virtio_user/vhost_user.c
@@ -128,7 +128,8 @@ vhost_user_write(int fd, struct vhost_user_msg *msg, int *fds, int fd_num)
 	cmsg->cmsg_len = CMSG_LEN(fd_size);
 	cmsg->cmsg_level = SOL_SOCKET;
 	cmsg->cmsg_type = SCM_RIGHTS;
-	memcpy(CMSG_DATA(cmsg), fds, fd_size);
+	if (fd_size > 0)
+		memcpy(CMSG_DATA(cmsg), fds, fd_size);
 
 	do {
 		r = sendmsg(fd, &msgh, 0);
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:13.587408350 +0100
+++ 0005-net-virtio-user-add-memcpy-check.patch	2024-06-25 00:22:13.065183203 +0100
@@ -1 +1 @@
-From 0ad961387e94a9ccfc1484a1d742d6f79eda9cd9 Mon Sep 17 00:00:00 2001
+From 7cc8737e523e7d68601dda1fe40aa3205cb0a8b9 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 0ad961387e94a9ccfc1484a1d742d6f79eda9cd9 ]
+
@@ -12 +13,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'eal/windows: install sched.h file' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (3 preceding siblings ...)
  2024-06-24 23:57 ` patch 'net/virtio-user: " luca.boccassi
@ 2024-06-24 23:57 ` luca.boccassi
  2024-06-24 23:57 ` patch 'latencystats: fix literal float suffix' " luca.boccassi
                   ` (74 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:57 UTC (permalink / raw)
  To: Tyler Retzlaff; +Cc: Bruce Richardson, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/9957ef4a31aa489fc58c0a6c0ce79f73a7f62379

Thanks.

Luca Boccassi

---
From 9957ef4a31aa489fc58c0a6c0ce79f73a7f62379 Mon Sep 17 00:00:00 2001
From: Tyler Retzlaff <roretzla@linux.microsoft.com>
Date: Tue, 12 Mar 2024 10:54:37 -0700
Subject: [PATCH] eal/windows: install sched.h file

[ upstream commit ad645a9317bc93c7e4921afa7bf33e1415b531cd ]

rte_os.h includes sched.h so install sched.h to allow DPDK installed to
DESTDIR to be usable.

Fixes: e8428a9d89f1 ("eal/windows: add some basic functions and macros")

Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 lib/eal/windows/include/meson.build | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/eal/windows/include/meson.build b/lib/eal/windows/include/meson.build
index 5fb1962ac7..e985a77d58 100644
--- a/lib/eal/windows/include/meson.build
+++ b/lib/eal/windows/include/meson.build
@@ -6,4 +6,5 @@ includes += include_directories('.')
 headers += files(
         'rte_os.h',
         'rte_windows.h',
+        'sched.h',
 )
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:13.631020404 +0100
+++ 0006-eal-windows-install-sched.h-file.patch	2024-06-25 00:22:13.065183203 +0100
@@ -1 +1 @@
-From ad645a9317bc93c7e4921afa7bf33e1415b531cd Mon Sep 17 00:00:00 2001
+From 9957ef4a31aa489fc58c0a6c0ce79f73a7f62379 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit ad645a9317bc93c7e4921afa7bf33e1415b531cd ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'latencystats: fix literal float suffix' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (4 preceding siblings ...)
  2024-06-24 23:57 ` patch 'eal/windows: install sched.h file' " luca.boccassi
@ 2024-06-24 23:57 ` luca.boccassi
  2024-06-24 23:57 ` patch 'net/nfp: fix representor port queue release' " luca.boccassi
                   ` (73 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:57 UTC (permalink / raw)
  To: Tyler Retzlaff; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/0257b6327a34cb112afbc349468a275aa839875d

Thanks.

Luca Boccassi

---
From 0257b6327a34cb112afbc349468a275aa839875d Mon Sep 17 00:00:00 2001
From: Tyler Retzlaff <roretzla@linux.microsoft.com>
Date: Mon, 15 Apr 2024 14:32:26 -0700
Subject: [PATCH] latencystats: fix literal float suffix

[ upstream commit 792cb874db647e31183ab6680922cd293dd5bfa6 ]

Add missing f suffix to floating point literal to avoid warning about
truncation from double to float.

Fixes: 5cd3cac9ed22 ("latency: added new library for latency stats")

Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 lib/latencystats/rte_latencystats.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/latencystats/rte_latencystats.c b/lib/latencystats/rte_latencystats.c
index 8985a377db..e47eac2cf8 100644
--- a/lib/latencystats/rte_latencystats.c
+++ b/lib/latencystats/rte_latencystats.c
@@ -164,7 +164,7 @@ calc_latency(uint16_t pid __rte_unused,
 	 * a constant smoothing factor between 0 and 1. The value
 	 * is used below for measuring average latency.
 	 */
-	const float alpha = 0.2;
+	const float alpha = 0.2f;
 
 	now = rte_rdtsc();
 	for (i = 0; i < nb_pkts; i++) {
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:13.754169540 +0100
+++ 0007-latencystats-fix-literal-float-suffix.patch	2024-06-25 00:22:13.065183203 +0100
@@ -1 +1 @@
-From 792cb874db647e31183ab6680922cd293dd5bfa6 Mon Sep 17 00:00:00 2001
+From 0257b6327a34cb112afbc349468a275aa839875d Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 792cb874db647e31183ab6680922cd293dd5bfa6 ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -18 +19 @@
-index 4ea9b0d75b..cae4b50878 100644
+index 8985a377db..e47eac2cf8 100644
@@ -21 +22 @@
-@@ -166,7 +166,7 @@ calc_latency(uint16_t pid __rte_unused,
+@@ -164,7 +164,7 @@ calc_latency(uint16_t pid __rte_unused,

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/nfp: fix representor port queue release' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (5 preceding siblings ...)
  2024-06-24 23:57 ` patch 'latencystats: fix literal float suffix' " luca.boccassi
@ 2024-06-24 23:57 ` luca.boccassi
  2024-06-24 23:57 ` patch 'net/bonding: fix failover time of LACP with mode 4' " luca.boccassi
                   ` (72 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:57 UTC (permalink / raw)
  To: Long Wu; +Cc: Chaoyong He, Peng Zhang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/541c30f3d18029161a14c356ba88a5c8d2d16b82

Thanks.

Luca Boccassi

---
From 541c30f3d18029161a14c356ba88a5c8d2d16b82 Mon Sep 17 00:00:00 2001
From: Long Wu <long.wu@corigine.com>
Date: Tue, 19 Mar 2024 15:07:54 +0800
Subject: [PATCH] net/nfp: fix representor port queue release

[ upstream commit 57f62be098be4c95964691183504c77e31797a42 ]

The PF representor port's queue is different from the VF/physical
representor port. So the release process in close port should
be different too.

Fixes: a256a1227dbe ("net/nfp: fix resource leak for exit of flower firmware")

Signed-off-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
---
 .../net/nfp/flower/nfp_flower_representor.c   | 69 ++++++++++++++-----
 1 file changed, 50 insertions(+), 19 deletions(-)

diff --git a/drivers/net/nfp/flower/nfp_flower_representor.c b/drivers/net/nfp/flower/nfp_flower_representor.c
index 4b8b02321c..090c828c18 100644
--- a/drivers/net/nfp/flower/nfp_flower_representor.c
+++ b/drivers/net/nfp/flower/nfp_flower_representor.c
@@ -524,6 +524,54 @@ nfp_flower_repr_tx_burst(void *tx_queue,
 	return sent;
 }
 
+static void
+nfp_flower_repr_free_queue(struct nfp_flower_representor *repr)
+{
+	uint16_t i;
+	struct rte_eth_dev *eth_dev = repr->eth_dev;
+
+	for (i = 0; i < eth_dev->data->nb_tx_queues; i++)
+		rte_free(eth_dev->data->tx_queues[i]);
+
+	for (i = 0; i < eth_dev->data->nb_rx_queues; i++)
+		rte_free(eth_dev->data->rx_queues[i]);
+}
+
+static void
+nfp_flower_pf_repr_close_queue(struct nfp_flower_representor *repr)
+{
+	struct rte_eth_dev *eth_dev = repr->eth_dev;
+
+	/*
+	 * We assume that the DPDK application is stopping all the
+	 * threads/queues before calling the device close function.
+	 */
+	nfp_net_disable_queues(eth_dev);
+
+	/* Clear queues */
+	nfp_net_close_tx_queue(eth_dev);
+	nfp_net_close_rx_queue(eth_dev);
+}
+
+static void
+nfp_flower_repr_close_queue(struct nfp_flower_representor *repr)
+{
+	switch (repr->repr_type) {
+	case NFP_REPR_TYPE_PHYS_PORT:
+		nfp_flower_repr_free_queue(repr);
+		break;
+	case NFP_REPR_TYPE_PF:
+		nfp_flower_pf_repr_close_queue(repr);
+		break;
+	case NFP_REPR_TYPE_VF:
+		nfp_flower_repr_free_queue(repr);
+		break;
+	default:
+		PMD_DRV_LOG(ERR, "Unsupported repr port type.");
+		break;
+	}
+}
+
 static int
 nfp_flower_repr_uninit(struct rte_eth_dev *eth_dev)
 {
@@ -581,8 +629,6 @@ nfp_flower_repr_dev_close(struct rte_eth_dev *dev)
 	uint16_t i;
 	struct nfp_net_hw *hw;
 	struct nfp_pf_dev *pf_dev;
-	struct nfp_net_txq *this_tx_q;
-	struct nfp_net_rxq *this_rx_q;
 	struct nfp_flower_representor *repr;
 	struct nfp_app_fw_flower *app_fw_flower;
 
@@ -594,26 +640,11 @@ nfp_flower_repr_dev_close(struct rte_eth_dev *dev)
 	hw = app_fw_flower->pf_hw;
 	pf_dev = hw->pf_dev;
 
-	/*
-	 * We assume that the DPDK application is stopping all the
-	 * threads/queues before calling the device close function.
-	 */
-	nfp_net_disable_queues(dev);
-
-	/* Clear queues */
-	for (i = 0; i < dev->data->nb_tx_queues; i++) {
-		this_tx_q = dev->data->tx_queues[i];
-		nfp_net_reset_tx_queue(this_tx_q);
-	}
-
-	for (i = 0; i < dev->data->nb_rx_queues; i++) {
-		this_rx_q = dev->data->rx_queues[i];
-		nfp_net_reset_rx_queue(this_rx_q);
-	}
-
 	if (pf_dev->app_fw_id != NFP_APP_FW_FLOWER_NIC)
 		return -EINVAL;
 
+	nfp_flower_repr_close_queue(repr);
+
 	nfp_flower_repr_free(repr, repr->repr_type);
 
 	for (i = 0; i < MAX_FLOWER_VFS; i++) {
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:13.882323625 +0100
+++ 0008-net-nfp-fix-representor-port-queue-release.patch	2024-06-25 00:22:13.069183284 +0100
@@ -1 +1 @@
-From 57f62be098be4c95964691183504c77e31797a42 Mon Sep 17 00:00:00 2001
+From 541c30f3d18029161a14c356ba88a5c8d2d16b82 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 57f62be098be4c95964691183504c77e31797a42 ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org
@@ -21 +22 @@
-index b2c55879ca..d4c3c30682 100644
+index 4b8b02321c..090c828c18 100644
@@ -24 +25 @@
-@@ -305,6 +305,54 @@ nfp_flower_repr_tx_burst(void *tx_queue,
+@@ -524,6 +524,54 @@ nfp_flower_repr_tx_burst(void *tx_queue,
@@ -79 +80 @@
-@@ -362,8 +410,6 @@ nfp_flower_repr_dev_close(struct rte_eth_dev *dev)
+@@ -581,8 +629,6 @@ nfp_flower_repr_dev_close(struct rte_eth_dev *dev)
@@ -88 +89 @@
-@@ -375,26 +421,11 @@ nfp_flower_repr_dev_close(struct rte_eth_dev *dev)
+@@ -594,26 +640,11 @@ nfp_flower_repr_dev_close(struct rte_eth_dev *dev)

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/bonding: fix failover time of LACP with mode 4' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (6 preceding siblings ...)
  2024-06-24 23:57 ` patch 'net/nfp: fix representor port queue release' " luca.boccassi
@ 2024-06-24 23:57 ` luca.boccassi
  2024-06-24 23:57 ` patch 'net/hns3: fix offload flag of IEEE 1588' " luca.boccassi
                   ` (71 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:57 UTC (permalink / raw)
  To: Gaoxiang Liu; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/6282bde96dc3f9d60c67eaaf4a340a20c3347829

Thanks.

Luca Boccassi

---
From 6282bde96dc3f9d60c67eaaf4a340a20c3347829 Mon Sep 17 00:00:00 2001
From: Gaoxiang Liu <liugaoxiang@huawei.com>
Date: Mon, 6 Jun 2022 22:34:45 +0800
Subject: [PATCH] net/bonding: fix failover time of LACP with mode 4

[ upstream commit a78a1ed8ba6ae7666d13fee1895badb8eb2abf5f ]

When the primary port of bond member with bond mode 4 linked down,
the system id of the other member ports changed.
It may cause some switches to renegotiate, and the process takes a few
seconds. It is not acceptable for any Telcos.
We need sub-second switch-over time like in Linux.

Set the MAC of the bond port to the member port's system to solve the
problem.

Bugzilla ID: 551
Fixes: 46fb43683679 ("bond: add mode 4")

Signed-off-by: Gaoxiang Liu <liugaoxiang@huawei.com>
---
 drivers/net/bonding/rte_eth_bond_8023ad.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c
index 928dfca7af..2a81ab5bf3 100644
--- a/drivers/net/bonding/rte_eth_bond_8023ad.c
+++ b/drivers/net/bonding/rte_eth_bond_8023ad.c
@@ -865,7 +865,6 @@ bond_mode_8023ad_periodic_cb(void *arg)
 	struct bond_dev_private *internals = bond_dev->data->dev_private;
 	struct port *port;
 	struct rte_eth_link link_info;
-	struct rte_ether_addr slave_addr;
 	struct rte_mbuf *lacp_pkt = NULL;
 	uint16_t slave_id;
 	uint16_t i;
@@ -892,7 +891,6 @@ bond_mode_8023ad_periodic_cb(void *arg)
 			key = 0;
 		}
 
-		rte_eth_macaddr_get(slave_id, &slave_addr);
 		port = &bond_mode_8023ad_ports[slave_id];
 
 		key = rte_cpu_to_be_16(key);
@@ -904,8 +902,8 @@ bond_mode_8023ad_periodic_cb(void *arg)
 			SM_FLAG_SET(port, NTT);
 		}
 
-		if (!rte_is_same_ether_addr(&port->actor.system, &slave_addr)) {
-			rte_ether_addr_copy(&slave_addr, &port->actor.system);
+		if (!rte_is_same_ether_addr(&internals->mode4.mac_addr, &port->actor.system)) {
+			rte_ether_addr_copy(&internals->mode4.mac_addr, &port->actor.system);
 			if (port->aggregator_port_id == slave_id)
 				SM_FLAG_SET(port, NTT);
 		}
@@ -1171,21 +1169,20 @@ void
 bond_mode_8023ad_mac_address_update(struct rte_eth_dev *bond_dev)
 {
 	struct bond_dev_private *internals = bond_dev->data->dev_private;
-	struct rte_ether_addr slave_addr;
 	struct port *slave, *agg_slave;
 	uint16_t slave_id, i, j;
 
 	bond_mode_8023ad_stop(bond_dev);
 
+	rte_eth_macaddr_get(internals->port_id, &internals->mode4.mac_addr);
 	for (i = 0; i < internals->active_slave_count; i++) {
 		slave_id = internals->active_slaves[i];
 		slave = &bond_mode_8023ad_ports[slave_id];
-		rte_eth_macaddr_get(slave_id, &slave_addr);
 
-		if (rte_is_same_ether_addr(&slave_addr, &slave->actor.system))
+		if (rte_is_same_ether_addr(&internals->mode4.mac_addr, &slave->actor.system))
 			continue;
 
-		rte_ether_addr_copy(&slave_addr, &slave->actor.system);
+		rte_ether_addr_copy(&internals->mode4.mac_addr, &slave->actor.system);
 		/* Do nothing if this port is not an aggregator. In other case
 		 * Set NTT flag on every port that use this aggregator. */
 		if (slave->aggregator_port_id != slave_id)
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:14.010325082 +0100
+++ 0009-net-bonding-fix-failover-time-of-LACP-with-mode-4.patch	2024-06-25 00:22:13.073183366 +0100
@@ -1 +1 @@
-From a78a1ed8ba6ae7666d13fee1895badb8eb2abf5f Mon Sep 17 00:00:00 2001
+From 6282bde96dc3f9d60c67eaaf4a340a20c3347829 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit a78a1ed8ba6ae7666d13fee1895badb8eb2abf5f ]
+
@@ -17 +18,0 @@
-Cc: stable@dpdk.org
@@ -25 +26 @@
-index 79f1b3f1a0..06c21ebe6d 100644
+index 928dfca7af..2a81ab5bf3 100644
@@ -32 +33 @@
--	struct rte_ether_addr member_addr;
+-	struct rte_ether_addr slave_addr;
@@ -34 +35 @@
- 	uint16_t member_id;
+ 	uint16_t slave_id;
@@ -40,2 +41,2 @@
--		rte_eth_macaddr_get(member_id, &member_addr);
- 		port = &bond_mode_8023ad_ports[member_id];
+-		rte_eth_macaddr_get(slave_id, &slave_addr);
+ 		port = &bond_mode_8023ad_ports[slave_id];
@@ -48,2 +49,2 @@
--		if (!rte_is_same_ether_addr(&port->actor.system, &member_addr)) {
--			rte_ether_addr_copy(&member_addr, &port->actor.system);
+-		if (!rte_is_same_ether_addr(&port->actor.system, &slave_addr)) {
+-			rte_ether_addr_copy(&slave_addr, &port->actor.system);
@@ -52 +53 @@
- 			if (port->aggregator_port_id == member_id)
+ 			if (port->aggregator_port_id == slave_id)
@@ -55 +56 @@
-@@ -1173,21 +1171,20 @@ void
+@@ -1171,21 +1169,20 @@ void
@@ -59,3 +60,3 @@
--	struct rte_ether_addr member_addr;
- 	struct port *member, *agg_member;
- 	uint16_t member_id, i, j;
+-	struct rte_ether_addr slave_addr;
+ 	struct port *slave, *agg_slave;
+ 	uint16_t slave_id, i, j;
@@ -66,4 +67,4 @@
- 	for (i = 0; i < internals->active_member_count; i++) {
- 		member_id = internals->active_members[i];
- 		member = &bond_mode_8023ad_ports[member_id];
--		rte_eth_macaddr_get(member_id, &member_addr);
+ 	for (i = 0; i < internals->active_slave_count; i++) {
+ 		slave_id = internals->active_slaves[i];
+ 		slave = &bond_mode_8023ad_ports[slave_id];
+-		rte_eth_macaddr_get(slave_id, &slave_addr);
@@ -71,2 +72,2 @@
--		if (rte_is_same_ether_addr(&member_addr, &member->actor.system))
-+		if (rte_is_same_ether_addr(&internals->mode4.mac_addr, &member->actor.system))
+-		if (rte_is_same_ether_addr(&slave_addr, &slave->actor.system))
++		if (rte_is_same_ether_addr(&internals->mode4.mac_addr, &slave->actor.system))
@@ -75,2 +76,2 @@
--		rte_ether_addr_copy(&member_addr, &member->actor.system);
-+		rte_ether_addr_copy(&internals->mode4.mac_addr, &member->actor.system);
+-		rte_ether_addr_copy(&slave_addr, &slave->actor.system);
++		rte_ether_addr_copy(&internals->mode4.mac_addr, &slave->actor.system);
@@ -79 +80 @@
- 		if (member->aggregator_port_id != member_id)
+ 		if (slave->aggregator_port_id != slave_id)

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/hns3: fix offload flag of IEEE 1588' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (7 preceding siblings ...)
  2024-06-24 23:57 ` patch 'net/bonding: fix failover time of LACP with mode 4' " luca.boccassi
@ 2024-06-24 23:57 ` luca.boccassi
  2024-06-24 23:57 ` patch 'net/hns3: fix Rx timestamp flag' " luca.boccassi
                   ` (70 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:57 UTC (permalink / raw)
  To: Dengdui Huang; +Cc: Jie Hai, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/419ac23f30616787391300ed67909f9b1cad9b32

Thanks.

Luca Boccassi

---
From 419ac23f30616787391300ed67909f9b1cad9b32 Mon Sep 17 00:00:00 2001
From: Dengdui Huang <huangdengdui@huawei.com>
Date: Wed, 3 Apr 2024 18:16:19 +0800
Subject: [PATCH] net/hns3: fix offload flag of IEEE 1588

[ upstream commit bd8f90f0175914bc7df9ef2e9170a850faaa253b ]

Currently, the RTE_MBUF_F_RX_IEEE1588_TMST offload flag will
not be set when the scatter algorithm is used.
This patch fixes it.

Fixes: 4801f0403b58 ("net/hns3: fix IEEE 1588 PTP for scalar scattered Rx")

Signed-off-by: Dengdui Huang <huangdengdui@huawei.com>
Signed-off-by: Jie Hai <haijie1@huawei.com>
---
 drivers/net/hns3/hns3_rxtx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
index bbb3b305d1..b87655c953 100644
--- a/drivers/net/hns3/hns3_rxtx.c
+++ b/drivers/net/hns3/hns3_rxtx.c
@@ -2671,6 +2671,7 @@ hns3_recv_scattered_pkts(void *rx_queue,
 			continue;
 		}
 
+		first_seg->ol_flags = 0;
 		if (unlikely(bd_base_info & BIT(HNS3_RXD_TS_VLD_B)))
 			hns3_rx_ptp_timestamp_handle(rxq, first_seg, timestamp);
 
@@ -2700,7 +2701,7 @@ hns3_recv_scattered_pkts(void *rx_queue,
 
 		first_seg->port = rxq->port_id;
 		first_seg->hash.rss = rte_le_to_cpu_32(rxd.rx.rss_hash);
-		first_seg->ol_flags = RTE_MBUF_F_RX_RSS_HASH;
+		first_seg->ol_flags |= RTE_MBUF_F_RX_RSS_HASH;
 		if (unlikely(bd_base_info & BIT(HNS3_RXD_LUM_B))) {
 			first_seg->hash.fdir.hi =
 				rte_le_to_cpu_16(rxd.rx.fd_id);
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:14.133677285 +0100
+++ 0010-net-hns3-fix-offload-flag-of-IEEE-1588.patch	2024-06-25 00:22:13.077183447 +0100
@@ -1 +1 @@
-From bd8f90f0175914bc7df9ef2e9170a850faaa253b Mon Sep 17 00:00:00 2001
+From 419ac23f30616787391300ed67909f9b1cad9b32 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit bd8f90f0175914bc7df9ef2e9170a850faaa253b ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org
@@ -20 +21 @@
-index 73a388b2fe..e6d277ffad 100644
+index bbb3b305d1..b87655c953 100644
@@ -23 +24 @@
-@@ -2669,6 +2669,7 @@ hns3_recv_scattered_pkts(void *rx_queue,
+@@ -2671,6 +2671,7 @@ hns3_recv_scattered_pkts(void *rx_queue,
@@ -31 +32 @@
-@@ -2698,7 +2699,7 @@ hns3_recv_scattered_pkts(void *rx_queue,
+@@ -2700,7 +2701,7 @@ hns3_recv_scattered_pkts(void *rx_queue,

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/hns3: fix Rx timestamp flag' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (8 preceding siblings ...)
  2024-06-24 23:57 ` patch 'net/hns3: fix offload flag of IEEE 1588' " luca.boccassi
@ 2024-06-24 23:57 ` luca.boccassi
  2024-06-24 23:57 ` patch 'net/hns3: fix double free for Rx/Tx queue' " luca.boccassi
                   ` (69 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:57 UTC (permalink / raw)
  To: Dengdui Huang; +Cc: Jie Hai, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/afd6de50ebd4bd2d41abe98bf0aa2a3c8146bb36

Thanks.

Luca Boccassi

---
From afd6de50ebd4bd2d41abe98bf0aa2a3c8146bb36 Mon Sep 17 00:00:00 2001
From: Dengdui Huang <huangdengdui@huawei.com>
Date: Wed, 3 Apr 2024 18:16:20 +0800
Subject: [PATCH] net/hns3: fix Rx timestamp flag

[ upstream commit e7141041d3aa74ff49b703424f120a6e2c00dcb4 ]

The flag RTE_MBUF_F_RX_IEEE1588_PTP depends on the packet
type and does not need to be set when reading Rx timestamp.

Fixes: 38b539d96eb6 ("net/hns3: support IEEE 1588 PTP")

Signed-off-by: Dengdui Huang <huangdengdui@huawei.com>
Signed-off-by: Jie Hai <haijie1@huawei.com>
---
 drivers/net/hns3/hns3_rxtx.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
index b87655c953..392df0bae5 100644
--- a/drivers/net/hns3/hns3_rxtx.c
+++ b/drivers/net/hns3/hns3_rxtx.c
@@ -2392,8 +2392,7 @@ hns3_rx_ptp_timestamp_handle(struct hns3_rx_queue *rxq, struct rte_mbuf *mbuf,
 {
 	struct hns3_pf *pf = HNS3_DEV_PRIVATE_TO_PF(rxq->hns);
 
-	mbuf->ol_flags |= RTE_MBUF_F_RX_IEEE1588_PTP |
-			  RTE_MBUF_F_RX_IEEE1588_TMST;
+	mbuf->ol_flags |= RTE_MBUF_F_RX_IEEE1588_TMST;
 	if (hns3_timestamp_rx_dynflag > 0) {
 		*RTE_MBUF_DYNFIELD(mbuf, hns3_timestamp_dynfield_offset,
 			rte_mbuf_timestamp_t *) = timestamp;
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:14.211019811 +0100
+++ 0011-net-hns3-fix-Rx-timestamp-flag.patch	2024-06-25 00:22:13.081183529 +0100
@@ -1 +1 @@
-From e7141041d3aa74ff49b703424f120a6e2c00dcb4 Mon Sep 17 00:00:00 2001
+From afd6de50ebd4bd2d41abe98bf0aa2a3c8146bb36 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit e7141041d3aa74ff49b703424f120a6e2c00dcb4 ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -19 +20 @@
-index e6d277ffad..55311402fe 100644
+index b87655c953..392df0bae5 100644
@@ -22 +23 @@
-@@ -2389,8 +2389,7 @@ hns3_rx_ptp_timestamp_handle(struct hns3_rx_queue *rxq, struct rte_mbuf *mbuf,
+@@ -2392,8 +2392,7 @@ hns3_rx_ptp_timestamp_handle(struct hns3_rx_queue *rxq, struct rte_mbuf *mbuf,

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/hns3: fix double free for Rx/Tx queue' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (9 preceding siblings ...)
  2024-06-24 23:57 ` patch 'net/hns3: fix Rx timestamp flag' " luca.boccassi
@ 2024-06-24 23:57 ` luca.boccassi
  2024-06-24 23:57 ` patch 'net/hns3: fix variable overflow' " luca.boccassi
                   ` (68 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:57 UTC (permalink / raw)
  To: Dengdui Huang; +Cc: Jie Hai, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/8ec7b95de7673fe8085ae92aa829a5e71b200211

Thanks.

Luca Boccassi

---
From 8ec7b95de7673fe8085ae92aa829a5e71b200211 Mon Sep 17 00:00:00 2001
From: Dengdui Huang <huangdengdui@huawei.com>
Date: Wed, 3 Apr 2024 18:16:21 +0800
Subject: [PATCH] net/hns3: fix double free for Rx/Tx queue

[ upstream commit bbf6fcc0cc62031a26517608a471873339423d8c ]

The Pointers to some resources on the Rx/Tx queue need to be set to NULL
after free inside the hns3_rx/tx_queue_release(), as this function is
called from multiple threads (reset thread, device config thread, etc),
leading to double memory free error.

Fixes: bba636698316 ("net/hns3: support Rx/Tx and related operations")

Signed-off-by: Dengdui Huang <huangdengdui@huawei.com>
Signed-off-by: Jie Hai <haijie1@huawei.com>
---
 drivers/net/hns3/hns3_rxtx.c | 23 ++++++++++++++++++-----
 1 file changed, 18 insertions(+), 5 deletions(-)

diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
index 392df0bae5..c0479a44dc 100644
--- a/drivers/net/hns3/hns3_rxtx.c
+++ b/drivers/net/hns3/hns3_rxtx.c
@@ -86,9 +86,14 @@ hns3_rx_queue_release(void *queue)
 	struct hns3_rx_queue *rxq = queue;
 	if (rxq) {
 		hns3_rx_queue_release_mbufs(rxq);
-		if (rxq->mz)
+		if (rxq->mz) {
 			rte_memzone_free(rxq->mz);
-		rte_free(rxq->sw_ring);
+			rxq->mz = NULL;
+		}
+		if (rxq->sw_ring) {
+			rte_free(rxq->sw_ring);
+			rxq->sw_ring = NULL;
+		}
 		rte_free(rxq);
 	}
 }
@@ -99,10 +104,18 @@ hns3_tx_queue_release(void *queue)
 	struct hns3_tx_queue *txq = queue;
 	if (txq) {
 		hns3_tx_queue_release_mbufs(txq);
-		if (txq->mz)
+		if (txq->mz) {
 			rte_memzone_free(txq->mz);
-		rte_free(txq->sw_ring);
-		rte_free(txq->free);
+			txq->mz = NULL;
+		}
+		if (txq->sw_ring) {
+			rte_free(txq->sw_ring);
+			txq->sw_ring = NULL;
+		}
+		if (txq->free) {
+			rte_free(txq->free);
+			txq->free = NULL;
+		}
 		rte_free(txq);
 	}
 }
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:14.280983267 +0100
+++ 0012-net-hns3-fix-double-free-for-Rx-Tx-queue.patch	2024-06-25 00:22:13.089183692 +0100
@@ -1 +1 @@
-From bbf6fcc0cc62031a26517608a471873339423d8c Mon Sep 17 00:00:00 2001
+From 8ec7b95de7673fe8085ae92aa829a5e71b200211 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit bbf6fcc0cc62031a26517608a471873339423d8c ]
+
@@ -12 +13,0 @@
-Cc: stable@dpdk.org
@@ -21 +22 @@
-index 55311402fe..bf10da1928 100644
+index 392df0bae5..c0479a44dc 100644

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/hns3: fix variable overflow' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (10 preceding siblings ...)
  2024-06-24 23:57 ` patch 'net/hns3: fix double free for Rx/Tx queue' " luca.boccassi
@ 2024-06-24 23:57 ` luca.boccassi
  2024-06-24 23:58 ` patch 'net/hns3: disable SCTP verification tag for RSS hash input' " luca.boccassi
                   ` (67 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:57 UTC (permalink / raw)
  To: Dengdui Huang; +Cc: Jie Hai, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/f8aabaa13ad5f0ebd8aca476d5500153aeb9faa0

Thanks.

Luca Boccassi

---
From f8aabaa13ad5f0ebd8aca476d5500153aeb9faa0 Mon Sep 17 00:00:00 2001
From: Dengdui Huang <huangdengdui@huawei.com>
Date: Wed, 3 Apr 2024 18:16:22 +0800
Subject: [PATCH] net/hns3: fix variable overflow

[ upstream commit d7a0698ce704852cfb3b3b541107477d9b4bd2fd ]

The function strtoul() returns an unsigned long, which should
be received using the variable uint64_t.

Fixes: 2fc3e696a7f1 ("net/hns3: add runtime config for mailbox limit time")

Signed-off-by: Dengdui Huang <huangdengdui@huawei.com>
Signed-off-by: Jie Hai <haijie1@huawei.com>
---
 drivers/net/hns3/hns3_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/hns3/hns3_common.c b/drivers/net/hns3/hns3_common.c
index 119c930b1a..c51af055d3 100644
--- a/drivers/net/hns3/hns3_common.c
+++ b/drivers/net/hns3/hns3_common.c
@@ -219,7 +219,7 @@ hns3_parse_dev_caps_mask(const char *key, const char *value, void *extra_args)
 static int
 hns3_parse_mbx_time_limit(const char *key, const char *value, void *extra_args)
 {
-	uint32_t val;
+	uint64_t val;
 
 	RTE_SET_USED(key);
 
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:14.349150622 +0100
+++ 0013-net-hns3-fix-variable-overflow.patch	2024-06-25 00:22:13.089183692 +0100
@@ -1 +1 @@
-From d7a0698ce704852cfb3b3b541107477d9b4bd2fd Mon Sep 17 00:00:00 2001
+From f8aabaa13ad5f0ebd8aca476d5500153aeb9faa0 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit d7a0698ce704852cfb3b3b541107477d9b4bd2fd ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -19 +20 @@
-index 28c26b049c..5e6cdfdaa0 100644
+index 119c930b1a..c51af055d3 100644
@@ -22 +23 @@
-@@ -224,7 +224,7 @@ hns3_parse_dev_caps_mask(const char *key, const char *value, void *extra_args)
+@@ -219,7 +219,7 @@ hns3_parse_dev_caps_mask(const char *key, const char *value, void *extra_args)

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/hns3: disable SCTP verification tag for RSS hash input' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (11 preceding siblings ...)
  2024-06-24 23:57 ` patch 'net/hns3: fix variable overflow' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'net/af_packet: align Rx/Tx structs to cache line' " luca.boccassi
                   ` (66 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Jie Hai; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/ac72e810412dc6e55ff861377573e9f3e090ba04

Thanks.

Luca Boccassi

---
From ac72e810412dc6e55ff861377573e9f3e090ba04 Mon Sep 17 00:00:00 2001
From: Jie Hai <haijie1@huawei.com>
Date: Wed, 3 Apr 2024 18:16:23 +0800
Subject: [PATCH] net/hns3: disable SCTP verification tag for RSS hash input

[ upstream commit bb1f4717636f5b7d27f4f2fe30469b69d8910bd0 ]

When the symmetric RSS algorithm is used, the same packet is
expected to be hashed to the same queue in the upstream and
downstream directions.

The problem is that it could map the packets in the same SCTP
connection to different NIC RX queues depending on the direction
of packets. This is because the verification Tag is used as the
RSS hash input for the SCTP packets, and the value depends on the
peer end of the SCTP connection and could not be symmetrically
used in the hardware-implemented RSS algorithm.

In addition, the ethdev framework doesn't support setting SCTP
V-tag as the RSS hash input. So disable it for all RSS hash
algorithms.

Signed-off-by: Jie Hai <haijie1@huawei.com>
---
 drivers/net/hns3/hns3_rss.c | 6 ++----
 drivers/net/hns3/hns3_rss.h | 6 ++----
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/net/hns3/hns3_rss.c b/drivers/net/hns3/hns3_rss.c
index eeeca71a5c..ac88ca04ce 100644
--- a/drivers/net/hns3/hns3_rss.c
+++ b/drivers/net/hns3/hns3_rss.c
@@ -153,8 +153,7 @@ static const struct {
 	  BIT_ULL(HNS3_RSS_FIELD_IPV4_SCTP_EN_IP_S) |
 	  BIT_ULL(HNS3_RSS_FIELD_IPV4_SCTP_EN_IP_D) |
 	  BIT_ULL(HNS3_RSS_FIELD_IPV4_SCTP_EN_SCTP_S) |
-	  BIT_ULL(HNS3_RSS_FIELD_IPV4_SCTP_EN_SCTP_D) |
-	  BIT_ULL(HNS3_RSS_FIELD_IPV4_SCTP_EN_SCTP_VER),
+	  BIT_ULL(HNS3_RSS_FIELD_IPV4_SCTP_EN_SCTP_D),
 	  HNS3_RSS_TUPLE_IPV4_SCTP_M },
 
 	/* IPV6-FRAG */
@@ -274,8 +273,7 @@ static const struct {
 	  BIT_ULL(HNS3_RSS_FIELD_IPV6_SCTP_EN_IP_S) |
 	  BIT_ULL(HNS3_RSS_FIELD_IPV6_SCTP_EN_IP_D) |
 	  BIT_ULL(HNS3_RSS_FIELD_IPV6_SCTP_EN_SCTP_D) |
-	  BIT_ULL(HNS3_RSS_FIELD_IPV6_SCTP_EN_SCTP_S) |
-	  BIT_ULL(HNS3_RSS_FIELD_IPV6_SCTP_EN_SCTP_VER),
+	  BIT_ULL(HNS3_RSS_FIELD_IPV6_SCTP_EN_SCTP_S),
 	  HNS3_RSS_TUPLE_IPV6_SCTP_M },
 };
 
diff --git a/drivers/net/hns3/hns3_rss.h b/drivers/net/hns3/hns3_rss.h
index 9d182a8025..0755760b45 100644
--- a/drivers/net/hns3/hns3_rss.h
+++ b/drivers/net/hns3/hns3_rss.h
@@ -49,7 +49,6 @@ enum hns3_tuple_field {
 	HNS3_RSS_FIELD_IPV4_SCTP_EN_SCTP_S,
 	HNS3_RSS_FIELD_IPV4_SCTP_EN_IP_D,
 	HNS3_RSS_FIELD_IPV4_SCTP_EN_IP_S,
-	HNS3_RSS_FIELD_IPV4_SCTP_EN_SCTP_VER,
 
 	/* IPV4 ENABLE FIELD */
 	HNS3_RSS_FIELD_IPV4_EN_NONFRAG_IP_D = 24,
@@ -74,7 +73,6 @@ enum hns3_tuple_field {
 	HNS3_RSS_FIELD_IPV6_SCTP_EN_SCTP_S,
 	HNS3_RSS_FIELD_IPV6_SCTP_EN_IP_D,
 	HNS3_RSS_FIELD_IPV6_SCTP_EN_IP_S,
-	HNS3_RSS_FIELD_IPV6_SCTP_EN_SCTP_VER,
 
 	/* IPV6 ENABLE FIELD */
 	HNS3_RSS_FIELD_IPV6_NONFRAG_IP_D = 56,
@@ -96,12 +94,12 @@ enum hns3_tuple_field {
 
 #define HNS3_RSS_TUPLE_IPV4_TCP_M	GENMASK(3, 0)
 #define HNS3_RSS_TUPLE_IPV4_UDP_M	GENMASK(11, 8)
-#define HNS3_RSS_TUPLE_IPV4_SCTP_M	GENMASK(20, 16)
+#define HNS3_RSS_TUPLE_IPV4_SCTP_M	GENMASK(19, 16)
 #define HNS3_RSS_TUPLE_IPV4_NONF_M	GENMASK(25, 24)
 #define HNS3_RSS_TUPLE_IPV4_FLAG_M	GENMASK(27, 26)
 #define HNS3_RSS_TUPLE_IPV6_TCP_M	GENMASK(35, 32)
 #define HNS3_RSS_TUPLE_IPV6_UDP_M	GENMASK(43, 40)
-#define HNS3_RSS_TUPLE_IPV6_SCTP_M	GENMASK(52, 48)
+#define HNS3_RSS_TUPLE_IPV6_SCTP_M	GENMASK(51, 48)
 #define HNS3_RSS_TUPLE_IPV6_NONF_M	GENMASK(57, 56)
 #define HNS3_RSS_TUPLE_IPV6_FLAG_M	GENMASK(59, 58)
 
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:14.411982104 +0100
+++ 0014-net-hns3-disable-SCTP-verification-tag-for-RSS-hash-.patch	2024-06-25 00:22:13.089183692 +0100
@@ -1 +1 @@
-From bb1f4717636f5b7d27f4f2fe30469b69d8910bd0 Mon Sep 17 00:00:00 2001
+From ac72e810412dc6e55ff861377573e9f3e090ba04 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit bb1f4717636f5b7d27f4f2fe30469b69d8910bd0 ]
+
@@ -21,2 +22,0 @@
-Cc: stable@dpdk.org
-
@@ -30 +30 @@
-index 15feb26043..3eae4caf52 100644
+index eeeca71a5c..ac88ca04ce 100644

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/af_packet: align Rx/Tx structs to cache line' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (12 preceding siblings ...)
  2024-06-24 23:58 ` patch 'net/hns3: disable SCTP verification tag for RSS hash input' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'doc: fix testpmd ring size command' " luca.boccassi
                   ` (65 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Mattias Rönnblom
  Cc: Morten Brørup, Stephen Hemminger, Tyler Retzlaff, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/a7e4b44736fb43bf7a6d228df2fe7b6ca4ea7f36

Thanks.

Luca Boccassi

---
From a7e4b44736fb43bf7a6d228df2fe7b6ca4ea7f36 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mattias=20R=C3=B6nnblom?= <mattias.ronnblom@ericsson.com>
Date: Fri, 26 Apr 2024 11:05:02 +0200
Subject: [PATCH] net/af_packet: align Rx/Tx structs to cache line
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit c7a2ce0c1b1bb526304f8875f68cab78f5a5d42c ]

Cache align Rx and Tx queue struct to avoid false sharing.

The RX struct happens to be 64 bytes on x86_64 already, so cache
alignment has no effect there, but it does on 32-bit ISAs.

The TX struct is 56 bytes on x86_64.

Both structs keep counters, and in the RX case they are updated even
for empty polls.

Fixes: 364e08f2bbc0 ("af_packet: add PMD for AF_PACKET-based virtual devices")

Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
Reviewed-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 drivers/net/af_packet/rte_eth_af_packet.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c
index 397a32db58..6b7b16f348 100644
--- a/drivers/net/af_packet/rte_eth_af_packet.c
+++ b/drivers/net/af_packet/rte_eth_af_packet.c
@@ -6,6 +6,7 @@
  * All rights reserved.
  */
 
+#include <rte_common.h>
 #include <rte_string_fns.h>
 #include <rte_mbuf.h>
 #include <ethdev_driver.h>
@@ -39,7 +40,7 @@
 #define DFLT_FRAME_SIZE		(1 << 11)
 #define DFLT_FRAME_COUNT	(1 << 9)
 
-struct pkt_rx_queue {
+struct __rte_cache_aligned pkt_rx_queue {
 	int sockfd;
 
 	struct iovec *rd;
@@ -55,7 +56,7 @@ struct pkt_rx_queue {
 	volatile unsigned long rx_bytes;
 };
 
-struct pkt_tx_queue {
+struct __rte_cache_aligned pkt_tx_queue {
 	int sockfd;
 	unsigned int frame_data_size;
 
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:14.475409131 +0100
+++ 0015-net-af_packet-align-Rx-Tx-structs-to-cache-line.patch	2024-06-25 00:22:13.093183774 +0100
@@ -1 +1 @@
-From c7a2ce0c1b1bb526304f8875f68cab78f5a5d42c Mon Sep 17 00:00:00 2001
+From a7e4b44736fb43bf7a6d228df2fe7b6ca4ea7f36 Mon Sep 17 00:00:00 2001
@@ -8,0 +9,2 @@
+[ upstream commit c7a2ce0c1b1bb526304f8875f68cab78f5a5d42c ]
+
@@ -20 +21,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'doc: fix testpmd ring size command' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (13 preceding siblings ...)
  2024-06-24 23:58 ` patch 'net/af_packet: align Rx/Tx structs to cache line' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'net/af_xdp: fix port ID in Rx mbuf' " luca.boccassi
                   ` (64 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Kevin Traynor; +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/d00a311cfb26068fb30f44040f1e8430735d39d3

Thanks.

Luca Boccassi

---
From d00a311cfb26068fb30f44040f1e8430735d39d3 Mon Sep 17 00:00:00 2001
From: Kevin Traynor <ktraynor@redhat.com>
Date: Fri, 3 May 2024 09:51:29 +0100
Subject: [PATCH] doc: fix testpmd ring size command

[ upstream commit 7a30ea42fb6ef979768d39fc4e1dec7e2d9efe0d ]

The documentation is missing the 'config' word.

In app, 'help ports' shows the correct syntax:

port config (port_id) (rxq|txq) (queue_id) ring_size (value)

Fixes: 1a77cffa8143 ("app/testpmd: enable queue ring size configure")

Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 doc/guides/testpmd_app_ug/testpmd_funcs.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index 0037506a79..8e7d4f1b86 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -1995,7 +1995,7 @@ port config - queue ring size
 
 Configure a rx/tx queue ring size::
 
-   testpmd> port (port_id) (rxq|txq) (queue_id) ring_size (value)
+   testpmd> port config (port_id) (rxq|txq) (queue_id) ring_size (value)
 
 Only take effect after command that (re-)start the port or command that setup specific queue.
 
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:14.539608971 +0100
+++ 0016-doc-fix-testpmd-ring-size-command.patch	2024-06-25 00:22:13.097183855 +0100
@@ -1 +1 @@
-From 7a30ea42fb6ef979768d39fc4e1dec7e2d9efe0d Mon Sep 17 00:00:00 2001
+From d00a311cfb26068fb30f44040f1e8430735d39d3 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 7a30ea42fb6ef979768d39fc4e1dec7e2d9efe0d ]
+
@@ -13 +14,0 @@
-Cc: stable@dpdk.org
@@ -22 +23 @@
-index 2fbf9220d8..ecd040504e 100644
+index 0037506a79..8e7d4f1b86 100644
@@ -25 +26 @@
-@@ -2032,7 +2032,7 @@ port config - queue ring size
+@@ -1995,7 +1995,7 @@ port config - queue ring size

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/af_xdp: fix port ID in Rx mbuf' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (14 preceding siblings ...)
  2024-06-24 23:58 ` patch 'doc: fix testpmd ring size command' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'net/af_xdp: count mbuf allocation failures' " luca.boccassi
                   ` (63 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Ciara Loftus; +Cc: Stephen Hemminger, Maryam Tahhan, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/20c39f6a1b472578edc5595d472c4e5416a584eb

Thanks.

Luca Boccassi

---
From 20c39f6a1b472578edc5595d472c4e5416a584eb Mon Sep 17 00:00:00 2001
From: Ciara Loftus <ciara.loftus@intel.com>
Date: Tue, 14 May 2024 08:41:52 +0000
Subject: [PATCH] net/af_xdp: fix port ID in Rx mbuf

[ upstream commit 9bab1d2667aec4942ae1d384671e5148960bd88f ]

Record the port id in the af_xdp rx queue structure and use it
to set the port id of the mbuf of a received packed.

Bugzilla ID: 1428
Fixes: f1debd77efaf ("net/af_xdp: introduce AF_XDP PMD")

Reported-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
Acked-by: Maryam Tahhan <mtahhan@redhat.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/af_xdp/rte_eth_af_xdp.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c
index 3c976dd6e0..b28418234d 100644
--- a/drivers/net/af_xdp/rte_eth_af_xdp.c
+++ b/drivers/net/af_xdp/rte_eth_af_xdp.c
@@ -112,6 +112,7 @@ struct pkt_rx_queue {
 	struct xsk_umem_info *umem;
 	struct xsk_socket *xsk;
 	struct rte_mempool *mb_pool;
+	uint16_t port;
 
 	struct rx_stats stats;
 
@@ -338,6 +339,7 @@ af_xdp_rx_zc(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 		bufs[i]->data_off = offset - sizeof(struct rte_mbuf) -
 			rte_pktmbuf_priv_size(umem->mb_pool) -
 			umem->mb_pool->header_size;
+		bufs[i]->port = rxq->port;
 
 		rte_pktmbuf_pkt_len(bufs[i]) = len;
 		rte_pktmbuf_data_len(bufs[i]) = len;
@@ -404,6 +406,7 @@ af_xdp_rx_cp(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 		rte_pktmbuf_data_len(mbufs[i]) = len;
 		rx_bytes += len;
 		bufs[i] = mbufs[i];
+		bufs[i]->port = rxq->port;
 	}
 
 	xsk_ring_cons__release(rx, nb_pkts);
@@ -1495,6 +1498,8 @@ eth_rx_queue_setup(struct rte_eth_dev *dev,
 
 	process_private->rxq_xsk_fds[rx_queue_id] = rxq->fds[0].fd;
 
+	rxq->port = dev->data->port_id;
+
 	dev->data->rx_queues[rx_queue_id] = rxq;
 	return 0;
 
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:14.610814298 +0100
+++ 0017-net-af_xdp-fix-port-ID-in-Rx-mbuf.patch	2024-06-25 00:22:13.097183855 +0100
@@ -1 +1 @@
-From 9bab1d2667aec4942ae1d384671e5148960bd88f Mon Sep 17 00:00:00 2001
+From 20c39f6a1b472578edc5595d472c4e5416a584eb Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 9bab1d2667aec4942ae1d384671e5148960bd88f ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org
@@ -22 +23 @@
-index 2d6f64337e..0997543ee5 100644
+index 3c976dd6e0..b28418234d 100644
@@ -25 +26 @@
-@@ -133,6 +133,7 @@ struct pkt_rx_queue {
+@@ -112,6 +112,7 @@ struct pkt_rx_queue {
@@ -33 +34 @@
-@@ -368,6 +369,7 @@ af_xdp_rx_zc(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
+@@ -338,6 +339,7 @@ af_xdp_rx_zc(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
@@ -41 +42 @@
-@@ -434,6 +436,7 @@ af_xdp_rx_cp(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
+@@ -404,6 +406,7 @@ af_xdp_rx_cp(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
@@ -49 +50 @@
-@@ -1813,6 +1816,8 @@ eth_rx_queue_setup(struct rte_eth_dev *dev,
+@@ -1495,6 +1498,8 @@ eth_rx_queue_setup(struct rte_eth_dev *dev,

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/af_xdp: count mbuf allocation failures' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (15 preceding siblings ...)
  2024-06-24 23:58 ` patch 'net/af_xdp: fix port ID in Rx mbuf' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'net/af_xdp: fix stats reset' " luca.boccassi
                   ` (62 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Ciara Loftus; +Cc: Stephen Hemminger, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/13ac24282065220a4c3dbed9cc961a6a9b728421

Thanks.

Luca Boccassi

---
From 13ac24282065220a4c3dbed9cc961a6a9b728421 Mon Sep 17 00:00:00 2001
From: Ciara Loftus <ciara.loftus@intel.com>
Date: Tue, 14 May 2024 08:41:53 +0000
Subject: [PATCH] net/af_xdp: count mbuf allocation failures

[ upstream commit f294405ab98594aa41269507dde95cc89bb20a61 ]

Failures to allocate mbufs in the receive path were not being
accounted for in the ethdev statistics. Fix this.

Bugzilla ID: 1429
Fixes: f1debd77efaf ("net/af_xdp: introduce AF_XDP PMD")

Reported-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/af_xdp/rte_eth_af_xdp.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c
index b28418234d..544ce40693 100644
--- a/drivers/net/af_xdp/rte_eth_af_xdp.c
+++ b/drivers/net/af_xdp/rte_eth_af_xdp.c
@@ -290,6 +290,7 @@ af_xdp_rx_zc(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 	unsigned long rx_bytes = 0;
 	int i;
 	struct rte_mbuf *fq_bufs[ETH_AF_XDP_RX_BATCH_SIZE];
+	struct rte_eth_dev *dev = &rte_eth_devices[rxq->port];
 
 	nb_pkts = xsk_ring_cons__peek(rx, nb_pkts, &idx_rx);
 
@@ -317,6 +318,8 @@ af_xdp_rx_zc(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 		 * xsk_ring_cons__peek
 		 */
 		rx->cached_cons -= nb_pkts;
+		dev->data->rx_mbuf_alloc_failed += nb_pkts;
+
 		return 0;
 	}
 
@@ -368,6 +371,7 @@ af_xdp_rx_cp(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 	int i;
 	uint32_t free_thresh = fq->size >> 1;
 	struct rte_mbuf *mbufs[ETH_AF_XDP_RX_BATCH_SIZE];
+	struct rte_eth_dev *dev = &rte_eth_devices[rxq->port];
 
 	if (xsk_prod_nb_free(fq, free_thresh) >= free_thresh)
 		(void)reserve_fill_queue(umem, nb_pkts, NULL, fq);
@@ -386,6 +390,7 @@ af_xdp_rx_cp(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 		 * xsk_ring_cons__peek
 		 */
 		rx->cached_cons -= nb_pkts;
+		dev->data->rx_mbuf_alloc_failed += nb_pkts;
 		return 0;
 	}
 
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:14.676720415 +0100
+++ 0018-net-af_xdp-count-mbuf-allocation-failures.patch	2024-06-25 00:22:13.101183937 +0100
@@ -1 +1 @@
-From f294405ab98594aa41269507dde95cc89bb20a61 Mon Sep 17 00:00:00 2001
+From 13ac24282065220a4c3dbed9cc961a6a9b728421 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit f294405ab98594aa41269507dde95cc89bb20a61 ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org
@@ -21 +22 @@
-index 0997543ee5..0db761a204 100644
+index b28418234d..544ce40693 100644
@@ -24 +25 @@
-@@ -320,6 +320,7 @@ af_xdp_rx_zc(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
+@@ -290,6 +290,7 @@ af_xdp_rx_zc(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
@@ -32 +33 @@
-@@ -347,6 +348,8 @@ af_xdp_rx_zc(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
+@@ -317,6 +318,8 @@ af_xdp_rx_zc(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
@@ -41 +42 @@
-@@ -398,6 +401,7 @@ af_xdp_rx_cp(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
+@@ -368,6 +371,7 @@ af_xdp_rx_cp(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
@@ -49 +50 @@
-@@ -416,6 +420,7 @@ af_xdp_rx_cp(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
+@@ -386,6 +390,7 @@ af_xdp_rx_cp(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/af_xdp: fix stats reset' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (16 preceding siblings ...)
  2024-06-24 23:58 ` patch 'net/af_xdp: count mbuf allocation failures' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'net/af_xdp: remove unused local statistic' " luca.boccassi
                   ` (61 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Ciara Loftus; +Cc: Stephen Hemminger, Maryam Tahhan, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/9e8bcd1f55c9ccde6ffcb82591538ea8230a96d5

Thanks.

Luca Boccassi

---
From 9e8bcd1f55c9ccde6ffcb82591538ea8230a96d5 Mon Sep 17 00:00:00 2001
From: Ciara Loftus <ciara.loftus@intel.com>
Date: Tue, 14 May 2024 08:41:54 +0000
Subject: [PATCH] net/af_xdp: fix stats reset

[ upstream commit 3577b1ee97dcfe9ff1b9e050bed55f17c435a93d ]

The imissed statistic was not properly reset because it was
read directly from the kernel statistics. To fix this, take note
of the kernel statistic when the stats are reset and deduct this
value from the kernel statistic read during statistics get.

Bugzilla ID: 1430
Fixes: f1debd77efaf ("net/af_xdp: introduce AF_XDP PMD")

Reported-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
Acked-by: Maryam Tahhan <mtahhan@redhat.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/af_xdp/rte_eth_af_xdp.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c
index 544ce40693..df6ac7a4f2 100644
--- a/drivers/net/af_xdp/rte_eth_af_xdp.c
+++ b/drivers/net/af_xdp/rte_eth_af_xdp.c
@@ -105,6 +105,7 @@ struct rx_stats {
 	uint64_t rx_pkts;
 	uint64_t rx_bytes;
 	uint64_t rx_dropped;
+	uint64_t imissed_offset;
 };
 
 struct pkt_rx_queue {
@@ -862,7 +863,7 @@ eth_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 			AF_XDP_LOG(ERR, "getsockopt() failed for XDP_STATISTICS.\n");
 			return -1;
 		}
-		stats->imissed += xdp_stats.rx_dropped;
+		stats->imissed += xdp_stats.rx_dropped - rxq->stats.imissed_offset;
 
 		stats->opackets += stats->q_opackets[i];
 		stats->obytes += stats->q_obytes[i];
@@ -875,13 +876,25 @@ static int
 eth_stats_reset(struct rte_eth_dev *dev)
 {
 	struct pmd_internals *internals = dev->data->dev_private;
-	int i;
+	struct pmd_process_private *process_private = dev->process_private;
+	struct xdp_statistics xdp_stats;
+	socklen_t optlen;
+	int i, ret, fd;
 
 	for (i = 0; i < internals->queue_cnt; i++) {
 		memset(&internals->rx_queues[i].stats, 0,
 					sizeof(struct rx_stats));
 		memset(&internals->tx_queues[i].stats, 0,
 					sizeof(struct tx_stats));
+		fd = process_private->rxq_xsk_fds[i];
+		optlen = sizeof(struct xdp_statistics);
+		ret = fd >= 0 ? getsockopt(fd, SOL_XDP, XDP_STATISTICS,
+					   &xdp_stats, &optlen) : -1;
+		if (ret != 0) {
+			AF_XDP_LOG(ERR, "getsockopt() failed for XDP_STATISTICS.\n");
+			return -1;
+		}
+		internals->rx_queues[i].stats.imissed_offset = xdp_stats.rx_dropped;
 	}
 
 	return 0;
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:14.742605431 +0100
+++ 0019-net-af_xdp-fix-stats-reset.patch	2024-06-25 00:22:13.101183937 +0100
@@ -1 +1 @@
-From 3577b1ee97dcfe9ff1b9e050bed55f17c435a93d Mon Sep 17 00:00:00 2001
+From 9e8bcd1f55c9ccde6ffcb82591538ea8230a96d5 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 3577b1ee97dcfe9ff1b9e050bed55f17c435a93d ]
+
@@ -13 +14,0 @@
-Cc: stable@dpdk.org
@@ -24 +25 @@
-index 0db761a204..25e67851f6 100644
+index 544ce40693..df6ac7a4f2 100644
@@ -27 +28 @@
-@@ -126,6 +126,7 @@ struct rx_stats {
+@@ -105,6 +105,7 @@ struct rx_stats {
@@ -35 +36 @@
-@@ -892,7 +893,7 @@ eth_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
+@@ -862,7 +863,7 @@ eth_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
@@ -44 +45 @@
-@@ -905,13 +906,25 @@ static int
+@@ -875,13 +876,25 @@ static int

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/af_xdp: remove unused local statistic' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (17 preceding siblings ...)
  2024-06-24 23:58 ` patch 'net/af_xdp: fix stats reset' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'net/tap: fix file descriptor check in isolated flow' " luca.boccassi
                   ` (60 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Ciara Loftus; +Cc: Stephen Hemminger, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/19c6df9ce8fdb63c39c779b4adbd3b0bb5a90b3f

Thanks.

Luca Boccassi

---
From 19c6df9ce8fdb63c39c779b4adbd3b0bb5a90b3f Mon Sep 17 00:00:00 2001
From: Ciara Loftus <ciara.loftus@intel.com>
Date: Tue, 14 May 2024 08:41:55 +0000
Subject: [PATCH] net/af_xdp: remove unused local statistic

[ upstream commit abdabad636a54660f4a260e1e9dc573900582bd4 ]

The rx_dropped statistic is never incremented so its existence
is pointless. Remove it.

Fixes: f1debd77efaf ("net/af_xdp: introduce AF_XDP PMD")

Reported-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/af_xdp/rte_eth_af_xdp.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c
index df6ac7a4f2..343b4c40c9 100644
--- a/drivers/net/af_xdp/rte_eth_af_xdp.c
+++ b/drivers/net/af_xdp/rte_eth_af_xdp.c
@@ -104,7 +104,6 @@ struct xsk_umem_info {
 struct rx_stats {
 	uint64_t rx_pkts;
 	uint64_t rx_bytes;
-	uint64_t rx_dropped;
 	uint64_t imissed_offset;
 };
 
@@ -854,7 +853,6 @@ eth_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 
 		stats->ipackets += stats->q_ipackets[i];
 		stats->ibytes += stats->q_ibytes[i];
-		stats->imissed += rxq->stats.rx_dropped;
 		stats->oerrors += txq->stats.tx_dropped;
 		fd = process_private->rxq_xsk_fds[i];
 		ret = fd >= 0 ? getsockopt(fd, SOL_XDP, XDP_STATISTICS,
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:14.807938029 +0100
+++ 0020-net-af_xdp-remove-unused-local-statistic.patch	2024-06-25 00:22:13.105184018 +0100
@@ -1 +1 @@
-From abdabad636a54660f4a260e1e9dc573900582bd4 Mon Sep 17 00:00:00 2001
+From 19c6df9ce8fdb63c39c779b4adbd3b0bb5a90b3f Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit abdabad636a54660f4a260e1e9dc573900582bd4 ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -20 +21 @@
-index 25e67851f6..4b282adb03 100644
+index df6ac7a4f2..343b4c40c9 100644
@@ -23 +24 @@
-@@ -125,7 +125,6 @@ struct xsk_umem_info {
+@@ -104,7 +104,6 @@ struct xsk_umem_info {
@@ -31 +32 @@
-@@ -884,7 +883,6 @@ eth_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
+@@ -854,7 +853,6 @@ eth_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/tap: fix file descriptor check in isolated flow' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (18 preceding siblings ...)
  2024-06-24 23:58 ` patch 'net/af_xdp: remove unused local statistic' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'net/axgbe: fix MDIO access for non-zero ports and CL45 PHYs' " luca.boccassi
                   ` (59 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/2f9077766d3c0ab959a5bb9d896aceccf781527b

Thanks.

Luca Boccassi

---
From 2f9077766d3c0ab959a5bb9d896aceccf781527b Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Tue, 21 May 2024 13:12:46 -0700
Subject: [PATCH] net/tap: fix file descriptor check in isolated flow

[ upstream commit e9e6089a41c275f3dcd7491f4df903a284653bb9 ]

The check for receive queue FD in flow_isolate is incorrect.
If queue has not been setup then FD will be -1 not 0.

Fixes: f503d2694825 ("net/tap: support flow API isolated mode")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 drivers/net/tap/tap_flow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/tap/tap_flow.c b/drivers/net/tap/tap_flow.c
index 741ef09fc6..7468c3f0ea 100644
--- a/drivers/net/tap/tap_flow.c
+++ b/drivers/net/tap/tap_flow.c
@@ -1595,7 +1595,7 @@ tap_flow_isolate(struct rte_eth_dev *dev,
 	 * If netdevice is there, setup appropriate flow rules immediately.
 	 * Otherwise it will be set when bringing up the netdevice (tun_alloc).
 	 */
-	if (!process_private->rxq_fds[0])
+	if (process_private->rxq_fds[0] == -1)
 		return 0;
 	if (set) {
 		struct rte_flow *remote_flow;
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:14.871775310 +0100
+++ 0021-net-tap-fix-file-descriptor-check-in-isolated-flow.patch	2024-06-25 00:22:13.105184018 +0100
@@ -1 +1 @@
-From e9e6089a41c275f3dcd7491f4df903a284653bb9 Mon Sep 17 00:00:00 2001
+From 2f9077766d3c0ab959a5bb9d896aceccf781527b Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit e9e6089a41c275f3dcd7491f4df903a284653bb9 ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -19 +20 @@
-index fa50fe45d7..79cd6a12ca 100644
+index 741ef09fc6..7468c3f0ea 100644

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/axgbe: fix MDIO access for non-zero ports and CL45 PHYs' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (19 preceding siblings ...)
  2024-06-24 23:58 ` patch 'net/tap: fix file descriptor check in isolated flow' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'net/axgbe: reset link when link never comes back' " luca.boccassi
                   ` (58 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Venkat Kumar Ande; +Cc: Selwin Sebastian, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/b43c908eb24790a7e1150471f8f662fd9576a009

Thanks.

Luca Boccassi

---
From b43c908eb24790a7e1150471f8f662fd9576a009 Mon Sep 17 00:00:00 2001
From: Venkat Kumar Ande <venkatkumar.ande@amd.com>
Date: Tue, 4 Jun 2024 17:41:33 +0530
Subject: [PATCH] net/axgbe: fix MDIO access for non-zero ports and CL45 PHYs

[ upstream commit d06394d2641e3fdc0538a23354d9ff7c5aa9b277 ]

The XGBE supports performing MDIO operations using an MDIO command
request. The driver mistakenly uses the mdio port address as the
MDIO command request device address instead of the MDIO command
request port address. Additionally, the driver does not properly check
for and create a clause 45 MDIO command

Without the fix PHY device is not detected and can't be usable.

Check the supplied MDIO register to determine if the request is a clause
45 operation (MII_ADDR_C45). For a clause 45 operation, extract device
address and register number from the supplied MDIO register and use them
to set the MDIO command request device address and register number
fields. For a clause 22 operation, the MDIO request device address is
set to zero and the MDIO command request register number is set to the
supplied MDIO register. In either case, the supplied MDIO port address
is used as the MDIO command request port address.

Fixes: 4ac7516b8b39 ("net/axgbe: add phy init and related APIs")

Signed-off-by: Venkat Kumar Ande <venkatkumar.ande@amd.com>
Acked-by: Selwin Sebastian <selwin.sebastian@amd.com>
---
 drivers/net/axgbe/axgbe_common.h |  2 --
 drivers/net/axgbe/axgbe_dev.c    | 22 ++++++++++++++++------
 2 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/drivers/net/axgbe/axgbe_common.h b/drivers/net/axgbe/axgbe_common.h
index a5d11c5832..51532fb34a 100644
--- a/drivers/net/axgbe/axgbe_common.h
+++ b/drivers/net/axgbe/axgbe_common.h
@@ -407,8 +407,6 @@
 #define MAC_MDIOSCAR_PA_WIDTH		5
 #define MAC_MDIOSCAR_RA_INDEX		0
 #define MAC_MDIOSCAR_RA_WIDTH		16
-#define MAC_MDIOSCAR_REG_INDEX		0
-#define MAC_MDIOSCAR_REG_WIDTH		21
 #define MAC_MDIOSCCDR_BUSY_INDEX	22
 #define MAC_MDIOSCCDR_BUSY_WIDTH	1
 #define MAC_MDIOSCCDR_CMD_INDEX		16
diff --git a/drivers/net/axgbe/axgbe_dev.c b/drivers/net/axgbe/axgbe_dev.c
index 6a7fddffca..3389954aa6 100644
--- a/drivers/net/axgbe/axgbe_dev.c
+++ b/drivers/net/axgbe/axgbe_dev.c
@@ -63,15 +63,27 @@ static int mdio_complete(struct axgbe_port *pdata)
 	return 0;
 }
 
+static unsigned int axgbe_create_mdio_sca(int port, int reg)
+{
+	unsigned int mdio_sca, da;
+
+	da = (reg & MII_ADDR_C45) ? reg >> 16 : 0;
+
+	mdio_sca = 0;
+	AXGMAC_SET_BITS(mdio_sca, MAC_MDIOSCAR, RA, reg);
+	AXGMAC_SET_BITS(mdio_sca, MAC_MDIOSCAR, PA, port);
+	AXGMAC_SET_BITS(mdio_sca, MAC_MDIOSCAR, DA, da);
+
+	return mdio_sca;
+}
+
 static int axgbe_write_ext_mii_regs(struct axgbe_port *pdata, int addr,
 				    int reg, u16 val)
 {
 	unsigned int mdio_sca, mdio_sccd;
 	uint64_t timeout;
 
-	mdio_sca = 0;
-	AXGMAC_SET_BITS(mdio_sca, MAC_MDIOSCAR, REG, reg);
-	AXGMAC_SET_BITS(mdio_sca, MAC_MDIOSCAR, DA, addr);
+	mdio_sca = axgbe_create_mdio_sca(addr, reg);
 	AXGMAC_IOWRITE(pdata, MAC_MDIOSCAR, mdio_sca);
 
 	mdio_sccd = 0;
@@ -97,9 +109,7 @@ static int axgbe_read_ext_mii_regs(struct axgbe_port *pdata, int addr,
 	unsigned int mdio_sca, mdio_sccd;
 	uint64_t timeout;
 
-	mdio_sca = 0;
-	AXGMAC_SET_BITS(mdio_sca, MAC_MDIOSCAR, REG, reg);
-	AXGMAC_SET_BITS(mdio_sca, MAC_MDIOSCAR, DA, addr);
+	mdio_sca = axgbe_create_mdio_sca(addr, reg);
 	AXGMAC_IOWRITE(pdata, MAC_MDIOSCAR, mdio_sca);
 
 	mdio_sccd = 0;
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:15.002176787 +0100
+++ 0022-net-axgbe-fix-MDIO-access-for-non-zero-ports-and-CL4.patch	2024-06-25 00:22:13.105184018 +0100
@@ -1 +1 @@
-From d06394d2641e3fdc0538a23354d9ff7c5aa9b277 Mon Sep 17 00:00:00 2001
+From b43c908eb24790a7e1150471f8f662fd9576a009 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit d06394d2641e3fdc0538a23354d9ff7c5aa9b277 ]
+
@@ -24 +25,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/axgbe: reset link when link never comes back' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (20 preceding siblings ...)
  2024-06-24 23:58 ` patch 'net/axgbe: fix MDIO access for non-zero ports and CL45 PHYs' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'net/axgbe: fix fluctuations for 1G Bel Fuse SFP' " luca.boccassi
                   ` (57 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Venkat Kumar Ande; +Cc: Selwin Sebastian, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/ad99680c1dbef9bb02191465926b3c4df8fdf0f2

Thanks.

Luca Boccassi

---
From ad99680c1dbef9bb02191465926b3c4df8fdf0f2 Mon Sep 17 00:00:00 2001
From: Venkat Kumar Ande <venkatkumar.ande@amd.com>
Date: Tue, 4 Jun 2024 17:41:34 +0530
Subject: [PATCH] net/axgbe: reset link when link never comes back

[ upstream commit edf463256dd35803aaa11b0da704a0542ad20071 ]

Normally, auto negotiation and reconnect should be automatically done by
the hardware. But there seems to be an issue where auto negotiation has
to be restarted manually. This happens because of link training and so
even though still connected to the partner the link never "comes back".
This needs an auto-negotiation restart.

Without the fix the user will not see the link up status

Fixes: a5c7273771e8 ("net/axgbe: add phy programming APIs")

Signed-off-by: Venkat Kumar Ande <venkatkumar.ande@amd.com>
Acked-by: Selwin Sebastian <selwin.sebastian@amd.com>
---
 drivers/net/axgbe/axgbe_mdio.c     | 2 +-
 drivers/net/axgbe/axgbe_phy_impl.c | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/net/axgbe/axgbe_mdio.c b/drivers/net/axgbe/axgbe_mdio.c
index 913ceada0d..b03bc471cb 100644
--- a/drivers/net/axgbe/axgbe_mdio.c
+++ b/drivers/net/axgbe/axgbe_mdio.c
@@ -1051,7 +1051,7 @@ static void axgbe_phy_status(struct axgbe_port *pdata)
 							     &an_restart);
 	if (an_restart) {
 		axgbe_phy_config_aneg(pdata);
-		return;
+		goto adjust_link;
 	}
 
 	if (pdata->phy.link) {
diff --git a/drivers/net/axgbe/axgbe_phy_impl.c b/drivers/net/axgbe/axgbe_phy_impl.c
index d97fbbfddd..87795c63c9 100644
--- a/drivers/net/axgbe/axgbe_phy_impl.c
+++ b/drivers/net/axgbe/axgbe_phy_impl.c
@@ -1697,6 +1697,13 @@ static int axgbe_phy_link_status(struct axgbe_port *pdata, int *an_restart)
 	if (reg & MDIO_STAT1_LSTATUS)
 		return 1;
 
+	if (pdata->phy.autoneg == AUTONEG_ENABLE &&
+			phy_data->port_mode == AXGBE_PORT_MODE_BACKPLANE) {
+		if (rte_bit_relaxed_get32(AXGBE_LINK_INIT, &pdata->dev_state)) {
+			*an_restart = 1;
+		}
+	}
+
 	/* No link, attempt a receiver reset cycle */
 	if (phy_data->rrc_count++) {
 		phy_data->rrc_count = 0;
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:15.071800192 +0100
+++ 0023-net-axgbe-reset-link-when-link-never-comes-back.patch	2024-06-25 00:22:13.109184100 +0100
@@ -1 +1 @@
-From edf463256dd35803aaa11b0da704a0542ad20071 Mon Sep 17 00:00:00 2001
+From ad99680c1dbef9bb02191465926b3c4df8fdf0f2 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit edf463256dd35803aaa11b0da704a0542ad20071 ]
+
@@ -15 +16,0 @@
-Cc: stable@dpdk.org
@@ -38 +39 @@
-index 44ff28517c..54fe9faae0 100644
+index d97fbbfddd..87795c63c9 100644

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/axgbe: fix fluctuations for 1G Bel Fuse SFP' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (21 preceding siblings ...)
  2024-06-24 23:58 ` patch 'net/axgbe: reset link when link never comes back' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'net/axgbe: update DMA coherency values' " luca.boccassi
                   ` (56 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Venkat Kumar Ande; +Cc: Selwin Sebastian, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/fac582ee7d5f145928b28a81795c3364c96343c5

Thanks.

Luca Boccassi

---
From fac582ee7d5f145928b28a81795c3364c96343c5 Mon Sep 17 00:00:00 2001
From: Venkat Kumar Ande <venkatkumar.ande@amd.com>
Date: Tue, 4 Jun 2024 17:41:35 +0530
Subject: [PATCH] net/axgbe: fix fluctuations for 1G Bel Fuse SFP

[ upstream commit 3abfda0f7d58b2eef20cdf8e102825678b150421 ]

Frequent link up/down events can happen when a Bel Fuse SFP part is
connected to the amd-xgbe device. Try to avoid the frequent link
issues by resetting the PHY as documented in Bel Fuse SFP datasheet.

Without the fix user will see continuous port link up and down.

Fixes: a5c7273771e8 ("net/axgbe: add phy programming APIs")

Signed-off-by: Venkat Kumar Ande <venkatkumar.ande@amd.com>
Acked-by: Selwin Sebastian <selwin.sebastian@amd.com>
---
 drivers/net/axgbe/axgbe_phy_impl.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/axgbe/axgbe_phy_impl.c b/drivers/net/axgbe/axgbe_phy_impl.c
index 87795c63c9..8f8845a1c5 100644
--- a/drivers/net/axgbe/axgbe_phy_impl.c
+++ b/drivers/net/axgbe/axgbe_phy_impl.c
@@ -578,6 +578,9 @@ static bool axgbe_phy_belfuse_parse_quirks(struct axgbe_port *pdata)
 		   AXGBE_BEL_FUSE_VENDOR, strlen(AXGBE_BEL_FUSE_VENDOR)))
 		return false;
 
+	/* Reset PHY - wait for self-clearing reset bit to clear */
+	pdata->phy_if.phy_impl.reset(pdata);
+
 	if (!memcmp(&sfp_eeprom->base[AXGBE_SFP_BASE_VENDOR_PN],
 		    AXGBE_BEL_FUSE_PARTNO, strlen(AXGBE_BEL_FUSE_PARTNO))) {
 		phy_data->sfp_base = AXGBE_SFP_BASE_1000_SX;
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:15.125520152 +0100
+++ 0024-net-axgbe-fix-fluctuations-for-1G-Bel-Fuse-SFP.patch	2024-06-25 00:22:13.109184100 +0100
@@ -1 +1 @@
-From 3abfda0f7d58b2eef20cdf8e102825678b150421 Mon Sep 17 00:00:00 2001
+From fac582ee7d5f145928b28a81795c3364c96343c5 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 3abfda0f7d58b2eef20cdf8e102825678b150421 ]
+
@@ -13 +14,0 @@
-Cc: stable@dpdk.org
@@ -22 +23 @@
-index 54fe9faae0..ee9dcbe3da 100644
+index 87795c63c9..8f8845a1c5 100644

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/axgbe: update DMA coherency values' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (22 preceding siblings ...)
  2024-06-24 23:58 ` patch 'net/axgbe: fix fluctuations for 1G Bel Fuse SFP' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'net/axgbe: disable interrupts during device removal' " luca.boccassi
                   ` (55 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Venkat Kumar Ande; +Cc: Selwin Sebastian, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/6aad2db82c5f5e7c69e1efff79d3296002253e8e

Thanks.

Luca Boccassi

---
From 6aad2db82c5f5e7c69e1efff79d3296002253e8e Mon Sep 17 00:00:00 2001
From: Venkat Kumar Ande <venkatkumar.ande@amd.com>
Date: Tue, 4 Jun 2024 17:41:36 +0530
Subject: [PATCH] net/axgbe: update DMA coherency values

[ upstream commit 4e6d9f193d4fe5639a856cdb2dd0aa4a8726fe99 ]

Based on the IOMMU configuration, the current cache control settings can
result in possible coherency issues. The hardware team has recommended
new settings for the PCI device path to eliminate the issue.

Without the fix the user will get incorrect data in TSO functionality

Fixes: 7c4158a5b592 ("net/axgbe: add DMA programming and start/stop")

Signed-off-by: Venkat Kumar Ande <venkatkumar.ande@amd.com>
Acked-by: Selwin Sebastian <selwin.sebastian@amd.com>
---
 drivers/net/axgbe/axgbe_dev.c | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/drivers/net/axgbe/axgbe_dev.c b/drivers/net/axgbe/axgbe_dev.c
index 3389954aa6..9b0073eea6 100644
--- a/drivers/net/axgbe/axgbe_dev.c
+++ b/drivers/net/axgbe/axgbe_dev.c
@@ -647,23 +647,21 @@ static void axgbe_config_dma_cache(struct axgbe_port *pdata)
 	unsigned int arcache, awcache, arwcache;
 
 	arcache = 0;
-	AXGMAC_SET_BITS(arcache, DMA_AXIARCR, DRC, 0x3);
+	AXGMAC_SET_BITS(arcache, DMA_AXIARCR, DRC, 0xf);
+	AXGMAC_SET_BITS(arcache, DMA_AXIARCR, TEC, 0xf);
+	AXGMAC_SET_BITS(arcache, DMA_AXIARCR, THC, 0xf);
 	AXGMAC_IOWRITE(pdata, DMA_AXIARCR, arcache);
 
 	awcache = 0;
-	AXGMAC_SET_BITS(awcache, DMA_AXIAWCR, DWC, 0x3);
-	AXGMAC_SET_BITS(awcache, DMA_AXIAWCR, RPC, 0x3);
-	AXGMAC_SET_BITS(awcache, DMA_AXIAWCR, RPD, 0x1);
-	AXGMAC_SET_BITS(awcache, DMA_AXIAWCR, RHC, 0x3);
-	AXGMAC_SET_BITS(awcache, DMA_AXIAWCR, RHD, 0x1);
-	AXGMAC_SET_BITS(awcache, DMA_AXIAWCR, RDC, 0x3);
-	AXGMAC_SET_BITS(awcache, DMA_AXIAWCR, RDD, 0x1);
+	AXGMAC_SET_BITS(awcache, DMA_AXIAWCR, DWC, 0xf);
+	AXGMAC_SET_BITS(awcache, DMA_AXIAWCR, RPC, 0xf);
+	AXGMAC_SET_BITS(awcache, DMA_AXIAWCR, RHC, 0xf);
+	AXGMAC_SET_BITS(awcache, DMA_AXIAWCR, RDC, 0xf);
 	AXGMAC_IOWRITE(pdata, DMA_AXIAWCR, awcache);
 
 	arwcache = 0;
-	AXGMAC_SET_BITS(arwcache, DMA_AXIAWRCR, TDWD, 0x1);
-	AXGMAC_SET_BITS(arwcache, DMA_AXIAWRCR, TDWC, 0x3);
-	AXGMAC_SET_BITS(arwcache, DMA_AXIAWRCR, RDRC, 0x3);
+	AXGMAC_SET_BITS(arwcache, DMA_AXIAWRCR, TDWC, 0xf);
+	AXGMAC_SET_BITS(arwcache, DMA_AXIAWRCR, RDRC, 0xf);
 	AXGMAC_IOWRITE(pdata, DMA_AXIAWRCR, arwcache);
 }
 
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:15.176961043 +0100
+++ 0025-net-axgbe-update-DMA-coherency-values.patch	2024-06-25 00:22:13.113184181 +0100
@@ -1 +1 @@
-From 4e6d9f193d4fe5639a856cdb2dd0aa4a8726fe99 Mon Sep 17 00:00:00 2001
+From 6aad2db82c5f5e7c69e1efff79d3296002253e8e Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 4e6d9f193d4fe5639a856cdb2dd0aa4a8726fe99 ]
+
@@ -13 +14,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/axgbe: disable interrupts during device removal' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (23 preceding siblings ...)
  2024-06-24 23:58 ` patch 'net/axgbe: update DMA coherency values' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'net/axgbe: disable RRC for yellow carp devices' " luca.boccassi
                   ` (54 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Venkat Kumar Ande; +Cc: Selwin Sebastian, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/b07fc265f973fc695348b01163ff3ba23dc5de7d

Thanks.

Luca Boccassi

---
From b07fc265f973fc695348b01163ff3ba23dc5de7d Mon Sep 17 00:00:00 2001
From: Venkat Kumar Ande <venkatkumar.ande@amd.com>
Date: Tue, 4 Jun 2024 17:41:37 +0530
Subject: [PATCH] net/axgbe: disable interrupts during device removal

[ upstream commit 7b7288b08760204139085174ba00a2863dfdbbec ]

Hardware interrupts are enabled during the init, however, they are not
disabled during close.

Disable all hardware interrupts during close operation to avoid any
issues.

Fixes: 9e890103267e ("net/axgbe: add Rx/Tx setup")

Signed-off-by: Venkat Kumar Ande <venkatkumar.ande@amd.com>
Acked-by: Selwin Sebastian <selwin.sebastian@amd.com>
---
 drivers/net/axgbe/axgbe_ethdev.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/axgbe/axgbe_ethdev.c b/drivers/net/axgbe/axgbe_ethdev.c
index da48a3ac42..30440e9e1d 100644
--- a/drivers/net/axgbe/axgbe_ethdev.c
+++ b/drivers/net/axgbe/axgbe_ethdev.c
@@ -2361,12 +2361,14 @@ static int
 axgbe_dev_close(struct rte_eth_dev *eth_dev)
 {
 	struct rte_pci_device *pci_dev;
+	struct axgbe_port *pdata;
 
 	PMD_INIT_FUNC_TRACE();
 
 	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
 		return 0;
 
+	pdata = eth_dev->data->dev_private;
 	pci_dev = RTE_DEV_TO_PCI(eth_dev->device);
 	axgbe_dev_clear_queues(eth_dev);
 
@@ -2376,6 +2378,9 @@ axgbe_dev_close(struct rte_eth_dev *eth_dev)
 				     axgbe_dev_interrupt_handler,
 				     (void *)eth_dev);
 
+	/* Disable all interrupts in the hardware */
+	XP_IOWRITE(pdata, XP_INT_EN, 0x0);
+
 	return 0;
 }
 
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:15.228850660 +0100
+++ 0026-net-axgbe-disable-interrupts-during-device-removal.patch	2024-06-25 00:22:13.113184181 +0100
@@ -1 +1 @@
-From 7b7288b08760204139085174ba00a2863dfdbbec Mon Sep 17 00:00:00 2001
+From b07fc265f973fc695348b01163ff3ba23dc5de7d Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 7b7288b08760204139085174ba00a2863dfdbbec ]
+
@@ -13 +14,0 @@
-Cc: stable@dpdk.org
@@ -22 +23 @@
-index dd681f15a0..e5d8f7db02 100644
+index da48a3ac42..30440e9e1d 100644
@@ -25 +26 @@
-@@ -2411,12 +2411,14 @@ static int
+@@ -2361,12 +2361,14 @@ static int
@@ -40 +41 @@
-@@ -2426,6 +2428,9 @@ axgbe_dev_close(struct rte_eth_dev *eth_dev)
+@@ -2376,6 +2378,9 @@ axgbe_dev_close(struct rte_eth_dev *eth_dev)

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/axgbe: disable RRC for yellow carp devices' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (24 preceding siblings ...)
  2024-06-24 23:58 ` patch 'net/axgbe: disable interrupts during device removal' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'net/axgbe: enable PLL control for fixed PHY modes only' " luca.boccassi
                   ` (53 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Venkat Kumar Ande; +Cc: Selwin Sebastian, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/a1e4f462f35e4015d7f2de421d96fbd39ff42632

Thanks.

Luca Boccassi

---
From a1e4f462f35e4015d7f2de421d96fbd39ff42632 Mon Sep 17 00:00:00 2001
From: Venkat Kumar Ande <venkatkumar.ande@amd.com>
Date: Tue, 4 Jun 2024 17:41:38 +0530
Subject: [PATCH] net/axgbe: disable RRC for yellow carp devices

[ upstream commit e82b0fe097da02eab8be924a28a0a4ca96bc3c69 ]

Link stability issues are noticed on Yellow carp platforms when Receiver
Reset Cycle is issued. Since the CDR workaround is disabled on these
platforms, the Receiver Reset Cycle is not needed.

So, avoid issuing rrc on Yellow carp platforms.

Without the fix the user will not get the link UP.

Fixes: a5c7273771e8 ("net/axgbe: add phy programming APIs")

Signed-off-by: Venkat Kumar Ande <venkatkumar.ande@amd.com>
Acked-by: Selwin Sebastian <selwin.sebastian@amd.com>
---
 drivers/net/axgbe/axgbe_ethdev.c   | 5 +++++
 drivers/net/axgbe/axgbe_ethdev.h   | 1 +
 drivers/net/axgbe/axgbe_phy_impl.c | 2 +-
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/net/axgbe/axgbe_ethdev.c b/drivers/net/axgbe/axgbe_ethdev.c
index 30440e9e1d..2156b1d17a 100644
--- a/drivers/net/axgbe/axgbe_ethdev.c
+++ b/drivers/net/axgbe/axgbe_ethdev.c
@@ -205,6 +205,7 @@ static struct axgbe_version_data axgbe_v2a = {
 	.ecc_support			= 1,
 	.i2c_support			= 1,
 	.an_cdr_workaround		= 1,
+	.enable_rrc			= 1,
 };
 
 static struct axgbe_version_data axgbe_v2b = {
@@ -217,6 +218,7 @@ static struct axgbe_version_data axgbe_v2b = {
 	.ecc_support			= 1,
 	.i2c_support			= 1,
 	.an_cdr_workaround		= 1,
+	.enable_rrc			= 1,
 };
 
 static const struct rte_eth_desc_lim rx_desc_lim = {
@@ -2224,6 +2226,9 @@ eth_axgbe_dev_init(struct rte_eth_dev *eth_dev)
 
 			/* Yellow Carp devices do not need cdr workaround */
 			pdata->vdata->an_cdr_workaround = 0;
+
+			/* Yellow Carp devices do not need rrc */
+			pdata->vdata->enable_rrc = 0;
 		} else {
 			unknown_cpu = 1;
 		}
diff --git a/drivers/net/axgbe/axgbe_ethdev.h b/drivers/net/axgbe/axgbe_ethdev.h
index 7f19321d88..ae57aeaa00 100644
--- a/drivers/net/axgbe/axgbe_ethdev.h
+++ b/drivers/net/axgbe/axgbe_ethdev.h
@@ -463,6 +463,7 @@ struct axgbe_version_data {
 	unsigned int ecc_support;
 	unsigned int i2c_support;
 	unsigned int an_cdr_workaround;
+	unsigned int enable_rrc;
 };
 
 struct axgbe_mmc_stats {
diff --git a/drivers/net/axgbe/axgbe_phy_impl.c b/drivers/net/axgbe/axgbe_phy_impl.c
index 8f8845a1c5..46ee5f0617 100644
--- a/drivers/net/axgbe/axgbe_phy_impl.c
+++ b/drivers/net/axgbe/axgbe_phy_impl.c
@@ -1708,7 +1708,7 @@ static int axgbe_phy_link_status(struct axgbe_port *pdata, int *an_restart)
 	}
 
 	/* No link, attempt a receiver reset cycle */
-	if (phy_data->rrc_count++) {
+	if (pdata->vdata->enable_rrc && phy_data->rrc_count++) {
 		phy_data->rrc_count = 0;
 		axgbe_phy_rrc(pdata);
 	}
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:15.281453298 +0100
+++ 0027-net-axgbe-disable-RRC-for-yellow-carp-devices.patch	2024-06-25 00:22:13.117184263 +0100
@@ -1 +1 @@
-From e82b0fe097da02eab8be924a28a0a4ca96bc3c69 Mon Sep 17 00:00:00 2001
+From a1e4f462f35e4015d7f2de421d96fbd39ff42632 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit e82b0fe097da02eab8be924a28a0a4ca96bc3c69 ]
+
@@ -15 +16,0 @@
-Cc: stable@dpdk.org
@@ -26 +27 @@
-index e5d8f7db02..86c2ec64e0 100644
+index 30440e9e1d..2156b1d17a 100644
@@ -29 +30 @@
-@@ -208,6 +208,7 @@ static struct axgbe_version_data axgbe_v2a = {
+@@ -205,6 +205,7 @@ static struct axgbe_version_data axgbe_v2a = {
@@ -37 +38 @@
-@@ -220,6 +221,7 @@ static struct axgbe_version_data axgbe_v2b = {
+@@ -217,6 +218,7 @@ static struct axgbe_version_data axgbe_v2b = {
@@ -45 +46 @@
-@@ -2269,6 +2271,9 @@ eth_axgbe_dev_init(struct rte_eth_dev *eth_dev)
+@@ -2224,6 +2226,9 @@ eth_axgbe_dev_init(struct rte_eth_dev *eth_dev)
@@ -56 +57 @@
-index df5d63c493..f122dfd516 100644
+index 7f19321d88..ae57aeaa00 100644
@@ -68 +69 @@
-index ee9dcbe3da..f51830f800 100644
+index 8f8845a1c5..46ee5f0617 100644

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/axgbe: enable PLL control for fixed PHY modes only' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (25 preceding siblings ...)
  2024-06-24 23:58 ` patch 'net/axgbe: disable RRC for yellow carp devices' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'net/axgbe: fix SFP codes check for DAC cables' " luca.boccassi
                   ` (52 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Venkat Kumar Ande; +Cc: Selwin Sebastian, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/07b6c26ee2bbe092c60b96d2dc5d44e067fe1055

Thanks.

Luca Boccassi

---
From 07b6c26ee2bbe092c60b96d2dc5d44e067fe1055 Mon Sep 17 00:00:00 2001
From: Venkat Kumar Ande <venkatkumar.ande@amd.com>
Date: Tue, 4 Jun 2024 17:41:39 +0530
Subject: [PATCH] net/axgbe: enable PLL control for fixed PHY modes only

[ upstream commit 1c68b393b8ba05b6ddb321e3632d45fc1021ed96 ]

PLL control setting is needed only in fixed PHY configuration to
fix the peer-peer issues. Without the PLL control setting, the link up
takes longer time in a fixed PHY configuration.

Without the fix the user will not get the link come UP.

Driver implements SW RRC for Autoneg On configuration, hence PLL control
setting is not needed for AN On configuration, and can be skipped.

Also, PLL re-initialization is not needed for PHY Power Off and RRC
commands. Otherwise, they lead to mailbox errors. Added the changes
accordingly.

Fixes: 09b0a36cc7ae ("net/axgbe: toggle PLL settings during rate change")

Signed-off-by: Venkat Kumar Ande <venkatkumar.ande@amd.com>
Acked-by: Selwin Sebastian <selwin.sebastian@amd.com>
---
 drivers/net/axgbe/axgbe_phy_impl.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/net/axgbe/axgbe_phy_impl.c b/drivers/net/axgbe/axgbe_phy_impl.c
index 46ee5f0617..040176b8ef 100644
--- a/drivers/net/axgbe/axgbe_phy_impl.c
+++ b/drivers/net/axgbe/axgbe_phy_impl.c
@@ -1228,6 +1228,10 @@ static void axgbe_phy_rx_reset(struct axgbe_port *pdata)
 
 static void axgbe_phy_pll_ctrl(struct axgbe_port *pdata, bool enable)
 {
+	/* PLL_CTRL feature needs to be enabled for fixed PHY modes (Non-Autoneg) only */
+	if (pdata->phy.autoneg != AUTONEG_DISABLE)
+		return;
+
 	XMDIO_WRITE_BITS(pdata, MDIO_MMD_PMAPMD, MDIO_VEND2_PMA_MISC_CTRL0,
 			XGBE_PMA_PLL_CTRL_MASK,
 			enable ? XGBE_PMA_PLL_CTRL_SET
@@ -1272,8 +1276,9 @@ static void axgbe_phy_perform_ratechange(struct axgbe_port *pdata,
 	axgbe_phy_rx_reset(pdata);
 
 reenable_pll:
-	 /* Re-enable the PLL control */
-	axgbe_phy_pll_ctrl(pdata, true);
+	/* Enable PLL re-initialization, not needed for PHY Power Off and RRC cmds */
+	if (cmd != 0 && cmd != 5)
+		axgbe_phy_pll_ctrl(pdata, true);
 
 	PMD_DRV_LOG(NOTICE, "firmware mailbox command did not complete\n");
 }
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:15.336087708 +0100
+++ 0028-net-axgbe-enable-PLL-control-for-fixed-PHY-modes-onl.patch	2024-06-25 00:22:13.117184263 +0100
@@ -1 +1 @@
-From 1c68b393b8ba05b6ddb321e3632d45fc1021ed96 Mon Sep 17 00:00:00 2001
+From 07b6c26ee2bbe092c60b96d2dc5d44e067fe1055 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 1c68b393b8ba05b6ddb321e3632d45fc1021ed96 ]
+
@@ -20 +21,0 @@
-Cc: stable@dpdk.org
@@ -29 +30 @@
-index f51830f800..bcefbf28f2 100644
+index 46ee5f0617..040176b8ef 100644

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/axgbe: fix SFP codes check for DAC cables' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (26 preceding siblings ...)
  2024-06-24 23:58 ` patch 'net/axgbe: enable PLL control for fixed PHY modes only' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'net/axgbe: fix connection for SFP+ active " luca.boccassi
                   ` (51 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Venkat Kumar Ande; +Cc: Selwin Sebastian, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/39527c017d64fc66cd911281f65ec93927adb6a2

Thanks.

Luca Boccassi

---
From 39527c017d64fc66cd911281f65ec93927adb6a2 Mon Sep 17 00:00:00 2001
From: Venkat Kumar Ande <venkatkumar.ande@amd.com>
Date: Tue, 4 Jun 2024 17:41:40 +0530
Subject: [PATCH] net/axgbe: fix SFP codes check for DAC cables

[ upstream commit 4eefb1b16acaa69bd757057e0c54c58f11577ba3 ]

The current axgbe code assumes that offset 6 of EEPROM SFP DAC (passive)
cables is NULL. However, some cables (the 5 meter and 7 meter Molex
passive cables) have non-zero data at offset 6. Fix the logic by moving
the passive cable check above the active checks, so as not to be
improperly identified as an active cable. This will fix the issue for
any passive cable that advertises 1000Base-CX in offset 6.

Without the fix the user will not get link UP for few DAC cables.

Fixes: a5c7273771e8 ("net/axgbe: add phy programming APIs")

Signed-off-by: Venkat Kumar Ande <venkatkumar.ande@amd.com>
Acked-by: Selwin Sebastian <selwin.sebastian@amd.com>
---
 drivers/net/axgbe/axgbe_phy_impl.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/axgbe/axgbe_phy_impl.c b/drivers/net/axgbe/axgbe_phy_impl.c
index 040176b8ef..9aadbefaba 100644
--- a/drivers/net/axgbe/axgbe_phy_impl.c
+++ b/drivers/net/axgbe/axgbe_phy_impl.c
@@ -625,7 +625,10 @@ static void axgbe_phy_sfp_parse_eeprom(struct axgbe_port *pdata)
 	}
 
 	/* Determine the type of SFP */
-	if (sfp_base[AXGBE_SFP_BASE_10GBE_CC] & AXGBE_SFP_BASE_10GBE_CC_SR)
+	if (phy_data->sfp_cable == AXGBE_SFP_CABLE_PASSIVE &&
+		 axgbe_phy_sfp_bit_rate(sfp_eeprom, AXGBE_SFP_SPEED_10000))
+		phy_data->sfp_base = AXGBE_SFP_BASE_10000_CR;
+	else if (sfp_base[AXGBE_SFP_BASE_10GBE_CC] & AXGBE_SFP_BASE_10GBE_CC_SR)
 		phy_data->sfp_base = AXGBE_SFP_BASE_10000_SR;
 	else if (sfp_base[AXGBE_SFP_BASE_10GBE_CC] & AXGBE_SFP_BASE_10GBE_CC_LR)
 		phy_data->sfp_base = AXGBE_SFP_BASE_10000_LR;
@@ -642,9 +645,6 @@ static void axgbe_phy_sfp_parse_eeprom(struct axgbe_port *pdata)
 		phy_data->sfp_base = AXGBE_SFP_BASE_1000_CX;
 	else if (sfp_base[AXGBE_SFP_BASE_1GBE_CC] & AXGBE_SFP_BASE_1GBE_CC_T)
 		phy_data->sfp_base = AXGBE_SFP_BASE_1000_T;
-	else if ((phy_data->sfp_cable == AXGBE_SFP_CABLE_PASSIVE) &&
-		 axgbe_phy_sfp_bit_rate(sfp_eeprom, AXGBE_SFP_SPEED_10000))
-		phy_data->sfp_base = AXGBE_SFP_BASE_10000_CR;
 
 	switch (phy_data->sfp_base) {
 	case AXGBE_SFP_BASE_1000_T:
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:15.388135617 +0100
+++ 0029-net-axgbe-fix-SFP-codes-check-for-DAC-cables.patch	2024-06-25 00:22:13.121184344 +0100
@@ -1 +1 @@
-From 4eefb1b16acaa69bd757057e0c54c58f11577ba3 Mon Sep 17 00:00:00 2001
+From 39527c017d64fc66cd911281f65ec93927adb6a2 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 4eefb1b16acaa69bd757057e0c54c58f11577ba3 ]
+
@@ -16 +17,0 @@
-Cc: stable@dpdk.org
@@ -25 +26 @@
-index bcefbf28f2..10196cae94 100644
+index 040176b8ef..9aadbefaba 100644

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/axgbe: fix connection for SFP+ active cables' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (27 preceding siblings ...)
  2024-06-24 23:58 ` patch 'net/axgbe: fix SFP codes check for DAC cables' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'net/axgbe: check only minimum speed for " luca.boccassi
                   ` (50 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Venkat Kumar Ande; +Cc: Selwin Sebastian, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/73e8b7893e102f3c4d01dd7b510b1c64e3e6171f

Thanks.

Luca Boccassi

---
From 73e8b7893e102f3c4d01dd7b510b1c64e3e6171f Mon Sep 17 00:00:00 2001
From: Venkat Kumar Ande <venkatkumar.ande@amd.com>
Date: Tue, 4 Jun 2024 17:41:41 +0530
Subject: [PATCH] net/axgbe: fix connection for SFP+ active cables

[ upstream commit 4823ccdbbd887bb84339a4d35febd92292d07b97 ]

SFP+ active and passive cables are copper cables with fixed SFP+ end
connectors. Due to a misinterpretation of this, SFP+ active cables could
end up not being recognized, causing the driver to fail to establish a
connection.

Introduce a new enum in SFP+ cable types, XGBE_SFP_CABLE_FIBER, that is
the default cable type, and handle active and passive cables when they
are specifically detected.

Fixes: a5c7273771e8 ("net/axgbe: add phy programming APIs")

Signed-off-by: Venkat Kumar Ande <venkatkumar.ande@amd.com>
Acked-by: Selwin Sebastian <selwin.sebastian@amd.com>
---
 drivers/net/axgbe/axgbe_phy_impl.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/net/axgbe/axgbe_phy_impl.c b/drivers/net/axgbe/axgbe_phy_impl.c
index 9aadbefaba..85b01bfa10 100644
--- a/drivers/net/axgbe/axgbe_phy_impl.c
+++ b/drivers/net/axgbe/axgbe_phy_impl.c
@@ -69,6 +69,7 @@ enum axgbe_sfp_cable {
 	AXGBE_SFP_CABLE_UNKNOWN = 0,
 	AXGBE_SFP_CABLE_ACTIVE,
 	AXGBE_SFP_CABLE_PASSIVE,
+	AXGBE_SFP_CABLE_FIBER,
 };
 
 enum axgbe_sfp_base {
@@ -616,16 +617,18 @@ static void axgbe_phy_sfp_parse_eeprom(struct axgbe_port *pdata)
 
 	axgbe_phy_sfp_parse_quirks(pdata);
 
-	/* Assume ACTIVE cable unless told it is PASSIVE */
+	/* Assume FIBER cable unless told otherwise */
 	if (sfp_base[AXGBE_SFP_BASE_CABLE] & AXGBE_SFP_BASE_CABLE_PASSIVE) {
 		phy_data->sfp_cable = AXGBE_SFP_CABLE_PASSIVE;
 		phy_data->sfp_cable_len = sfp_base[AXGBE_SFP_BASE_CU_CABLE_LEN];
-	} else {
+	} else if (sfp_base[AXGBE_SFP_BASE_CABLE] & AXGBE_SFP_BASE_CABLE_ACTIVE) {
 		phy_data->sfp_cable = AXGBE_SFP_CABLE_ACTIVE;
+	} else {
+		phy_data->sfp_cable = AXGBE_SFP_CABLE_FIBER;
 	}
 
 	/* Determine the type of SFP */
-	if (phy_data->sfp_cable == AXGBE_SFP_CABLE_PASSIVE &&
+	if (phy_data->sfp_cable != AXGBE_SFP_CABLE_FIBER &&
 		 axgbe_phy_sfp_bit_rate(sfp_eeprom, AXGBE_SFP_SPEED_10000))
 		phy_data->sfp_base = AXGBE_SFP_BASE_10000_CR;
 	else if (sfp_base[AXGBE_SFP_BASE_10GBE_CC] & AXGBE_SFP_BASE_10GBE_CC_SR)
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:15.440216439 +0100
+++ 0030-net-axgbe-fix-connection-for-SFP-active-cables.patch	2024-06-25 00:22:13.121184344 +0100
@@ -1 +1 @@
-From 4823ccdbbd887bb84339a4d35febd92292d07b97 Mon Sep 17 00:00:00 2001
+From 73e8b7893e102f3c4d01dd7b510b1c64e3e6171f Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 4823ccdbbd887bb84339a4d35febd92292d07b97 ]
+
@@ -16 +17,0 @@
-Cc: stable@dpdk.org
@@ -25 +26 @@
-index 10196cae94..d9585a7404 100644
+index 9aadbefaba..85b01bfa10 100644

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/axgbe: check only minimum speed for cables' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (28 preceding siblings ...)
  2024-06-24 23:58 ` patch 'net/axgbe: fix connection for SFP+ active " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'net/axgbe: fix Tx flow on 30H HW' " luca.boccassi
                   ` (49 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Venkat Kumar Ande; +Cc: Selwin Sebastian, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/08c36b23fdd34beefd1421eb552b2c58c43ba52d

Thanks.

Luca Boccassi

---
From 08c36b23fdd34beefd1421eb552b2c58c43ba52d Mon Sep 17 00:00:00 2001
From: Venkat Kumar Ande <venkatkumar.ande@amd.com>
Date: Tue, 4 Jun 2024 17:41:42 +0530
Subject: [PATCH] net/axgbe: check only minimum speed for cables

[ upstream commit b5587a39dc94ee0bd055b515cc8c060923ed69b9 ]

There are cables that exist that can support speeds in excess of 10GbE.
The driver, however, restricts the EEPROM advertised nominal bitrate to
a specific range, which can prevent usage of cables that can support,
for example, up to 25GbE.

Rather than checking that an active or passive cable supports a specific
range, only check for a minimum supported speed.

Fixes: a5c7273771e8 ("net/axgbe: add phy programming APIs")

Signed-off-by: Venkat Kumar Ande <venkatkumar.ande@amd.com>
Acked-by: Selwin Sebastian <selwin.sebastian@amd.com>
---
 drivers/net/axgbe/axgbe_phy_impl.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/net/axgbe/axgbe_phy_impl.c b/drivers/net/axgbe/axgbe_phy_impl.c
index 85b01bfa10..12908d4e6f 100644
--- a/drivers/net/axgbe/axgbe_phy_impl.c
+++ b/drivers/net/axgbe/axgbe_phy_impl.c
@@ -117,9 +117,7 @@ enum axgbe_sfp_speed {
 
 #define AXGBE_SFP_BASE_BR			12
 #define AXGBE_SFP_BASE_BR_1GBE_MIN		0x0a
-#define AXGBE_SFP_BASE_BR_1GBE_MAX		0x0d
 #define AXGBE_SFP_BASE_BR_10GBE_MIN		0x64
-#define AXGBE_SFP_BASE_BR_10GBE_MAX		0x68
 
 #define AXGBE_SFP_BASE_CU_CABLE_LEN		18
 
@@ -536,25 +534,22 @@ static void axgbe_phy_sfp_phy_settings(struct axgbe_port *pdata)
 static bool axgbe_phy_sfp_bit_rate(struct axgbe_sfp_eeprom *sfp_eeprom,
 				   enum axgbe_sfp_speed sfp_speed)
 {
-	u8 *sfp_base, min, max;
+	u8 *sfp_base, min;
 
 	sfp_base = sfp_eeprom->base;
 
 	switch (sfp_speed) {
 	case AXGBE_SFP_SPEED_1000:
 		min = AXGBE_SFP_BASE_BR_1GBE_MIN;
-		max = AXGBE_SFP_BASE_BR_1GBE_MAX;
 		break;
 	case AXGBE_SFP_SPEED_10000:
 		min = AXGBE_SFP_BASE_BR_10GBE_MIN;
-		max = AXGBE_SFP_BASE_BR_10GBE_MAX;
 		break;
 	default:
 		return false;
 	}
 
-	return ((sfp_base[AXGBE_SFP_BASE_BR] >= min) &&
-		(sfp_base[AXGBE_SFP_BASE_BR] <= max));
+	return sfp_base[AXGBE_SFP_BASE_BR] >= min;
 }
 
 static void axgbe_phy_sfp_external_phy(struct axgbe_port *pdata)
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:15.492206733 +0100
+++ 0031-net-axgbe-check-only-minimum-speed-for-cables.patch	2024-06-25 00:22:13.125184426 +0100
@@ -1 +1 @@
-From b5587a39dc94ee0bd055b515cc8c060923ed69b9 Mon Sep 17 00:00:00 2001
+From 08c36b23fdd34beefd1421eb552b2c58c43ba52d Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit b5587a39dc94ee0bd055b515cc8c060923ed69b9 ]
+
@@ -15 +16,0 @@
-Cc: stable@dpdk.org
@@ -24 +25 @@
-index d9585a7404..b6a2a084aa 100644
+index 85b01bfa10..12908d4e6f 100644

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/axgbe: fix Tx flow on 30H HW' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (29 preceding siblings ...)
  2024-06-24 23:58 ` patch 'net/axgbe: check only minimum speed for " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'net/axgbe: delay AN timeout during KR training' " luca.boccassi
                   ` (48 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Venkat Kumar Ande; +Cc: Selwin Sebastian, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/59767090cb7af04ec5fbdc8a443cd3da13f0207c

Thanks.

Luca Boccassi

---
From 59767090cb7af04ec5fbdc8a443cd3da13f0207c Mon Sep 17 00:00:00 2001
From: Venkat Kumar Ande <venkatkumar.ande@amd.com>
Date: Tue, 4 Jun 2024 17:41:43 +0530
Subject: [PATCH] net/axgbe: fix Tx flow on 30H HW

[ upstream commit b4b24f3e80f9b1bd2c56e1b56b8b8337748e15e6 ]

There is difference in the TX Flow Control registers (TFCR) between the
revisions of the hardware. The older revisions of hardware used to have
single register per queue. Whereas, the newer revision of hardware (from
ver 30H onwards) have one register per priority.

Without the fix the user will face problem in TX operation on new 30H HW

Fixes: 7c4158a5b592 ("net/axgbe: add DMA programming and start/stop")

Signed-off-by: Venkat Kumar Ande <venkatkumar.ande@amd.com>
Acked-by: Selwin Sebastian <selwin.sebastian@amd.com>
---
 drivers/net/axgbe/axgbe_dev.c | 25 +++++++++++++++----------
 1 file changed, 15 insertions(+), 10 deletions(-)

diff --git a/drivers/net/axgbe/axgbe_dev.c b/drivers/net/axgbe/axgbe_dev.c
index 9b0073eea6..5233633a53 100644
--- a/drivers/net/axgbe/axgbe_dev.c
+++ b/drivers/net/axgbe/axgbe_dev.c
@@ -269,20 +269,28 @@ static int axgbe_set_speed(struct axgbe_port *pdata, int speed)
 	return 0;
 }
 
+static unsigned int axgbe_get_fc_queue_count(struct axgbe_port *pdata)
+{
+	unsigned int max_q_count = AXGMAC_MAX_FLOW_CONTROL_QUEUES;
+
+	/* From MAC ver 30H the TFCR is per priority, instead of per queue */
+	if (AXGMAC_GET_BITS(pdata->hw_feat.version, MAC_VR, SNPSVER) >= 0x30)
+		return max_q_count;
+	else
+		return (RTE_MIN(pdata->tx_q_count, max_q_count));
+}
+
 static int axgbe_disable_tx_flow_control(struct axgbe_port *pdata)
 {
-	unsigned int max_q_count, q_count;
 	unsigned int reg, reg_val;
-	unsigned int i;
+	unsigned int i, q_count;
 
 	/* Clear MTL flow control */
 	for (i = 0; i < pdata->rx_q_count; i++)
 		AXGMAC_MTL_IOWRITE_BITS(pdata, i, MTL_Q_RQOMR, EHFC, 0);
 
 	/* Clear MAC flow control */
-	max_q_count = AXGMAC_MAX_FLOW_CONTROL_QUEUES;
-	q_count = RTE_MIN(pdata->tx_q_count,
-			max_q_count);
+	q_count = axgbe_get_fc_queue_count(pdata);
 	reg = MAC_Q0TFCR;
 	for (i = 0; i < q_count; i++) {
 		reg_val = AXGMAC_IOREAD(pdata, reg);
@@ -297,9 +305,8 @@ static int axgbe_disable_tx_flow_control(struct axgbe_port *pdata)
 
 static int axgbe_enable_tx_flow_control(struct axgbe_port *pdata)
 {
-	unsigned int max_q_count, q_count;
 	unsigned int reg, reg_val;
-	unsigned int i;
+	unsigned int i, q_count;
 
 	/* Set MTL flow control */
 	for (i = 0; i < pdata->rx_q_count; i++) {
@@ -316,9 +323,7 @@ static int axgbe_enable_tx_flow_control(struct axgbe_port *pdata)
 	}
 
 	/* Set MAC flow control */
-	max_q_count = AXGMAC_MAX_FLOW_CONTROL_QUEUES;
-	q_count = RTE_MIN(pdata->tx_q_count,
-			max_q_count);
+	q_count = axgbe_get_fc_queue_count(pdata);
 	reg = MAC_Q0TFCR;
 	for (i = 0; i < q_count; i++) {
 		reg_val = AXGMAC_IOREAD(pdata, reg);
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:15.544399094 +0100
+++ 0032-net-axgbe-fix-Tx-flow-on-30H-HW.patch	2024-06-25 00:22:13.125184426 +0100
@@ -1 +1 @@
-From b4b24f3e80f9b1bd2c56e1b56b8b8337748e15e6 Mon Sep 17 00:00:00 2001
+From 59767090cb7af04ec5fbdc8a443cd3da13f0207c Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit b4b24f3e80f9b1bd2c56e1b56b8b8337748e15e6 ]
+
@@ -14 +15,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/axgbe: delay AN timeout during KR training' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (30 preceding siblings ...)
  2024-06-24 23:58 ` patch 'net/axgbe: fix Tx flow on 30H HW' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'net/axgbe: fix linkup in PHY status' " luca.boccassi
                   ` (47 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Venkat Kumar Ande; +Cc: Selwin Sebastian, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/e8615db99073af9bc4b4a1af9dbd1b051d2d54d8

Thanks.

Luca Boccassi

---
From e8615db99073af9bc4b4a1af9dbd1b051d2d54d8 Mon Sep 17 00:00:00 2001
From: Venkat Kumar Ande <venkatkumar.ande@amd.com>
Date: Tue, 4 Jun 2024 17:41:44 +0530
Subject: [PATCH] net/axgbe: delay AN timeout during KR training

[ upstream commit 323e8c91a7c434915920fe8668ca5664b65ea198 ]

AN restart triggered during KR training not only aborts the KR training
process but also move the HW to unstable state. Driver has to wait up to
500ms or until the KR training is completed before restarting AN cycle.

Without the fix the user will face KR training failure issues.

Fixes: a5c7273771e8 ("net/axgbe: add phy programming APIs")

Signed-off-by: Venkat Kumar Ande <venkatkumar.ande@amd.com>
Acked-by: Selwin Sebastian <selwin.sebastian@amd.com>
---
 drivers/net/axgbe/axgbe_ethdev.h |  2 ++
 drivers/net/axgbe/axgbe_mdio.c   | 25 +++++++++++++++++++++++++
 2 files changed, 27 insertions(+)

diff --git a/drivers/net/axgbe/axgbe_ethdev.h b/drivers/net/axgbe/axgbe_ethdev.h
index ae57aeaa00..b4bd56e239 100644
--- a/drivers/net/axgbe/axgbe_ethdev.h
+++ b/drivers/net/axgbe/axgbe_ethdev.h
@@ -111,6 +111,7 @@
 /* Auto-negotiation */
 #define AXGBE_AN_MS_TIMEOUT		500
 #define AXGBE_LINK_TIMEOUT		5
+#define AXGBE_KR_TRAINING_WAIT_ITER	50
 
 #define AXGBE_SGMII_AN_LINK_STATUS	BIT(1)
 #define AXGBE_SGMII_AN_LINK_SPEED	(BIT(2) | BIT(3))
@@ -654,6 +655,7 @@ struct axgbe_port {
 	unsigned int parallel_detect;
 	unsigned int fec_ability;
 	unsigned long an_start;
+	unsigned long kr_start_time;
 	enum axgbe_an_mode an_mode;
 
 	/* I2C support */
diff --git a/drivers/net/axgbe/axgbe_mdio.c b/drivers/net/axgbe/axgbe_mdio.c
index b03bc471cb..e1a737cf62 100644
--- a/drivers/net/axgbe/axgbe_mdio.c
+++ b/drivers/net/axgbe/axgbe_mdio.c
@@ -357,6 +357,7 @@ static enum axgbe_an axgbe_an73_tx_training(struct axgbe_port *pdata,
 	reg |= AXGBE_KR_TRAINING_ENABLE;
 	reg |= AXGBE_KR_TRAINING_START;
 	XMDIO_WRITE(pdata, MDIO_MMD_PMAPMD, MDIO_PMA_10GBR_PMD_CTRL, reg);
+	pdata->kr_start_time = rte_get_timer_cycles();
 
 	PMD_DRV_LOG(DEBUG, "KR training initiated\n");
 	if (pdata->phy_if.phy_impl.kr_training_post)
@@ -487,6 +488,7 @@ static enum axgbe_an axgbe_an73_incompat_link(struct axgbe_port *pdata)
 
 	axgbe_an_disable(pdata);
 	axgbe_switch_mode(pdata);
+	pdata->an_result = AXGBE_AN_READY;
 	axgbe_an_restart(pdata);
 
 	return AXGBE_AN_INCOMPAT_LINK;
@@ -967,11 +969,34 @@ static void axgbe_check_link_timeout(struct axgbe_port *pdata)
 {
 	unsigned long link_timeout;
 	unsigned long ticks;
+	unsigned long kr_time;
+	int wait;
 
 	link_timeout = pdata->link_check + (AXGBE_LINK_TIMEOUT *
 					    2 *  rte_get_timer_hz());
 	ticks = rte_get_timer_cycles();
 	if (time_after(ticks, link_timeout)) {
+		if ((axgbe_cur_mode(pdata) == AXGBE_MODE_KR) &&
+		    pdata->phy.autoneg == AUTONEG_ENABLE) {
+			/* AN restart should not happen while KR training is in progress.
+			 * The while loop ensures no AN restart during KR training,
+			 * waits up to 500ms and AN restart is triggered only if KR
+			 * training is failed.
+			 */
+			wait = AXGBE_KR_TRAINING_WAIT_ITER;
+			while (wait--) {
+				kr_time = pdata->kr_start_time +
+					  msecs_to_timer_cycles(AXGBE_AN_MS_TIMEOUT);
+				ticks = rte_get_timer_cycles();
+				if (time_after(ticks, kr_time))
+					break;
+				/* AN restart is not required, if AN result is COMPLETE */
+				if (pdata->an_result == AXGBE_AN_COMPLETE)
+					return;
+				rte_delay_us(10500);
+			}
+		}
+
 		PMD_DRV_LOG(NOTICE, "AN link timeout\n");
 		axgbe_phy_config_aneg(pdata);
 	}
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:15.595687630 +0100
+++ 0033-net-axgbe-delay-AN-timeout-during-KR-training.patch	2024-06-25 00:22:13.125184426 +0100
@@ -1 +1 @@
-From 323e8c91a7c434915920fe8668ca5664b65ea198 Mon Sep 17 00:00:00 2001
+From e8615db99073af9bc4b4a1af9dbd1b051d2d54d8 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 323e8c91a7c434915920fe8668ca5664b65ea198 ]
+
@@ -13 +14,0 @@
-Cc: stable@dpdk.org
@@ -23 +24 @@
-index f122dfd516..d1fac667c2 100644
+index ae57aeaa00..b4bd56e239 100644
@@ -34 +35 @@
-@@ -661,6 +662,7 @@ struct axgbe_port {
+@@ -654,6 +655,7 @@ struct axgbe_port {

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/axgbe: fix linkup in PHY status' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (31 preceding siblings ...)
  2024-06-24 23:58 ` patch 'net/axgbe: delay AN timeout during KR training' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'net/ice: fix check for outer UDP checksum offload' " luca.boccassi
                   ` (46 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Venkat Kumar Ande; +Cc: Selwin Sebastian, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/ac5a8e2ab5732ba8872f34e2fbb199f10d067400

Thanks.

Luca Boccassi

---
From ac5a8e2ab5732ba8872f34e2fbb199f10d067400 Mon Sep 17 00:00:00 2001
From: Venkat Kumar Ande <venkatkumar.ande@amd.com>
Date: Tue, 4 Jun 2024 17:41:45 +0530
Subject: [PATCH] net/axgbe: fix linkup in PHY status

[ upstream commit 50362d0e1f386563a026b314bd0a7eedcd188910 ]

In the event of a change in axgbe mode, the current auto-negotiation
needs to be reset and the AN cycle needs to be re-triggered. However,
the current code ignores the return value of axgbe_set_mode(), leading
to false information as the link is declared without checking the status
register.

Fix this by propagating the mode switch status information to
axgbe_phy_status().

Fixes: 102b6ec3d5c3 ("net/axgbe: support auto-negotiation for 1Gbps")

Signed-off-by: Venkat Kumar Ande <venkatkumar.ande@amd.com>
Acked-by: Selwin Sebastian <selwin.sebastian@amd.com>
---
 drivers/net/axgbe/axgbe_mdio.c | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/drivers/net/axgbe/axgbe_mdio.c b/drivers/net/axgbe/axgbe_mdio.c
index e1a737cf62..d95a52659e 100644
--- a/drivers/net/axgbe/axgbe_mdio.c
+++ b/drivers/net/axgbe/axgbe_mdio.c
@@ -200,13 +200,14 @@ static void axgbe_switch_mode(struct axgbe_port *pdata)
 	axgbe_change_mode(pdata, pdata->phy_if.phy_impl.switch_mode(pdata));
 }
 
-static void axgbe_set_mode(struct axgbe_port *pdata,
+static bool axgbe_set_mode(struct axgbe_port *pdata,
 			   enum axgbe_mode mode)
 {
 	if (mode == axgbe_cur_mode(pdata))
-		return;
+		return false;
 
 	axgbe_change_mode(pdata, mode);
+	return true;
 }
 
 static bool axgbe_use_mode(struct axgbe_port *pdata,
@@ -1007,7 +1008,7 @@ static enum axgbe_mode axgbe_phy_status_aneg(struct axgbe_port *pdata)
 	return pdata->phy_if.phy_impl.an_outcome(pdata);
 }
 
-static void axgbe_phy_status_result(struct axgbe_port *pdata)
+static bool axgbe_phy_status_result(struct axgbe_port *pdata)
 {
 	enum axgbe_mode mode;
 
@@ -1041,7 +1042,10 @@ static void axgbe_phy_status_result(struct axgbe_port *pdata)
 
 	pdata->phy.duplex = DUPLEX_FULL;
 
-	axgbe_set_mode(pdata, mode);
+	if (axgbe_set_mode(pdata, mode))
+		return true;
+	else
+		return false;
 }
 
 static int autoneg_time_out(unsigned long autoneg_start_time)
@@ -1108,7 +1112,10 @@ static void axgbe_phy_status(struct axgbe_port *pdata)
 				return;
 			}
 		}
-		axgbe_phy_status_result(pdata);
+
+		if (axgbe_phy_status_result(pdata))
+			return;
+
 		if (rte_bit_relaxed_get32(AXGBE_LINK_INIT, &pdata->dev_state))
 			rte_bit_relaxed_clear32(AXGBE_LINK_INIT,
 						&pdata->dev_state);
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:15.647808194 +0100
+++ 0034-net-axgbe-fix-linkup-in-PHY-status.patch	2024-06-25 00:22:13.125184426 +0100
@@ -1 +1 @@
-From 50362d0e1f386563a026b314bd0a7eedcd188910 Mon Sep 17 00:00:00 2001
+From ac5a8e2ab5732ba8872f34e2fbb199f10d067400 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 50362d0e1f386563a026b314bd0a7eedcd188910 ]
+
@@ -16 +17,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/ice: fix check for outer UDP checksum offload' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (32 preceding siblings ...)
  2024-06-24 23:58 ` patch 'net/axgbe: fix linkup in PHY status' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'app/testpmd: fix outer IP " luca.boccassi
                   ` (45 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: David Marchand
  Cc: Bruce Richardson, Morten Brørup, Ali Alnubani, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/e48c8875998c04dbc83065bbed8139b74a26a16c

Thanks.

Luca Boccassi

---
From e48c8875998c04dbc83065bbed8139b74a26a16c Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Thu, 18 Apr 2024 10:20:15 +0200
Subject: [PATCH] net/ice: fix check for outer UDP checksum offload
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit f4eb07f031c4a6a0055f3b2773e031cd8000206e ]

ICE_TX_CTX_EIPT_NONE == 0.
There is a good chance that !(anything & 0) is true :-).

While removing this noop check is doable, let's check that the
descriptor does contain a outer ip type.

Fixes: 2ed011776334 ("net/ice: fix outer UDP Tx checksum offload")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Tested-by: Ali Alnubani <alialnu@nvidia.com>
---
 drivers/net/ice/ice_rxtx.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c
index 9a653cbc4a..f73065b81c 100644
--- a/drivers/net/ice/ice_rxtx.c
+++ b/drivers/net/ice/ice_rxtx.c
@@ -2733,9 +2733,9 @@ ice_parse_tunneling_params(uint64_t ol_flags,
 	 * Calculate the tunneling UDP checksum.
 	 * Shall be set only if L4TUNT = 01b and EIPT is not zero
 	 */
-	if (!(*cd_tunneling & ICE_TX_CTX_EIPT_NONE) &&
-		(*cd_tunneling & ICE_TXD_CTX_UDP_TUNNELING) &&
-		(ol_flags & RTE_MBUF_F_TX_OUTER_UDP_CKSUM))
+	if ((*cd_tunneling & ICE_TXD_CTX_QW0_EIPT_M) &&
+			(*cd_tunneling & ICE_TXD_CTX_UDP_TUNNELING) &&
+			(ol_flags & RTE_MBUF_F_TX_OUTER_UDP_CKSUM))
 		*cd_tunneling |= ICE_TXD_CTX_QW0_L4T_CS_M;
 }
 
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:15.698246281 +0100
+++ 0035-net-ice-fix-check-for-outer-UDP-checksum-offload.patch	2024-06-25 00:22:13.129184507 +0100
@@ -1 +1 @@
-From f4eb07f031c4a6a0055f3b2773e031cd8000206e Mon Sep 17 00:00:00 2001
+From e48c8875998c04dbc83065bbed8139b74a26a16c Mon Sep 17 00:00:00 2001
@@ -8,0 +9,2 @@
+[ upstream commit f4eb07f031c4a6a0055f3b2773e031cd8000206e ]
+
@@ -16 +17,0 @@
-Cc: stable@dpdk.org
@@ -27 +28 @@
-index 95a2db3432..10babab231 100644
+index 9a653cbc4a..f73065b81c 100644
@@ -30 +31 @@
-@@ -2751,9 +2751,9 @@ ice_parse_tunneling_params(uint64_t ol_flags,
+@@ -2733,9 +2733,9 @@ ice_parse_tunneling_params(uint64_t ol_flags,

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'app/testpmd: fix outer IP checksum offload' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (33 preceding siblings ...)
  2024-06-24 23:58 ` patch 'net/ice: fix check for outer UDP checksum offload' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'net: fix outer UDP checksum in Intel prepare helper' " luca.boccassi
                   ` (44 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: David Marchand; +Cc: Ferruh Yigit, Ali Alnubani, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/0c72bf4c1d8e1382545da4a2b55dfcaa632b0ce3

Thanks.

Luca Boccassi

---
From 0c72bf4c1d8e1382545da4a2b55dfcaa632b0ce3 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Thu, 18 Apr 2024 10:20:17 +0200
Subject: [PATCH] app/testpmd: fix outer IP checksum offload

[ upstream commit b9d859d8a671ec4516face2eba24434b955a9ac1 ]

Resetting the outer IP checksum to 0 is not something mandated by the
mbuf API and is done by rte_eth_tx_prepare(), or per driver if needed.

Fixes: 4fb7e803eb1a ("ethdev: add Tx preparation")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
Tested-by: Ali Alnubani <alialnu@nvidia.com>
---
 app/test-pmd/csumonly.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index 6170728221..bfe1fc3ddc 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -574,15 +574,17 @@ process_outer_cksums(void *outer_l3_hdr, struct testpmd_offload_info *info,
 	uint64_t ol_flags = 0;
 
 	if (info->outer_ethertype == _htons(RTE_ETHER_TYPE_IPV4)) {
-		ipv4_hdr->hdr_checksum = 0;
 		ol_flags |= RTE_MBUF_F_TX_OUTER_IPV4;
 
-		if (tx_offloads	& RTE_ETH_TX_OFFLOAD_OUTER_IPV4_CKSUM)
+		if (tx_offloads	& RTE_ETH_TX_OFFLOAD_OUTER_IPV4_CKSUM) {
 			ol_flags |= RTE_MBUF_F_TX_OUTER_IP_CKSUM;
-		else
+		} else {
+			ipv4_hdr->hdr_checksum = 0;
 			ipv4_hdr->hdr_checksum = rte_ipv4_cksum(ipv4_hdr);
-	} else
+		}
+	} else {
 		ol_flags |= RTE_MBUF_F_TX_OUTER_IPV6;
+	}
 
 	if (info->outer_l4_proto != IPPROTO_UDP)
 		return ol_flags;
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:15.769222946 +0100
+++ 0036-app-testpmd-fix-outer-IP-checksum-offload.patch	2024-06-25 00:22:13.129184507 +0100
@@ -1 +1 @@
-From b9d859d8a671ec4516face2eba24434b955a9ac1 Mon Sep 17 00:00:00 2001
+From 0c72bf4c1d8e1382545da4a2b55dfcaa632b0ce3 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit b9d859d8a671ec4516face2eba24434b955a9ac1 ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -20 +21 @@
-index 6711dda42e..f5125c2788 100644
+index 6170728221..bfe1fc3ddc 100644
@@ -23 +24 @@
-@@ -583,15 +583,17 @@ process_outer_cksums(void *outer_l3_hdr, struct testpmd_offload_info *info,
+@@ -574,15 +574,17 @@ process_outer_cksums(void *outer_l3_hdr, struct testpmd_offload_info *info,

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net: fix outer UDP checksum in Intel prepare helper' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (34 preceding siblings ...)
  2024-06-24 23:58 ` patch 'app/testpmd: fix outer IP " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'net/i40e: fix outer UDP checksum offload for X710' " luca.boccassi
                   ` (43 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: David Marchand; +Cc: Ali Alnubani, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/b5fc38d53c9b4f682e0dd433063db14faaa6ae63

Thanks.

Luca Boccassi

---
From b5fc38d53c9b4f682e0dd433063db14faaa6ae63 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Thu, 18 Apr 2024 10:20:18 +0200
Subject: [PATCH] net: fix outer UDP checksum in Intel prepare helper

[ upstream commit f876dbef080932dbeb1de075d7ca3cbe2ed6d7eb ]

Setting a pseudo header checksum in the outer UDP checksum is a Intel
(and some other vendors) requirement.
Applications (like OVS) requesting outer UDP checksum without doing this
extra setup have broken outer UDP checksums.

Move this specific setup from testpmd to the "common" helper
rte_net_intel_cksum_flags_prepare().

net/hns3 can then be adjusted.

Bugzilla ID: 1406
Fixes: d8e5e69f3a9b ("app/testpmd: add GTP parsing and Tx checksum offload")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Tested-by: Ali Alnubani <alialnu@nvidia.com>
---
 app/test-pmd/csumonly.c      | 11 +----
 drivers/net/hns3/hns3_rxtx.c | 93 ++++++++++--------------------------
 lib/net/rte_net.h            | 17 ++++++-
 3 files changed, 43 insertions(+), 78 deletions(-)

diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index bfe1fc3ddc..161bbd4e14 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -568,8 +568,6 @@ static uint64_t
 process_outer_cksums(void *outer_l3_hdr, struct testpmd_offload_info *info,
 	uint64_t tx_offloads, int tso_enabled, struct rte_mbuf *m)
 {
-	struct rte_ipv4_hdr *ipv4_hdr = outer_l3_hdr;
-	struct rte_ipv6_hdr *ipv6_hdr = outer_l3_hdr;
 	struct rte_udp_hdr *udp_hdr;
 	uint64_t ol_flags = 0;
 
@@ -579,6 +577,8 @@ process_outer_cksums(void *outer_l3_hdr, struct testpmd_offload_info *info,
 		if (tx_offloads	& RTE_ETH_TX_OFFLOAD_OUTER_IPV4_CKSUM) {
 			ol_flags |= RTE_MBUF_F_TX_OUTER_IP_CKSUM;
 		} else {
+			struct rte_ipv4_hdr *ipv4_hdr = outer_l3_hdr;
+
 			ipv4_hdr->hdr_checksum = 0;
 			ipv4_hdr->hdr_checksum = rte_ipv4_cksum(ipv4_hdr);
 		}
@@ -597,13 +597,6 @@ process_outer_cksums(void *outer_l3_hdr, struct testpmd_offload_info *info,
 
 	/* Skip SW outer UDP checksum generation if HW supports it */
 	if (tx_offloads & RTE_ETH_TX_OFFLOAD_OUTER_UDP_CKSUM) {
-		if (info->outer_ethertype == _htons(RTE_ETHER_TYPE_IPV4))
-			udp_hdr->dgram_cksum
-				= rte_ipv4_phdr_cksum(ipv4_hdr, ol_flags);
-		else
-			udp_hdr->dgram_cksum
-				= rte_ipv6_phdr_cksum(ipv6_hdr, ol_flags);
-
 		ol_flags |= RTE_MBUF_F_TX_OUTER_UDP_CKSUM;
 		return ol_flags;
 	}
diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
index c0479a44dc..4343a3e4df 100644
--- a/drivers/net/hns3/hns3_rxtx.c
+++ b/drivers/net/hns3/hns3_rxtx.c
@@ -3627,58 +3627,6 @@ hns3_pkt_need_linearized(struct rte_mbuf *tx_pkts, uint32_t bd_num,
 	return false;
 }
 
-static bool
-hns3_outer_ipv4_cksum_prepared(struct rte_mbuf *m, uint64_t ol_flags,
-				uint32_t *l4_proto)
-{
-	struct rte_ipv4_hdr *ipv4_hdr;
-	ipv4_hdr = rte_pktmbuf_mtod_offset(m, struct rte_ipv4_hdr *,
-					   m->outer_l2_len);
-	if (ol_flags & RTE_MBUF_F_TX_OUTER_IP_CKSUM)
-		ipv4_hdr->hdr_checksum = 0;
-	if (ol_flags & RTE_MBUF_F_TX_OUTER_UDP_CKSUM) {
-		struct rte_udp_hdr *udp_hdr;
-		/*
-		 * If OUTER_UDP_CKSUM is support, HW can calculate the pseudo
-		 * header for TSO packets
-		 */
-		if (ol_flags & RTE_MBUF_F_TX_TCP_SEG)
-			return true;
-		udp_hdr = rte_pktmbuf_mtod_offset(m, struct rte_udp_hdr *,
-				m->outer_l2_len + m->outer_l3_len);
-		udp_hdr->dgram_cksum = rte_ipv4_phdr_cksum(ipv4_hdr, ol_flags);
-
-		return true;
-	}
-	*l4_proto = ipv4_hdr->next_proto_id;
-	return false;
-}
-
-static bool
-hns3_outer_ipv6_cksum_prepared(struct rte_mbuf *m, uint64_t ol_flags,
-				uint32_t *l4_proto)
-{
-	struct rte_ipv6_hdr *ipv6_hdr;
-	ipv6_hdr = rte_pktmbuf_mtod_offset(m, struct rte_ipv6_hdr *,
-					   m->outer_l2_len);
-	if (ol_flags & RTE_MBUF_F_TX_OUTER_UDP_CKSUM) {
-		struct rte_udp_hdr *udp_hdr;
-		/*
-		 * If OUTER_UDP_CKSUM is support, HW can calculate the pseudo
-		 * header for TSO packets
-		 */
-		if (ol_flags & RTE_MBUF_F_TX_TCP_SEG)
-			return true;
-		udp_hdr = rte_pktmbuf_mtod_offset(m, struct rte_udp_hdr *,
-				m->outer_l2_len + m->outer_l3_len);
-		udp_hdr->dgram_cksum = rte_ipv6_phdr_cksum(ipv6_hdr, ol_flags);
-
-		return true;
-	}
-	*l4_proto = ipv6_hdr->proto;
-	return false;
-}
-
 static void
 hns3_outer_header_cksum_prepare(struct rte_mbuf *m)
 {
@@ -3686,29 +3634,38 @@ hns3_outer_header_cksum_prepare(struct rte_mbuf *m)
 	uint32_t paylen, hdr_len, l4_proto;
 	struct rte_udp_hdr *udp_hdr;
 
-	if (!(ol_flags & (RTE_MBUF_F_TX_OUTER_IPV4 | RTE_MBUF_F_TX_OUTER_IPV6)))
+	if (!(ol_flags & (RTE_MBUF_F_TX_OUTER_IPV4 | RTE_MBUF_F_TX_OUTER_IPV6)) &&
+			((ol_flags & RTE_MBUF_F_TX_OUTER_UDP_CKSUM) ||
+			!(ol_flags & RTE_MBUF_F_TX_TCP_SEG)))
 		return;
 
 	if (ol_flags & RTE_MBUF_F_TX_OUTER_IPV4) {
-		if (hns3_outer_ipv4_cksum_prepared(m, ol_flags, &l4_proto))
-			return;
+		struct rte_ipv4_hdr *ipv4_hdr;
+
+		ipv4_hdr = rte_pktmbuf_mtod_offset(m, struct rte_ipv4_hdr *,
+			m->outer_l2_len);
+		l4_proto = ipv4_hdr->next_proto_id;
 	} else {
-		if (hns3_outer_ipv6_cksum_prepared(m, ol_flags, &l4_proto))
-			return;
+		struct rte_ipv6_hdr *ipv6_hdr;
+
+		ipv6_hdr = rte_pktmbuf_mtod_offset(m, struct rte_ipv6_hdr *,
+					   m->outer_l2_len);
+		l4_proto = ipv6_hdr->proto;
 	}
 
+	if (l4_proto != IPPROTO_UDP)
+		return;
+
 	/* driver should ensure the outer udp cksum is 0 for TUNNEL TSO */
-	if (l4_proto == IPPROTO_UDP && (ol_flags & RTE_MBUF_F_TX_TCP_SEG)) {
-		hdr_len = m->l2_len + m->l3_len + m->l4_len;
-		hdr_len += m->outer_l2_len + m->outer_l3_len;
-		paylen = m->pkt_len - hdr_len;
-		if (paylen <= m->tso_segsz)
-			return;
-		udp_hdr = rte_pktmbuf_mtod_offset(m, struct rte_udp_hdr *,
-						  m->outer_l2_len +
-						  m->outer_l3_len);
-		udp_hdr->dgram_cksum = 0;
-	}
+	hdr_len = m->l2_len + m->l3_len + m->l4_len;
+	hdr_len += m->outer_l2_len + m->outer_l3_len;
+	paylen = m->pkt_len - hdr_len;
+	if (paylen <= m->tso_segsz)
+		return;
+	udp_hdr = rte_pktmbuf_mtod_offset(m, struct rte_udp_hdr *,
+					  m->outer_l2_len +
+					  m->outer_l3_len);
+	udp_hdr->dgram_cksum = 0;
 }
 
 static int
diff --git a/lib/net/rte_net.h b/lib/net/rte_net.h
index 56611fc8f9..a94f6af717 100644
--- a/lib/net/rte_net.h
+++ b/lib/net/rte_net.h
@@ -121,7 +121,7 @@ rte_net_intel_cksum_flags_prepare(struct rte_mbuf *m, uint64_t ol_flags)
 	 * no offloads are requested.
 	 */
 	if (!(ol_flags & (RTE_MBUF_F_TX_IP_CKSUM | RTE_MBUF_F_TX_L4_MASK | RTE_MBUF_F_TX_TCP_SEG |
-			  RTE_MBUF_F_TX_OUTER_IP_CKSUM)))
+			  RTE_MBUF_F_TX_OUTER_IP_CKSUM | RTE_MBUF_F_TX_OUTER_UDP_CKSUM)))
 		return 0;
 
 	if (ol_flags & (RTE_MBUF_F_TX_OUTER_IPV4 | RTE_MBUF_F_TX_OUTER_IPV6)) {
@@ -135,6 +135,21 @@ rte_net_intel_cksum_flags_prepare(struct rte_mbuf *m, uint64_t ol_flags)
 					struct rte_ipv4_hdr *, m->outer_l2_len);
 			ipv4_hdr->hdr_checksum = 0;
 		}
+		if (ol_flags & RTE_MBUF_F_TX_OUTER_UDP_CKSUM) {
+			if (ol_flags & RTE_MBUF_F_TX_OUTER_IPV4) {
+				ipv4_hdr = rte_pktmbuf_mtod_offset(m, struct rte_ipv4_hdr *,
+					m->outer_l2_len);
+				udp_hdr = (struct rte_udp_hdr *)((char *)ipv4_hdr +
+					m->outer_l3_len);
+				udp_hdr->dgram_cksum = rte_ipv4_phdr_cksum(ipv4_hdr, m->ol_flags);
+			} else {
+				ipv6_hdr = rte_pktmbuf_mtod_offset(m, struct rte_ipv6_hdr *,
+					m->outer_l2_len);
+				udp_hdr = rte_pktmbuf_mtod_offset(m, struct rte_udp_hdr *,
+					 m->outer_l2_len + m->outer_l3_len);
+				udp_hdr->dgram_cksum = rte_ipv6_phdr_cksum(ipv6_hdr, m->ol_flags);
+			}
+		}
 	}
 
 	/*
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:15.829676123 +0100
+++ 0037-net-fix-outer-UDP-checksum-in-Intel-prepare-helper.patch	2024-06-25 00:22:13.137184670 +0100
@@ -1 +1 @@
-From f876dbef080932dbeb1de075d7ca3cbe2ed6d7eb Mon Sep 17 00:00:00 2001
+From b5fc38d53c9b4f682e0dd433063db14faaa6ae63 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit f876dbef080932dbeb1de075d7ca3cbe2ed6d7eb ]
+
@@ -18 +19,0 @@
-Cc: stable@dpdk.org
@@ -25,2 +26,2 @@
- lib/net/rte_net.h            | 18 ++++++-
- 3 files changed, 44 insertions(+), 78 deletions(-)
+ lib/net/rte_net.h            | 17 ++++++-
+ 3 files changed, 43 insertions(+), 78 deletions(-)
@@ -29 +30 @@
-index f5125c2788..71add6ca47 100644
+index bfe1fc3ddc..161bbd4e14 100644
@@ -32 +33 @@
-@@ -577,8 +577,6 @@ static uint64_t
+@@ -568,8 +568,6 @@ static uint64_t
@@ -41 +42 @@
-@@ -588,6 +586,8 @@ process_outer_cksums(void *outer_l3_hdr, struct testpmd_offload_info *info,
+@@ -579,6 +577,8 @@ process_outer_cksums(void *outer_l3_hdr, struct testpmd_offload_info *info,
@@ -50 +51 @@
-@@ -608,13 +608,6 @@ process_outer_cksums(void *outer_l3_hdr, struct testpmd_offload_info *info,
+@@ -597,13 +597,6 @@ process_outer_cksums(void *outer_l3_hdr, struct testpmd_offload_info *info,
@@ -65 +66 @@
-index bf10da1928..59a95aba7c 100644
+index c0479a44dc..4343a3e4df 100644
@@ -68 +69 @@
-@@ -3629,58 +3629,6 @@ hns3_pkt_need_linearized(struct rte_mbuf *tx_pkts, uint32_t bd_num,
+@@ -3627,58 +3627,6 @@ hns3_pkt_need_linearized(struct rte_mbuf *tx_pkts, uint32_t bd_num,
@@ -127 +128 @@
-@@ -3688,29 +3636,38 @@ hns3_outer_header_cksum_prepare(struct rte_mbuf *m)
+@@ -3686,29 +3634,38 @@ hns3_outer_header_cksum_prepare(struct rte_mbuf *m)
@@ -183 +184 @@
-index ef3ff4c6fd..efd9d5f5ee 100644
+index 56611fc8f9..a94f6af717 100644
@@ -186 +187 @@
-@@ -121,7 +121,8 @@ rte_net_intel_cksum_flags_prepare(struct rte_mbuf *m, uint64_t ol_flags)
+@@ -121,7 +121,7 @@ rte_net_intel_cksum_flags_prepare(struct rte_mbuf *m, uint64_t ol_flags)
@@ -190,3 +191,2 @@
--					RTE_MBUF_F_TX_UDP_SEG | RTE_MBUF_F_TX_OUTER_IP_CKSUM)))
-+					RTE_MBUF_F_TX_UDP_SEG | RTE_MBUF_F_TX_OUTER_IP_CKSUM |
-+					RTE_MBUF_F_TX_OUTER_UDP_CKSUM)))
+-			  RTE_MBUF_F_TX_OUTER_IP_CKSUM)))
++			  RTE_MBUF_F_TX_OUTER_IP_CKSUM | RTE_MBUF_F_TX_OUTER_UDP_CKSUM)))
@@ -196 +196 @@
-@@ -135,6 +136,21 @@ rte_net_intel_cksum_flags_prepare(struct rte_mbuf *m, uint64_t ol_flags)
+@@ -135,6 +135,21 @@ rte_net_intel_cksum_flags_prepare(struct rte_mbuf *m, uint64_t ol_flags)

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/i40e: fix outer UDP checksum offload for X710' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (35 preceding siblings ...)
  2024-06-24 23:58 ` patch 'net: fix outer UDP checksum in Intel prepare helper' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'net/iavf: remove outer UDP checksum offload for X710 VF' " luca.boccassi
                   ` (42 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: David Marchand; +Cc: Jun Wang, Ali Alnubani, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/9d02109d19544e9834902cdf7964165e25cc75f2

Thanks.

Luca Boccassi

---
From 9d02109d19544e9834902cdf7964165e25cc75f2 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Thu, 18 Apr 2024 10:20:19 +0200
Subject: [PATCH] net/i40e: fix outer UDP checksum offload for X710

[ upstream commit 6b5e31f7fbd71675c8f3f6d8c0f74fd1f3a0dff5 ]

According to the X710 datasheet (and confirmed on the field..), X710
devices do not support outer checksum offload.

"""
8.4.4.2 Transmit L3 and L4 Integrity Offload

Tunneling UDP headers and GRE header are not offloaded while the
X710/XXV710/XL710 leaves their checksum field as is.
If a checksum is required, software should provide it as well as the inner
checksum value(s) that are required for the outer checksum.
"""

Fix Tx offload capabilities according to the hardware.

X722 may support such offload by setting I40E_TXD_CTX_QW0_L4T_CS_MASK.

Bugzilla ID: 1406
Fixes: 8cc79a1636cd ("net/i40e: fix forward outer IPv6 VXLAN")

Reported-by: Jun Wang <junwang01@cestc.cn>
Signed-off-by: David Marchand <david.marchand@redhat.com>
Tested-by: Ali Alnubani <alialnu@nvidia.com>
---
 .mailmap                       | 1 +
 drivers/net/i40e/i40e_ethdev.c | 6 +++++-
 drivers/net/i40e/i40e_rxtx.c   | 9 +++++++++
 3 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/.mailmap b/.mailmap
index 172e7f2692..8aca0a656e 100644
--- a/.mailmap
+++ b/.mailmap
@@ -686,6 +686,7 @@ Junjie Wan <wanjunjie@bytedance.com>
 Jun Qiu <jun.qiu@jaguarmicro.com>
 Jun W Zhou <junx.w.zhou@intel.com>
 Junxiao Shi <git@mail1.yoursunny.com>
+Jun Wang <junwang01@cestc.cn>
 Jun Yang <jun.yang@nxp.com>
 Junyu Jiang <junyux.jiang@intel.com>
 Juraj Linkeš <juraj.linkes@pantheon.tech>
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 0ff334745d..2049c32c4e 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -3721,8 +3721,12 @@ i40e_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 		RTE_ETH_TX_OFFLOAD_IPIP_TNL_TSO |
 		RTE_ETH_TX_OFFLOAD_GENEVE_TNL_TSO |
 		RTE_ETH_TX_OFFLOAD_MULTI_SEGS |
-		RTE_ETH_TX_OFFLOAD_OUTER_UDP_CKSUM |
 		dev_info->tx_queue_offload_capa;
+	if (hw->mac.type == I40E_MAC_X722) {
+		dev_info->tx_offload_capa |=
+			RTE_ETH_TX_OFFLOAD_OUTER_UDP_CKSUM;
+	}
+
 	dev_info->dev_capa =
 		RTE_ETH_DEV_CAPA_RUNTIME_RX_QUEUE_SETUP |
 		RTE_ETH_DEV_CAPA_RUNTIME_TX_QUEUE_SETUP;
diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index d96bbbb677..6522f2b810 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -295,6 +295,15 @@ i40e_parse_tunneling_params(uint64_t ol_flags,
 	 */
 	*cd_tunneling |= (tx_offload.l2_len >> 1) <<
 		I40E_TXD_CTX_QW0_NATLEN_SHIFT;
+
+	/**
+	 * Calculate the tunneling UDP checksum (only supported with X722).
+	 * Shall be set only if L4TUNT = 01b and EIPT is not zero
+	 */
+	if ((*cd_tunneling & I40E_TXD_CTX_QW0_EXT_IP_MASK) &&
+			(*cd_tunneling & I40E_TXD_CTX_UDP_TUNNELING) &&
+			(ol_flags & RTE_MBUF_F_TX_OUTER_UDP_CKSUM))
+		*cd_tunneling |= I40E_TXD_CTX_QW0_L4T_CS_MASK;
 }
 
 static inline void
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:15.897075093 +0100
+++ 0038-net-i40e-fix-outer-UDP-checksum-offload-for-X710.patch	2024-06-25 00:22:13.153184996 +0100
@@ -1 +1 @@
-From 6b5e31f7fbd71675c8f3f6d8c0f74fd1f3a0dff5 Mon Sep 17 00:00:00 2001
+From 9d02109d19544e9834902cdf7964165e25cc75f2 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 6b5e31f7fbd71675c8f3f6d8c0f74fd1f3a0dff5 ]
+
@@ -24 +25,0 @@
-Cc: stable@dpdk.org
@@ -36 +37 @@
-index cb8d65bf0e..1aca379558 100644
+index 172e7f2692..8aca0a656e 100644
@@ -39 +40 @@
-@@ -720,6 +720,7 @@ Junjie Wan <wanjunjie@bytedance.com>
+@@ -686,6 +686,7 @@ Junjie Wan <wanjunjie@bytedance.com>
@@ -48 +49 @@
-index 801cc95607..c38515a758 100644
+index 0ff334745d..2049c32c4e 100644
@@ -51 +52 @@
-@@ -3862,8 +3862,12 @@ i40e_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
+@@ -3721,8 +3721,12 @@ i40e_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
@@ -66 +67 @@
-index 155f24377b..dc466ae371 100644
+index d96bbbb677..6522f2b810 100644

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/iavf: remove outer UDP checksum offload for X710 VF' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (36 preceding siblings ...)
  2024-06-24 23:58 ` patch 'net/i40e: fix outer UDP checksum offload for X710' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'app/testpmd: fix lcore ID restriction' " luca.boccassi
                   ` (41 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: David Marchand; +Cc: Ali Alnubani, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/fe02a92fcc01da0abe0429e8c6e0168c0df2d238

Thanks.

Luca Boccassi

---
From fe02a92fcc01da0abe0429e8c6e0168c0df2d238 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Thu, 18 Apr 2024 10:20:20 +0200
Subject: [PATCH] net/iavf: remove outer UDP checksum offload for X710 VF

[ upstream commit 032ba1580bc36f31e431cf8d14dd3dec0079fa9c ]

According to the X710 datasheet, X710 devices do not support outer
checksum offload.

"""
8.4.4.2 Transmit L3 and L4 Integrity Offload

Tunneling UDP headers and GRE header are not offloaded while the
X710/XXV710/XL710 leaves their checksum field as is.
If a checksum is required, software should provide it as well as the inner
checksum value(s) that are required for the outer checksum.
"""

Fix Tx offload capabilities depending on the VF type.

Bugzilla ID: 1406
Fixes: f7c8c36fdeb7 ("net/iavf: enable inner and outer Tx checksum offload")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Tested-by: Ali Alnubani <alialnu@nvidia.com>
---
 drivers/net/iavf/iavf_ethdev.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
index b244d45abb..b6c3cd425d 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -1140,7 +1140,6 @@ iavf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 		RTE_ETH_TX_OFFLOAD_TCP_CKSUM |
 		RTE_ETH_TX_OFFLOAD_SCTP_CKSUM |
 		RTE_ETH_TX_OFFLOAD_OUTER_IPV4_CKSUM |
-		RTE_ETH_TX_OFFLOAD_OUTER_UDP_CKSUM |
 		RTE_ETH_TX_OFFLOAD_TCP_TSO |
 		RTE_ETH_TX_OFFLOAD_VXLAN_TNL_TSO |
 		RTE_ETH_TX_OFFLOAD_GRE_TNL_TSO |
@@ -1149,6 +1148,10 @@ iavf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 		RTE_ETH_TX_OFFLOAD_MULTI_SEGS |
 		RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE;
 
+	/* X710 does not support outer udp checksum */
+	if (adapter->hw.mac.type != IAVF_MAC_XL710)
+		dev_info->tx_offload_capa |= RTE_ETH_TX_OFFLOAD_OUTER_UDP_CKSUM;
+
 	if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_CRC)
 		dev_info->rx_offload_capa |= RTE_ETH_RX_OFFLOAD_KEEP_CRC;
 
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:15.972408422 +0100
+++ 0039-net-iavf-remove-outer-UDP-checksum-offload-for-X710-.patch	2024-06-25 00:22:13.153184996 +0100
@@ -1 +1 @@
-From 032ba1580bc36f31e431cf8d14dd3dec0079fa9c Mon Sep 17 00:00:00 2001
+From fe02a92fcc01da0abe0429e8c6e0168c0df2d238 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 032ba1580bc36f31e431cf8d14dd3dec0079fa9c ]
+
@@ -22 +23,0 @@
-Cc: stable@dpdk.org
@@ -27,17 +28,3 @@
- doc/guides/nics/features/iavf.ini | 2 +-
- drivers/net/iavf/iavf_ethdev.c    | 5 ++++-
- 2 files changed, 5 insertions(+), 2 deletions(-)
-
-diff --git a/doc/guides/nics/features/iavf.ini b/doc/guides/nics/features/iavf.ini
-index c59115ae15..ce9860e963 100644
---- a/doc/guides/nics/features/iavf.ini
-+++ b/doc/guides/nics/features/iavf.ini
-@@ -33,7 +33,7 @@ L3 checksum offload  = Y
- L4 checksum offload  = Y
- Timestamp offload    = Y
- Inner L3 checksum    = Y
--Inner L4 checksum    = Y
-+Inner L4 checksum    = P
- Packet type parsing  = Y
- Rx descriptor status = Y
- Tx descriptor status = Y
+ drivers/net/iavf/iavf_ethdev.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
@@ -45 +32 @@
-index 245b3cd854..bbf915097e 100644
+index b244d45abb..b6c3cd425d 100644
@@ -48 +35 @@
-@@ -1174,7 +1174,6 @@ iavf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
+@@ -1140,7 +1140,6 @@ iavf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
@@ -56 +43 @@
-@@ -1183,6 +1182,10 @@ iavf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
+@@ -1149,6 +1148,10 @@ iavf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'app/testpmd: fix lcore ID restriction' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (37 preceding siblings ...)
  2024-06-24 23:58 ` patch 'net/iavf: remove outer UDP checksum offload for X710 VF' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'hash: fix return code description in Doxygen' " luca.boccassi
                   ` (40 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Sivaprasad Tummala; +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/a4a27aa3e0f8a870de14f33463180c3b9af4c8de

Thanks.

Luca Boccassi

---
From a4a27aa3e0f8a870de14f33463180c3b9af4c8de Mon Sep 17 00:00:00 2001
From: Sivaprasad Tummala <sivaprasad.tummala@amd.com>
Date: Thu, 6 Jun 2024 11:27:46 +0000
Subject: [PATCH] app/testpmd: fix lcore ID restriction

[ upstream commit 2bf44dd14fa50fa95e090058ec83c2eb96b64ac5 ]

With modern CPUs, it is possible to have higher
CPU count thus we can have higher RTE_MAX_LCORES.
In testpmd application, the current config forwarding
cores option "--nb-cores" is hard limited to 255.

The patch fixes this constraint and also adjusts the lcore
data structure to 32-bit to align with rte lcore APIs.

Fixes: af75078fece3 ("first public release")

Signed-off-by: Sivaprasad Tummala <sivaprasad.tummala@amd.com>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 app/test-pmd/config.c     | 4 ++--
 app/test-pmd/parameters.c | 4 ++--
 app/test-pmd/testpmd.h    | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index dca5431b98..1a6d791129 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -4244,9 +4244,9 @@ fwd_stream_on_other_lcores(uint16_t domain_id, lcoreid_t src_lc,
 				continue;
 			printf("Shared Rx queue group %u queue %hu can't be scheduled on different cores:\n",
 			       share_group, share_rxq);
-			printf("  lcore %hhu Port %hu queue %hu\n",
+			printf("  lcore %u Port %hu queue %hu\n",
 			       src_lc, src_port, src_rxq);
-			printf("  lcore %hhu Port %hu queue %hu\n",
+			printf("  lcore %u Port %hu queue %hu\n",
 			       lc_id, fs->rx_port, fs->rx_queue);
 			printf("Please use --nb-cores=%hu to limit number of forwarding cores\n",
 			       nb_rxq);
diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index 2d0a782ee0..d6f07df789 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -864,8 +864,8 @@ launch_args_parse(int argc, char** argv)
 			}
 			if (!strcmp(lgopts[opt_idx].name, "nb-cores")) {
 				n = atoi(optarg);
-				if (n > 0 && n <= nb_lcores)
-					nb_fwd_lcores = (uint8_t) n;
+				if (n > 0 && (lcoreid_t)n <= nb_lcores)
+					nb_fwd_lcores = (lcoreid_t) n;
 				else
 					rte_exit(EXIT_FAILURE,
 						 "nb-cores should be > 0 and <= %d\n",
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index 022210a7a9..f7f3587c83 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -84,7 +84,7 @@ extern volatile uint8_t f_quit;
 /* Maximum number of pools supported per Rx queue */
 #define MAX_MEMPOOL 8
 
-typedef uint8_t  lcoreid_t;
+typedef uint32_t lcoreid_t;
 typedef uint16_t portid_t;
 typedef uint16_t queueid_t;
 typedef uint16_t streamid_t;
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:16.016814195 +0100
+++ 0040-app-testpmd-fix-lcore-ID-restriction.patch	2024-06-25 00:22:13.161185159 +0100
@@ -1 +1 @@
-From 2bf44dd14fa50fa95e090058ec83c2eb96b64ac5 Mon Sep 17 00:00:00 2001
+From a4a27aa3e0f8a870de14f33463180c3b9af4c8de Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 2bf44dd14fa50fa95e090058ec83c2eb96b64ac5 ]
+
@@ -15 +16,0 @@
-Cc: stable@dpdk.org
@@ -26 +27 @@
-index f62ba90c87..66c3a68c1d 100644
+index dca5431b98..1a6d791129 100644
@@ -29 +30 @@
-@@ -4782,9 +4782,9 @@ fwd_stream_on_other_lcores(uint16_t domain_id, lcoreid_t src_lc,
+@@ -4244,9 +4244,9 @@ fwd_stream_on_other_lcores(uint16_t domain_id, lcoreid_t src_lc,
@@ -42 +43 @@
-index c13f7564bf..22364e09ab 100644
+index 2d0a782ee0..d6f07df789 100644
@@ -45,11 +46,11 @@
-@@ -1071,8 +1071,8 @@ launch_args_parse(int argc, char** argv)
- 			break;
- 		case TESTPMD_OPT_NB_CORES_NUM:
- 			n = atoi(optarg);
--			if (n > 0 && n <= nb_lcores)
--				nb_fwd_lcores = (uint8_t) n;
-+			if (n > 0 && (lcoreid_t)n <= nb_lcores)
-+				nb_fwd_lcores = (lcoreid_t) n;
- 			else
- 				rte_exit(EXIT_FAILURE,
- 					"nb-cores should be > 0 and <= %d\n",
+@@ -864,8 +864,8 @@ launch_args_parse(int argc, char** argv)
+ 			}
+ 			if (!strcmp(lgopts[opt_idx].name, "nb-cores")) {
+ 				n = atoi(optarg);
+-				if (n > 0 && n <= nb_lcores)
+-					nb_fwd_lcores = (uint8_t) n;
++				if (n > 0 && (lcoreid_t)n <= nb_lcores)
++					nb_fwd_lcores = (lcoreid_t) n;
+ 				else
+ 					rte_exit(EXIT_FAILURE,
+ 						 "nb-cores should be > 0 and <= %d\n",
@@ -57 +58 @@
-index 0afae7d771..9facd7f281 100644
+index 022210a7a9..f7f3587c83 100644

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'hash: fix return code description in Doxygen' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (38 preceding siblings ...)
  2024-06-24 23:58 ` patch 'app/testpmd: fix lcore ID restriction' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'hash: check name when creating a hash' " luca.boccassi
                   ` (39 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Chenming Chang; +Cc: Stephen Hemminger, Vladimir Medvedkin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/07f2ecf7b3283f3637198795ff78d34ebf70c594

Thanks.

Luca Boccassi

---
From 07f2ecf7b3283f3637198795ff78d34ebf70c594 Mon Sep 17 00:00:00 2001
From: Chenming Chang <ccm@ccm.ink>
Date: Mon, 27 Jun 2022 21:11:21 +0800
Subject: [PATCH] hash: fix return code description in Doxygen

[ upstream commit 78a632e6b52c29c5f297001181e870750eee02a7 ]

The rte_hash lookup can return ZERO which is not a positive value.

Fixes: af75078fece3 ("first public release")

Signed-off-by: Chenming Chang <ccm@ccm.ink>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
---
 .mailmap            |  1 +
 lib/hash/rte_hash.h | 16 ++++++++--------
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/.mailmap b/.mailmap
index 8aca0a656e..7e7c1a75cb 100644
--- a/.mailmap
+++ b/.mailmap
@@ -215,6 +215,7 @@ Cheng Liu <liucheng11@huawei.com>
 Cheng Peng <cheng.peng5@zte.com.cn>
 Chengwen Feng <fengchengwen@huawei.com>
 Chenmin Sun <chenmin.sun@intel.com>
+Chenming Chang <ccm@ccm.ink>
 Chenxu Di <chenxux.di@intel.com>
 Cheryl Houser <chouser@vmware.com>
 Chinh T Cao <chinh.t.cao@intel.com>
diff --git a/lib/hash/rte_hash.h b/lib/hash/rte_hash.h
index a399346d02..51611e392b 100644
--- a/lib/hash/rte_hash.h
+++ b/lib/hash/rte_hash.h
@@ -287,7 +287,7 @@ rte_hash_add_key_with_hash_data(const struct rte_hash *h, const void *key,
  * @return
  *   - -EINVAL if the parameters are invalid.
  *   - -ENOSPC if there is no space in the hash for this key.
- *   - A positive value that can be used by the caller as an offset into an
+ *   - A non-negative value that can be used by the caller as an offset into an
  *     array of user data. This value is unique for this key. This
  *     unique key id may be larger than the user specified entry count
  *     when RTE_HASH_EXTRA_FLAGS_MULTI_WRITER_ADD flag is set.
@@ -311,7 +311,7 @@ rte_hash_add_key(const struct rte_hash *h, const void *key);
  * @return
  *   - -EINVAL if the parameters are invalid.
  *   - -ENOSPC if there is no space in the hash for this key.
- *   - A positive value that can be used by the caller as an offset into an
+ *   - A non-negative value that can be used by the caller as an offset into an
  *     array of user data. This value is unique for this key. This
  *     unique key ID may be larger than the user specified entry count
  *     when RTE_HASH_EXTRA_FLAGS_MULTI_WRITER_ADD flag is set.
@@ -342,7 +342,7 @@ rte_hash_add_key_with_hash(const struct rte_hash *h, const void *key, hash_sig_t
  * @return
  *   - -EINVAL if the parameters are invalid.
  *   - -ENOENT if the key is not found.
- *   - A positive value that can be used by the caller as an offset into an
+ *   - A non-negative value that can be used by the caller as an offset into an
  *     array of user data. This value is unique for this key, and is the same
  *     value that was returned when the key was added.
  */
@@ -374,7 +374,7 @@ rte_hash_del_key(const struct rte_hash *h, const void *key);
  * @return
  *   - -EINVAL if the parameters are invalid.
  *   - -ENOENT if the key is not found.
- *   - A positive value that can be used by the caller as an offset into an
+ *   - A non-negative value that can be used by the caller as an offset into an
  *     array of user data. This value is unique for this key, and is the same
  *     value that was returned when the key was added.
  */
@@ -441,7 +441,7 @@ rte_hash_free_key_with_position(const struct rte_hash *h,
  * @param data
  *   Output with pointer to data returned from the hash table.
  * @return
- *   - A positive value that can be used by the caller as an offset into an
+ *   - A non-negative value that can be used by the caller as an offset into an
  *     array of user data. This value is unique for this key, and is the same
  *     value that was returned when the key was added.
  *   - -EINVAL if the parameters are invalid.
@@ -466,7 +466,7 @@ rte_hash_lookup_data(const struct rte_hash *h, const void *key, void **data);
  * @param data
  *   Output with pointer to data returned from the hash table.
  * @return
- *   - A positive value that can be used by the caller as an offset into an
+ *   - A non-negative value that can be used by the caller as an offset into an
  *     array of user data. This value is unique for this key, and is the same
  *     value that was returned when the key was added.
  *   - -EINVAL if the parameters are invalid.
@@ -489,7 +489,7 @@ rte_hash_lookup_with_hash_data(const struct rte_hash *h, const void *key,
  * @return
  *   - -EINVAL if the parameters are invalid.
  *   - -ENOENT if the key is not found.
- *   - A positive value that can be used by the caller as an offset into an
+ *   - A non-negative value that can be used by the caller as an offset into an
  *     array of user data. This value is unique for this key, and is the same
  *     value that was returned when the key was added.
  */
@@ -511,7 +511,7 @@ rte_hash_lookup(const struct rte_hash *h, const void *key);
  * @return
  *   - -EINVAL if the parameters are invalid.
  *   - -ENOENT if the key is not found.
- *   - A positive value that can be used by the caller as an offset into an
+ *   - A non-negative value that can be used by the caller as an offset into an
  *     array of user data. This value is unique for this key, and is the same
  *     value that was returned when the key was added.
  */
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:16.066778136 +0100
+++ 0041-hash-fix-return-code-description-in-Doxygen.patch	2024-06-25 00:22:13.165185241 +0100
@@ -1 +1 @@
-From 78a632e6b52c29c5f297001181e870750eee02a7 Mon Sep 17 00:00:00 2001
+From 07f2ecf7b3283f3637198795ff78d34ebf70c594 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 78a632e6b52c29c5f297001181e870750eee02a7 ]
+
@@ -9 +10,0 @@
-Cc: stable@dpdk.org
@@ -20 +21 @@
-index 1aca379558..111dbb0ac3 100644
+index 8aca0a656e..7e7c1a75cb 100644
@@ -23 +24 @@
-@@ -228,6 +228,7 @@ Cheng Liu <liucheng11@huawei.com>
+@@ -215,6 +215,7 @@ Cheng Liu <liucheng11@huawei.com>
@@ -29 +29,0 @@
- Chenyu Huang <chenyux.huang@intel.com>
@@ -30,0 +31 @@
+ Chinh T Cao <chinh.t.cao@intel.com>
@@ -32 +33 @@
-index 7ecc021111..ba96521529 100644
+index a399346d02..51611e392b 100644
@@ -35 +36 @@
-@@ -286,7 +286,7 @@ rte_hash_add_key_with_hash_data(const struct rte_hash *h, const void *key,
+@@ -287,7 +287,7 @@ rte_hash_add_key_with_hash_data(const struct rte_hash *h, const void *key,
@@ -44 +45 @@
-@@ -310,7 +310,7 @@ rte_hash_add_key(const struct rte_hash *h, const void *key);
+@@ -311,7 +311,7 @@ rte_hash_add_key(const struct rte_hash *h, const void *key);
@@ -53 +54 @@
-@@ -341,7 +341,7 @@ rte_hash_add_key_with_hash(const struct rte_hash *h, const void *key, hash_sig_t
+@@ -342,7 +342,7 @@ rte_hash_add_key_with_hash(const struct rte_hash *h, const void *key, hash_sig_t
@@ -62 +63 @@
-@@ -373,7 +373,7 @@ rte_hash_del_key(const struct rte_hash *h, const void *key);
+@@ -374,7 +374,7 @@ rte_hash_del_key(const struct rte_hash *h, const void *key);
@@ -71 +72 @@
-@@ -440,7 +440,7 @@ rte_hash_free_key_with_position(const struct rte_hash *h,
+@@ -441,7 +441,7 @@ rte_hash_free_key_with_position(const struct rte_hash *h,
@@ -80 +81 @@
-@@ -465,7 +465,7 @@ rte_hash_lookup_data(const struct rte_hash *h, const void *key, void **data);
+@@ -466,7 +466,7 @@ rte_hash_lookup_data(const struct rte_hash *h, const void *key, void **data);
@@ -89 +90 @@
-@@ -488,7 +488,7 @@ rte_hash_lookup_with_hash_data(const struct rte_hash *h, const void *key,
+@@ -489,7 +489,7 @@ rte_hash_lookup_with_hash_data(const struct rte_hash *h, const void *key,
@@ -98 +99 @@
-@@ -510,7 +510,7 @@ rte_hash_lookup(const struct rte_hash *h, const void *key);
+@@ -511,7 +511,7 @@ rte_hash_lookup(const struct rte_hash *h, const void *key);

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'hash: check name when creating a hash' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (39 preceding siblings ...)
  2024-06-24 23:58 ` patch 'hash: fix return code description in Doxygen' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'mempool: replace GCC pragma with cast' " luca.boccassi
                   ` (38 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Conor Fogarty; +Cc: Vladimir Medvedkin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/a28f53ce9a26ccb18f747b8388f821c615e1d2a9

Thanks.

Luca Boccassi

---
From a28f53ce9a26ccb18f747b8388f821c615e1d2a9 Mon Sep 17 00:00:00 2001
From: Conor Fogarty <conor.fogarty@intel.com>
Date: Thu, 6 Jul 2023 16:26:26 +0100
Subject: [PATCH] hash: check name when creating a hash

[ upstream commit 8f36e53317ecf8384461e4f692e46beaaf6c4d2f ]

Add NULL pointer check to params->name, which is later
copied into the hash datastructure. Without this check
the code segfaults on the strlcpy() of a NULL pointer.

Fixes: 48a399119619 ("hash: replace with cuckoo hash implementation")

Signed-off-by: Conor Fogarty <conor.fogarty@intel.com>
Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
---
 lib/hash/rte_cuckoo_hash.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/hash/rte_cuckoo_hash.c b/lib/hash/rte_cuckoo_hash.c
index a08b5dd875..13c8337519 100644
--- a/lib/hash/rte_cuckoo_hash.c
+++ b/lib/hash/rte_cuckoo_hash.c
@@ -166,6 +166,7 @@ rte_hash_create(const struct rte_hash_parameters *params)
 	/* Check for valid parameters */
 	if ((params->entries > RTE_HASH_ENTRIES_MAX) ||
 			(params->entries < RTE_HASH_BUCKET_ENTRIES) ||
+			(params->name == NULL) ||
 			(params->key_len == 0)) {
 		rte_errno = EINVAL;
 		RTE_LOG(ERR, HASH, "rte_hash_create has invalid parameters\n");
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:16.110038637 +0100
+++ 0042-hash-check-name-when-creating-a-hash.patch	2024-06-25 00:22:13.165185241 +0100
@@ -1 +1 @@
-From 8f36e53317ecf8384461e4f692e46beaaf6c4d2f Mon Sep 17 00:00:00 2001
+From a28f53ce9a26ccb18f747b8388f821c615e1d2a9 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 8f36e53317ecf8384461e4f692e46beaaf6c4d2f ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org
@@ -20 +21 @@
-index b31a3d973e..16c9c4c5c4 100644
+index a08b5dd875..13c8337519 100644
@@ -23 +24 @@
-@@ -173,6 +173,7 @@ rte_hash_create(const struct rte_hash_parameters *params)
+@@ -166,6 +166,7 @@ rte_hash_create(const struct rte_hash_parameters *params)
@@ -30 +31 @@
- 		HASH_LOG(ERR, "%s has invalid parameters", __func__);
+ 		RTE_LOG(ERR, HASH, "rte_hash_create has invalid parameters\n");

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'mempool: replace GCC pragma with cast' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (40 preceding siblings ...)
  2024-06-24 23:58 ` patch 'hash: check name when creating a hash' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'vhost: fix build with GCC 13' " luca.boccassi
                   ` (37 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Tyler Retzlaff, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/9cdf5aecb261e85cc3ae75eda57a34c7a201b3d5

Thanks.

Luca Boccassi

---
From 9cdf5aecb261e85cc3ae75eda57a34c7a201b3d5 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Mon, 1 Apr 2024 10:01:52 -0700
Subject: [PATCH] mempool: replace GCC pragma with cast

[ upstream commit 23dc03f67279f6ced3dafd2e4c76c1b67a0102dc ]

Building mempool with MSVC generates a warning
because of this pragma (same with clang when debug is enabled).
The issue the pragma was working around can be better solved
by using an additional cast.

Fixes: af75078fece3 ("first public release")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 lib/mempool/rte_mempool.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/lib/mempool/rte_mempool.c b/lib/mempool/rte_mempool.c
index 3de857abf5..258754cf67 100644
--- a/lib/mempool/rte_mempool.c
+++ b/lib/mempool/rte_mempool.c
@@ -1054,10 +1054,6 @@ rte_mempool_dump_cache(FILE *f, const struct rte_mempool *mp)
 	return count;
 }
 
-#ifndef __INTEL_COMPILER
-#pragma GCC diagnostic ignored "-Wcast-qual"
-#endif
-
 /* check and update cookies or panic (internal) */
 void rte_mempool_check_cookies(const struct rte_mempool *mp,
 	void * const *obj_table_const, unsigned n, int free)
@@ -1072,7 +1068,7 @@ void rte_mempool_check_cookies(const struct rte_mempool *mp,
 
 	/* Force to drop the "const" attribute. This is done only when
 	 * DEBUG is enabled */
-	tmp = (void *) obj_table_const;
+	tmp = (void *)(uintptr_t)obj_table_const;
 	obj_table = tmp;
 
 	while (n--) {
@@ -1181,10 +1177,6 @@ mempool_audit_cookies(struct rte_mempool *mp)
 #define mempool_audit_cookies(mp) do {} while(0)
 #endif
 
-#ifndef __INTEL_COMPILER
-#pragma GCC diagnostic error "-Wcast-qual"
-#endif
-
 /* check cookies before and after objects */
 static void
 mempool_audit_cache(const struct rte_mempool *mp)
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:16.153274784 +0100
+++ 0043-mempool-replace-GCC-pragma-with-cast.patch	2024-06-25 00:22:13.165185241 +0100
@@ -1 +1 @@
-From 23dc03f67279f6ced3dafd2e4c76c1b67a0102dc Mon Sep 17 00:00:00 2001
+From 9cdf5aecb261e85cc3ae75eda57a34c7a201b3d5 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 23dc03f67279f6ced3dafd2e4c76c1b67a0102dc ]
+
@@ -20 +22 @@
-index 7a98441a87..ff67fe4181 100644
+index 3de857abf5..258754cf67 100644
@@ -23 +25 @@
-@@ -1056,10 +1056,6 @@ rte_mempool_dump_cache(FILE *f, const struct rte_mempool *mp)
+@@ -1054,10 +1054,6 @@ rte_mempool_dump_cache(FILE *f, const struct rte_mempool *mp)
@@ -34 +36 @@
-@@ -1074,7 +1070,7 @@ void rte_mempool_check_cookies(const struct rte_mempool *mp,
+@@ -1072,7 +1068,7 @@ void rte_mempool_check_cookies(const struct rte_mempool *mp,
@@ -43 +45 @@
-@@ -1183,10 +1179,6 @@ mempool_audit_cookies(struct rte_mempool *mp)
+@@ -1181,10 +1177,6 @@ mempool_audit_cookies(struct rte_mempool *mp)

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'vhost: fix build with GCC 13' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (41 preceding siblings ...)
  2024-06-24 23:58 ` patch 'mempool: replace GCC pragma with cast' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'vhost: cleanup resubmit info before inflight setup' " luca.boccassi
                   ` (36 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Luca Vizzarro
  Cc: Paul Szczepanek, Nick Connolly, Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/6267610fffce83f71ac52256964bb737b1d6400c

Thanks.

Luca Boccassi

---
From 6267610fffce83f71ac52256964bb737b1d6400c Mon Sep 17 00:00:00 2001
From: Luca Vizzarro <luca.vizzarro@arm.com>
Date: Wed, 10 Apr 2024 16:21:01 +0100
Subject: [PATCH] vhost: fix build with GCC 13
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit 8db1acabeea3fa4b0c673588cfff2b01e0ae9615 ]

This patch resolves a build error with GCC 13 and arm/aarch32 as
targets:

In function ‘mbuf_to_desc’,
    inlined from ‘vhost_enqueue_async_packed’ at
      ../lib/vhost/virtio_net.c:1828:6,
    inlined from ‘virtio_dev_rx_async_packed’ at
      ../lib/vhost/virtio_net.c:1842:6,
    inlined from ‘virtio_dev_rx_async_submit_packed’ at
      ../lib/vhost/virtio_net.c:1900:7:
../lib/vhost/virtio_net.c:1159:18: error: ‘buf_vec[0].buf_addr’ may
    be used uninitialized [-Werror=maybe-uninitialized]
 1159 |         buf_addr = buf_vec[vec_idx].buf_addr;
      |         ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
<snip>
../lib/vhost/virtio_net.c:1160:18: error: ‘buf_vec[0].buf_iova’ may
    be used uninitialized [-Werror=maybe-uninitialized]
 1160 |         buf_iova = buf_vec[vec_idx].buf_iova;
      |         ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
<snip>
../lib/vhost/virtio_net.c:1161:35: error: ‘buf_vec[0].buf_len’ may
    be used uninitialized [-Werror=maybe-uninitialized]
 1161 |         buf_len = buf_vec[vec_idx].buf_len;
      |                   ~~~~~~~~~~~~~~~~^~~~~~~~

GCC complains about the possible runtime path where the while loop
which fills buf_vec (in vhost_enqueue_async_packed) is not run. As a
consequence it correctly thinks that buf_vec is not initialized while
being accessed anyways.

This scenario is actually very unlikely as the only way this can occur
is if size has overflowed to 0. Meaning that the total packet length
would be close to UINT64_MAX (or actually UINT32_MAX). At first glance,
the code suggests that this may never happen as the type of size has
been changed to 64-bit. For a 32-bit architecture such as arm
(e.g. armv7-a) and aarch32, this still happens because the operand types
(pkt->pkt_len and sizeof) are 32-bit wide, performing 32-bit arithmetic
first (where the overflow can happen) and widening to 64-bit later.

The proposed fix simply guarantees to the compiler that the scope which
fills buf_vec is accessed at least once, while not disrupting the actual
logic. This is based on the assumption that size will always be greater
than 0, as suggested by the sizeof, and the packet length will never be
as big as UINT32_MAX, and causing an overflow.

Fixes: 873e8dad6f49 ("vhost: support packed ring in async datapath")

Signed-off-by: Luca Vizzarro <luca.vizzarro@arm.com>
Reviewed-by: Paul Szczepanek <paul.szczepanek@arm.com>
Reviewed-by: Nick Connolly <nick.connolly@arm.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 .mailmap               | 2 +-
 lib/vhost/virtio_net.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/.mailmap b/.mailmap
index 7e7c1a75cb..1c0d974460 100644
--- a/.mailmap
+++ b/.mailmap
@@ -983,7 +983,7 @@ Nemanja Marjanovic <nemanja.marjanovic@intel.com>
 Netanel Belgazal <netanel@amazon.com>
 Netanel Gonen <netanelg@mellanox.com>
 Niall Power <niall.power@intel.com>
-Nick Connolly <nick.connolly@mayadata.io>
+Nick Connolly <nick.connolly@arm.com> <nick.connolly@mayadata.io>
 Nick Nunley <nicholas.d.nunley@intel.com>
 Niclas Storm <niclas.storm@ericsson.com>
 Nicolas Chautru <nicolas.chautru@intel.com>
diff --git a/lib/vhost/virtio_net.c b/lib/vhost/virtio_net.c
index 3061275753..9f314f83c7 100644
--- a/lib/vhost/virtio_net.c
+++ b/lib/vhost/virtio_net.c
@@ -1796,7 +1796,7 @@ vhost_enqueue_async_packed(struct virtio_net *dev,
 	else
 		max_tries = 1;
 
-	while (size > 0) {
+	do {
 		/*
 		 * if we tried all available ring items, and still
 		 * can't get enough buf, it means something abnormal
@@ -1823,7 +1823,7 @@ vhost_enqueue_async_packed(struct virtio_net *dev,
 		avail_idx += desc_count;
 		if (avail_idx >= vq->size)
 			avail_idx -= vq->size;
-	}
+	} while (size > 0);
 
 	if (unlikely(mbuf_to_desc(dev, vq, pkt, buf_vec, nr_vec, *nr_buffers, true) < 0))
 		return -1;
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:16.195109621 +0100
+++ 0044-vhost-fix-build-with-GCC-13.patch	2024-06-25 00:22:13.169185323 +0100
@@ -1 +1 @@
-From 8db1acabeea3fa4b0c673588cfff2b01e0ae9615 Mon Sep 17 00:00:00 2001
+From 6267610fffce83f71ac52256964bb737b1d6400c Mon Sep 17 00:00:00 2001
@@ -8,0 +9,2 @@
+[ upstream commit 8db1acabeea3fa4b0c673588cfff2b01e0ae9615 ]
+
@@ -55 +56,0 @@
-Cc: stable@dpdk.org
@@ -67 +68 @@
-index 111dbb0ac3..ed63605a15 100644
+index 7e7c1a75cb..1c0d974460 100644
@@ -70 +71,2 @@
-@@ -1030,7 +1030,7 @@ Netanel Belgazal <netanel@amazon.com>
+@@ -983,7 +983,7 @@ Nemanja Marjanovic <nemanja.marjanovic@intel.com>
+ Netanel Belgazal <netanel@amazon.com>
@@ -73 +74,0 @@
- Nicholas Pratte <npratte@iol.unh.edu>
@@ -80 +81 @@
-index b406b5d7d9..370402d849 100644
+index 3061275753..9f314f83c7 100644
@@ -83 +84 @@
-@@ -1935,7 +1935,7 @@ vhost_enqueue_async_packed(struct virtio_net *dev,
+@@ -1796,7 +1796,7 @@ vhost_enqueue_async_packed(struct virtio_net *dev,
@@ -92 +93 @@
-@@ -1962,7 +1962,7 @@ vhost_enqueue_async_packed(struct virtio_net *dev,
+@@ -1823,7 +1823,7 @@ vhost_enqueue_async_packed(struct virtio_net *dev,

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'vhost: cleanup resubmit info before inflight setup' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (42 preceding siblings ...)
  2024-06-24 23:58 ` patch 'vhost: fix build with GCC 13' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'net/virtio: fix MAC table update' " luca.boccassi
                   ` (35 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Haoqian He; +Cc: Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/aff6953d46a68165eddc631154cb687e7f646cac

Thanks.

Luca Boccassi

---
From aff6953d46a68165eddc631154cb687e7f646cac Mon Sep 17 00:00:00 2001
From: Haoqian He <haoqian.he@smartx.com>
Date: Fri, 26 Apr 2024 07:09:46 -0400
Subject: [PATCH] vhost: cleanup resubmit info before inflight setup
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit e4a01eea66326c58593906e189b376605a0ec606 ]

This patch fixes a potential VM hang bug when the VM reboots after
vhost live recovery due to missing cleanup virtqueue resubmit info.

Specifically, if inflight IO that should be resubmitted during
the latest vhost reconnection has not been submitted yet while
VM rebooting, so GET_VRING_BASE would not wait for the inflight
IO, at this time the resubmit info has been.  When the VM restarts,
SET_VRING_KICK will resubmit the inflight IO (If resubmit info
is not null, function set_vring_kick will return without updating
resubmit info).

It’s an error, any stale inflight IO should not be resubmitted
after the VM restart.

The solution is to clean up virtqueue resubmit info when function
set_inflight_fd before function set_vring_kick.

Fixes: ad0a4ae491fe ("vhost: checkout resubmit inflight information")

Signed-off-by: Haoqian He <haoqian.he@smartx.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 .mailmap               | 1 +
 lib/vhost/vhost_user.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/.mailmap b/.mailmap
index 1c0d974460..2724a689fd 100644
--- a/.mailmap
+++ b/.mailmap
@@ -473,6 +473,7 @@ Hanoch Haim <hhaim@cisco.com>
 Hanumanth Pothula <hpothula@marvell.com>
 Hao Chen <chenhao164@huawei.com>
 Hao Wu <hao.wu@intel.com>
+Haoqian He <haoqian.he@smartx.com>
 Hari Kumar Vemula <hari.kumarx.vemula@intel.com>
 Harini Ramakrishnan <harini.ramakrishnan@microsoft.com>
 Hariprasad Govindharajan <hariprasad.govindharajan@intel.com>
diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c
index 66ab68fa56..8d7d04059c 100644
--- a/lib/vhost/vhost_user.c
+++ b/lib/vhost/vhost_user.c
@@ -1745,6 +1745,7 @@ vhost_user_set_inflight_fd(struct virtio_net **pdev,
 		if (!vq)
 			continue;
 
+		cleanup_vq_inflight(dev, vq);
 		if (vq_is_packed(dev)) {
 			vq->inflight_packed = addr;
 			vq->inflight_packed->desc_num = queue_size;
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:16.241753554 +0100
+++ 0045-vhost-cleanup-resubmit-info-before-inflight-setup.patch	2024-06-25 00:22:13.173185404 +0100
@@ -1 +1 @@
-From e4a01eea66326c58593906e189b376605a0ec606 Mon Sep 17 00:00:00 2001
+From aff6953d46a68165eddc631154cb687e7f646cac Mon Sep 17 00:00:00 2001
@@ -8,0 +9,2 @@
+[ upstream commit e4a01eea66326c58593906e189b376605a0ec606 ]
+
@@ -27 +28,0 @@
-Cc: stable@dpdk.org
@@ -37 +38 @@
-index ed63605a15..ff20619bfb 100644
+index 1c0d974460..2724a689fd 100644
@@ -40 +41 @@
-@@ -495,6 +495,7 @@ Hanoch Haim <hhaim@cisco.com>
+@@ -473,6 +473,7 @@ Hanoch Haim <hhaim@cisco.com>
@@ -42 +43 @@
- Hao Chen <chenh@yusur.tech> <chenhao164@huawei.com>
+ Hao Chen <chenhao164@huawei.com>
@@ -49 +50 @@
-index 414192500e..7c54afc5fb 100644
+index 66ab68fa56..8d7d04059c 100644
@@ -52 +53 @@
-@@ -1871,6 +1871,7 @@ vhost_user_set_inflight_fd(struct virtio_net **pdev,
+@@ -1745,6 +1745,7 @@ vhost_user_set_inflight_fd(struct virtio_net **pdev,

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/virtio: fix MAC table update' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (43 preceding siblings ...)
  2024-06-24 23:58 ` patch 'vhost: cleanup resubmit info before inflight setup' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'baseband/acc: fix memory barrier' " luca.boccassi
                   ` (34 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Satha Rao; +Cc: Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/48fb2f00d848ab9e9dc5ef15f3e343034c5bcf94

Thanks.

Luca Boccassi

---
From 48fb2f00d848ab9e9dc5ef15f3e343034c5bcf94 Mon Sep 17 00:00:00 2001
From: Satha Rao <skoteshwar@marvell.com>
Date: Thu, 30 May 2024 13:40:39 -0400
Subject: [PATCH] net/virtio: fix MAC table update

[ upstream commit 7698e655516c54558a43b8aaed1bff69928d96fb ]

Don't send NULL MAC addresses in MAC table update.

Fixes: 1b306359e58c ("virtio: suport multiple MAC addresses")

Signed-off-by: Satha Rao <skoteshwar@marvell.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 drivers/net/virtio/virtio_ethdev.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 073bbf482d..1d9a168f92 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -1320,6 +1320,8 @@ virtio_mac_addr_add(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr,
 		struct virtio_net_ctrl_mac *tbl
 			= rte_is_multicast_ether_addr(addr) ? mc : uc;
 
+		if (rte_is_zero_ether_addr(addr))
+			break;
 		memcpy(&tbl->macs[tbl->entries++], addr, RTE_ETHER_ADDR_LEN);
 	}
 
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:16.288104719 +0100
+++ 0046-net-virtio-fix-MAC-table-update.patch	2024-06-25 00:22:13.177185486 +0100
@@ -1 +1 @@
-From 7698e655516c54558a43b8aaed1bff69928d96fb Mon Sep 17 00:00:00 2001
+From 48fb2f00d848ab9e9dc5ef15f3e343034c5bcf94 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 7698e655516c54558a43b8aaed1bff69928d96fb ]
+
@@ -9 +10,0 @@
-Cc: stable@dpdk.org
@@ -18 +19 @@
-index 517585740e..70d4839def 100644
+index 073bbf482d..1d9a168f92 100644
@@ -21 +22 @@
-@@ -913,6 +913,8 @@ virtio_mac_addr_add(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr,
+@@ -1320,6 +1320,8 @@ virtio_mac_addr_add(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr,

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'baseband/acc: fix memory barrier' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (44 preceding siblings ...)
  2024-06-24 23:58 ` patch 'net/virtio: fix MAC table update' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'event/sw: fix warning from useless snprintf' " luca.boccassi
                   ` (33 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Hernan Vargas; +Cc: Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/d47135efe7ed109c90c806899b4a6c7f022388b4

Thanks.

Luca Boccassi

---
From d47135efe7ed109c90c806899b4a6c7f022388b4 Mon Sep 17 00:00:00 2001
From: Hernan Vargas <hernan.vargas@intel.com>
Date: Thu, 2 May 2024 13:45:44 -0700
Subject: [PATCH] baseband/acc: fix memory barrier

[ upstream commit 0a200a3a29017f6b01a481776a571a75e03a32ce ]

Moving memory barrier so that dequeue thread can be in sync with enqueue
thread.

Fixes: 32e8b7ea35dd ("baseband/acc100: refactor to segregate common code")

Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 drivers/baseband/acc/acc_common.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/baseband/acc/acc_common.h b/drivers/baseband/acc/acc_common.h
index 9336d3fbcf..7ea3cc9a02 100644
--- a/drivers/baseband/acc/acc_common.h
+++ b/drivers/baseband/acc/acc_common.h
@@ -964,6 +964,9 @@ acc_dma_enqueue(struct acc_queue *q, uint16_t n,
 				req_elem_addr,
 				(void *)q->mmio_reg_enqueue);
 
+		q->aq_enqueued++;
+		q->sw_ring_head += enq_batch_size;
+
 		rte_wmb();
 
 #ifdef RTE_BBDEV_OFFLOAD_COST
@@ -978,8 +981,6 @@ acc_dma_enqueue(struct acc_queue *q, uint16_t n,
 				rte_rdtsc_precise() - start_time;
 #endif
 
-		q->aq_enqueued++;
-		q->sw_ring_head += enq_batch_size;
 		n -= enq_batch_size;
 
 	} while (n);
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:16.331479882 +0100
+++ 0047-baseband-acc-fix-memory-barrier.patch	2024-06-25 00:22:13.177185486 +0100
@@ -1 +1 @@
-From 0a200a3a29017f6b01a481776a571a75e03a32ce Mon Sep 17 00:00:00 2001
+From d47135efe7ed109c90c806899b4a6c7f022388b4 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 0a200a3a29017f6b01a481776a571a75e03a32ce ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -19 +20 @@
-index fddeb0737b..e249f37e38 100644
+index 9336d3fbcf..7ea3cc9a02 100644
@@ -22 +23 @@
-@@ -1112,6 +1112,9 @@ acc_dma_enqueue(struct acc_queue *q, uint16_t n,
+@@ -964,6 +964,9 @@ acc_dma_enqueue(struct acc_queue *q, uint16_t n,
@@ -31,4 +32,4 @@
- 		/* Start time measurement for enqueue function offload. */
-@@ -1122,8 +1125,6 @@ acc_dma_enqueue(struct acc_queue *q, uint16_t n,
- 
- 		queue_stats->acc_offload_cycles += rte_rdtsc_precise() - start_time;
+ #ifdef RTE_BBDEV_OFFLOAD_COST
+@@ -978,8 +981,6 @@ acc_dma_enqueue(struct acc_queue *q, uint16_t n,
+ 				rte_rdtsc_precise() - start_time;
+ #endif

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'event/sw: fix warning from useless snprintf' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (45 preceding siblings ...)
  2024-06-24 23:58 ` patch 'baseband/acc: fix memory barrier' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'eventdev/crypto: fix opaque field handling' " luca.boccassi
                   ` (32 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Harry van Haaren, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/ae651a5adb9e83ccef322c2a1f125585ab4dde74

Thanks.

Luca Boccassi

---
From ae651a5adb9e83ccef322c2a1f125585ab4dde74 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Tue, 23 Apr 2024 20:45:40 -0700
Subject: [PATCH] event/sw: fix warning from useless snprintf

[ upstream commit 510e2b655b46d91d3cc189882e6392afdc0363ff ]

With GCC-14, this warning is generated:
drivers/event/sw/sw_evdev.c:263:3: warning:
    snprintf' will always be truncated;
    specified size is 12, but format string expands to at least 13
        snprintf(buf, sizeof(buf), "sw%d_iq_%d_rob", dev_id, i);
        ^

Yet the whole printf to the buf is unnecessary. The type string argument
has never been implemented, and should just be NULL.  Removing the
unnecessary snprintf, then means IQ_ROB_NAMESIZE can be removed.

Fixes: 5ffb2f142d95 ("event/sw: support event queues")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
---
 drivers/event/sw/iq_chunk.h | 2 --
 drivers/event/sw/sw_evdev.c | 5 +----
 2 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/event/sw/iq_chunk.h b/drivers/event/sw/iq_chunk.h
index 31d013eab7..7820815c38 100644
--- a/drivers/event/sw/iq_chunk.h
+++ b/drivers/event/sw/iq_chunk.h
@@ -9,8 +9,6 @@
 #include <stdbool.h>
 #include <rte_eventdev.h>
 
-#define IQ_ROB_NAMESIZE 12
-
 struct sw_queue_chunk {
 	struct rte_event events[SW_EVS_PER_Q_CHUNK];
 	struct sw_queue_chunk *next;
diff --git a/drivers/event/sw/sw_evdev.c b/drivers/event/sw/sw_evdev.c
index 2a2763ee9b..09200c9188 100644
--- a/drivers/event/sw/sw_evdev.c
+++ b/drivers/event/sw/sw_evdev.c
@@ -228,9 +228,7 @@ qid_init(struct sw_evdev *sw, unsigned int idx, int type,
 		const struct rte_event_queue_conf *queue_conf)
 {
 	unsigned int i;
-	int dev_id = sw->data->dev_id;
 	int socket_id = sw->data->socket_id;
-	char buf[IQ_ROB_NAMESIZE];
 	struct sw_qid *qid = &sw->qids[idx];
 
 	/* Initialize the FID structures to no pinning (-1), and zero packets */
@@ -260,8 +258,7 @@ qid_init(struct sw_evdev *sw, unsigned int idx, int type,
 			goto cleanup;
 		}
 
-		snprintf(buf, sizeof(buf), "sw%d_iq_%d_rob", dev_id, i);
-		qid->reorder_buffer = rte_zmalloc_socket(buf,
+		qid->reorder_buffer = rte_zmalloc_socket(NULL,
 				window_size * sizeof(qid->reorder_buffer[0]),
 				0, socket_id);
 		if (!qid->reorder_buffer) {
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:16.373261981 +0100
+++ 0048-event-sw-fix-warning-from-useless-snprintf.patch	2024-06-25 00:22:13.177185486 +0100
@@ -1 +1 @@
-From 510e2b655b46d91d3cc189882e6392afdc0363ff Mon Sep 17 00:00:00 2001
+From ae651a5adb9e83ccef322c2a1f125585ab4dde74 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 510e2b655b46d91d3cc189882e6392afdc0363ff ]
+
@@ -18 +19,0 @@
-Cc: stable@dpdk.org
@@ -28 +29 @@
-index 7a7a8782e6..e638142dbc 100644
+index 31d013eab7..7820815c38 100644
@@ -37 +38 @@
- struct __rte_cache_aligned sw_queue_chunk {
+ struct sw_queue_chunk {
@@ -41 +42 @@
-index 1c01b069fe..19a52afc7d 100644
+index 2a2763ee9b..09200c9188 100644

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'eventdev/crypto: fix opaque field handling' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (46 preceding siblings ...)
  2024-06-24 23:58 ` patch 'event/sw: fix warning from useless snprintf' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'eal: fix logs for '--lcores'' " luca.boccassi
                   ` (31 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Ganapati Kundapura; +Cc: Abhinandan Gujjar, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/55754590621b079ecf0d2f458309c42be4c0907a

Thanks.

Luca Boccassi

---
From 55754590621b079ecf0d2f458309c42be4c0907a Mon Sep 17 00:00:00 2001
From: Ganapati Kundapura <ganapati.kundapura@intel.com>
Date: Thu, 6 Jun 2024 08:48:00 -0500
Subject: [PATCH] eventdev/crypto: fix opaque field handling

[ upstream commit ad12d08f05db8323ac1fb655b75dcef69e536a04 ]

For session-less crypto operations, event info is contained in
crypto op metadata for each event which is restored in event
from the crypto op metadata response info.

For session based crypto operations, crypto op contains per session
based event info in crypto op metadata. If any PMD passes any
implementation specific data in "struct rte_event::impl_opaque"
on each event, it's not getting restored.

This patch stores "struct rte_event::impl_opaque" in mbuf dynamic
field before enqueueing to cryptodev and restores
"struct rte_event::impl_opaque" from mbuf dynamic field after
dequeueing crypto op from cryptodev for session based crypto operations.

Fixes: 7901eac3409a ("eventdev: add crypto adapter implementation")

Signed-off-by: Ganapati Kundapura <ganapati.kundapura@intel.com>
Acked-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
---
 lib/eventdev/rte_event_crypto_adapter.c | 68 +++++++++++++++++++++++++
 1 file changed, 68 insertions(+)

diff --git a/lib/eventdev/rte_event_crypto_adapter.c b/lib/eventdev/rte_event_crypto_adapter.c
index a25316a43a..258be0f339 100644
--- a/lib/eventdev/rte_event_crypto_adapter.c
+++ b/lib/eventdev/rte_event_crypto_adapter.c
@@ -131,6 +131,28 @@ static struct event_crypto_adapter **event_crypto_adapter;
 	} \
 } while (0)
 
+#define ECA_DYNFIELD_NAME "eca_ev_opaque_data"
+/* Device-specific metadata field type */
+typedef uint8_t eca_dynfield_t;
+
+/* mbuf dynamic field offset for device-specific metadata */
+int eca_dynfield_offset = -1;
+
+static int
+eca_dynfield_register(void)
+{
+	static const struct rte_mbuf_dynfield eca_dynfield_desc = {
+		.name = ECA_DYNFIELD_NAME,
+		.size = sizeof(eca_dynfield_t),
+		.align = __alignof__(eca_dynfield_t),
+		.flags = 0,
+	};
+
+	eca_dynfield_offset =
+		rte_mbuf_dynfield_register(&eca_dynfield_desc);
+	return eca_dynfield_offset;
+}
+
 static inline int
 eca_valid_id(uint8_t id)
 {
@@ -492,6 +514,25 @@ eca_enq_to_cryptodev(struct event_crypto_adapter *adapter, struct rte_event *ev,
 		crypto_op = ev[i].event_ptr;
 		if (crypto_op == NULL)
 			continue;
+
+		/** "struct rte_event::impl_opaque" field passed on from
+		 *  eventdev PMD could have different value per event.
+		 *  For session-based crypto operations retain
+		 *  "struct rte_event::impl_opaque" into mbuf dynamic field and
+		 *  restore it back after copying event information from
+		 *  session event metadata.
+		 *  For session-less, each crypto operation carries event
+		 *  metadata and retains "struct rte_event:impl_opaque"
+		 *  information to be passed back to eventdev PMD.
+		 */
+		if (crypto_op->sess_type == RTE_CRYPTO_OP_WITH_SESSION) {
+			struct rte_mbuf *mbuf = crypto_op->sym->m_src;
+
+			*RTE_MBUF_DYNFIELD(mbuf,
+					eca_dynfield_offset,
+					eca_dynfield_t *) = ev[i].impl_opaque;
+		}
+
 		m_data = rte_cryptodev_session_event_mdata_get(crypto_op);
 		if (m_data == NULL) {
 			rte_pktmbuf_free(crypto_op->sym->m_src);
@@ -658,6 +699,21 @@ eca_ops_enqueue_burst(struct event_crypto_adapter *adapter,
 
 		rte_memcpy(ev, &m_data->response_info, sizeof(*ev));
 		ev->event_ptr = ops[i];
+
+		/** Restore "struct rte_event::impl_opaque" from mbuf
+		 *  dynamic field for session based crypto operation.
+		 *  For session-less, each crypto operations carries event
+		 *  metadata and retains "struct rte_event::impl_opaque"
+		 *  information to be passed back to eventdev PMD.
+		 */
+		if (ops[i]->sess_type == RTE_CRYPTO_OP_WITH_SESSION) {
+			struct rte_mbuf *mbuf = ops[i]->sym->m_src;
+
+			ev->impl_opaque = *RTE_MBUF_DYNFIELD(mbuf,
+							eca_dynfield_offset,
+							eca_dynfield_t *);
+		}
+
 		ev->event_type = RTE_EVENT_TYPE_CRYPTODEV;
 		if (adapter->implicit_release_disabled)
 			ev->op = RTE_EVENT_OP_FORWARD;
@@ -882,6 +938,18 @@ eca_init_service(struct event_crypto_adapter *adapter, uint8_t id)
 
 	adapter->max_nb = adapter_conf.max_nb;
 	adapter->event_port_id = adapter_conf.event_port_id;
+
+	/** Register for mbuf dyn field to store/restore
+	 *  "struct rte_event::impl_opaque"
+	 */
+	eca_dynfield_offset = eca_dynfield_register();
+	if (eca_dynfield_offset  < 0) {
+		RTE_EDEV_LOG_ERR("Failed to register eca mbuf dyn field");
+		eca_circular_buffer_free(&adapter->ebuf);
+		rte_free(adapter);
+		return -EINVAL;
+	}
+
 	adapter->service_inited = 1;
 
 	return ret;
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:16.416677107 +0100
+++ 0049-eventdev-crypto-fix-opaque-field-handling.patch	2024-06-25 00:22:13.181185567 +0100
@@ -1 +1 @@
-From ad12d08f05db8323ac1fb655b75dcef69e536a04 Mon Sep 17 00:00:00 2001
+From 55754590621b079ecf0d2f458309c42be4c0907a Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit ad12d08f05db8323ac1fb655b75dcef69e536a04 ]
+
@@ -21 +22,0 @@
-Cc: stable@dpdk.org
@@ -30 +31 @@
-index db1c7f3906..939ca1cad9 100644
+index a25316a43a..258be0f339 100644
@@ -33 +34 @@
-@@ -138,6 +138,28 @@ static struct event_crypto_adapter **event_crypto_adapter;
+@@ -131,6 +131,28 @@ static struct event_crypto_adapter **event_crypto_adapter;
@@ -50 +51 @@
-+		.align = alignof(eca_dynfield_t),
++		.align = __alignof__(eca_dynfield_t),
@@ -62 +63 @@
-@@ -491,6 +513,25 @@ eca_enq_to_cryptodev(struct event_crypto_adapter *adapter, struct rte_event *ev,
+@@ -492,6 +514,25 @@ eca_enq_to_cryptodev(struct event_crypto_adapter *adapter, struct rte_event *ev,
@@ -88 +89 @@
-@@ -657,6 +698,21 @@ eca_ops_enqueue_burst(struct event_crypto_adapter *adapter,
+@@ -658,6 +699,21 @@ eca_ops_enqueue_burst(struct event_crypto_adapter *adapter,
@@ -110,2 +111 @@
-@@ -895,6 +951,18 @@ eca_init_service(struct event_crypto_adapter *adapter, uint8_t id)
- 	}
+@@ -882,6 +938,18 @@ eca_init_service(struct event_crypto_adapter *adapter, uint8_t id)
@@ -113 +113,2 @@
- 	adapter->implicit_release_disabled = (uint8_t)impl_rel;
+ 	adapter->max_nb = adapter_conf.max_nb;
+ 	adapter->event_port_id = adapter_conf.event_port_id;

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'eal: fix logs for '--lcores'' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (47 preceding siblings ...)
  2024-06-24 23:58 ` patch 'eventdev/crypto: fix opaque field handling' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'net/fm10k: fix cleanup during init failure' " luca.boccassi
                   ` (30 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Kevin Traynor; +Cc: David Marchand, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/4c07a5e8c1fecea606b82944dd743943ac589e94

Thanks.

Luca Boccassi

---
From 4c07a5e8c1fecea606b82944dd743943ac589e94 Mon Sep 17 00:00:00 2001
From: Kevin Traynor <ktraynor@redhat.com>
Date: Thu, 13 Jun 2024 17:14:29 +0100
Subject: [PATCH] eal: fix logs for '--lcores'

[ upstream commit 0f241cc22e30de0dfd7487dcfd6acde220b5e168 ]

The argument is '--lcores' but it is being logged as '--lcore'
in several places.

e.g.
$ dpdk-testpmd -l 8,10,12 --lcores 8,10,12
EAL: Option --lcore is ignored, because (-l) is set!

Fix the spelling in logs and tests.

Fixes: 117eaa70584b ("eal: add error check for core options")
Fixes: 128ee4c26d87 ("app/test: add unit tests for --lcores option")

Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
---
 app/test/test_eal_flags.c           | 2 +-
 lib/eal/common/eal_common_options.c | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/app/test/test_eal_flags.c b/app/test/test_eal_flags.c
index d2b91e2075..f4740ee6e5 100644
--- a/app/test/test_eal_flags.c
+++ b/app/test/test_eal_flags.c
@@ -671,7 +671,7 @@ test_missing_c_flag(void)
 	    launch_proc(argv26) == 0 || launch_proc(argv27) == 0 ||
 	    launch_proc(argv28) == 0 || launch_proc(argv30) == 0) {
 		printf("Error - "
-		       "process ran without error with invalid --lcore flag\n");
+		       "process ran without error with invalid --lcores flag\n");
 		return -1;
 	}
 
diff --git a/lib/eal/common/eal_common_options.c b/lib/eal/common/eal_common_options.c
index 18a50f7452..5312d03552 100644
--- a/lib/eal/common/eal_common_options.c
+++ b/lib/eal/common/eal_common_options.c
@@ -1686,7 +1686,7 @@ eal_parse_common_option(int opt, const char *optarg,
 		if (core_parsed) {
 			RTE_LOG(ERR, EAL, "Option -c is ignored, because (%s) is set!\n",
 				(core_parsed == LCORE_OPT_LST) ? "-l" :
-				(core_parsed == LCORE_OPT_MAP) ? "--lcore" :
+				(core_parsed == LCORE_OPT_MAP) ? "--lcores" :
 				"-c");
 			return -1;
 		}
@@ -1719,7 +1719,7 @@ eal_parse_common_option(int opt, const char *optarg,
 		if (core_parsed) {
 			RTE_LOG(ERR, EAL, "Option -l is ignored, because (%s) is set!\n",
 				(core_parsed == LCORE_OPT_MSK) ? "-c" :
-				(core_parsed == LCORE_OPT_MAP) ? "--lcore" :
+				(core_parsed == LCORE_OPT_MAP) ? "--lcores" :
 				"-l");
 			return -1;
 		}
@@ -1900,10 +1900,10 @@ eal_parse_common_option(int opt, const char *optarg,
 		}
 
 		if (core_parsed) {
-			RTE_LOG(ERR, EAL, "Option --lcore is ignored, because (%s) is set!\n",
+			RTE_LOG(ERR, EAL, "Option --lcores is ignored, because (%s) is set!\n",
 				(core_parsed == LCORE_OPT_LST) ? "-l" :
 				(core_parsed == LCORE_OPT_MSK) ? "-c" :
-				"--lcore");
+				"--lcores");
 			return -1;
 		}
 
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:16.458431083 +0100
+++ 0050-eal-fix-logs-for-lcores.patch	2024-06-25 00:22:13.181185567 +0100
@@ -1 +1 @@
-From 0f241cc22e30de0dfd7487dcfd6acde220b5e168 Mon Sep 17 00:00:00 2001
+From 4c07a5e8c1fecea606b82944dd743943ac589e94 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 0f241cc22e30de0dfd7487dcfd6acde220b5e168 ]
+
@@ -26 +28 @@
-index 6cb4b06757..71d8dba731 100644
+index d2b91e2075..f4740ee6e5 100644
@@ -39 +41 @@
-index e541f07939..f1a5e329a5 100644
+index 18a50f7452..5312d03552 100644
@@ -42 +44 @@
-@@ -1687,7 +1687,7 @@ eal_parse_common_option(int opt, const char *optarg,
+@@ -1686,7 +1686,7 @@ eal_parse_common_option(int opt, const char *optarg,
@@ -44 +46 @@
- 			EAL_LOG(ERR, "Option -c is ignored, because (%s) is set!",
+ 			RTE_LOG(ERR, EAL, "Option -c is ignored, because (%s) is set!\n",
@@ -51 +53 @@
-@@ -1720,7 +1720,7 @@ eal_parse_common_option(int opt, const char *optarg,
+@@ -1719,7 +1719,7 @@ eal_parse_common_option(int opt, const char *optarg,
@@ -53 +55 @@
- 			EAL_LOG(ERR, "Option -l is ignored, because (%s) is set!",
+ 			RTE_LOG(ERR, EAL, "Option -l is ignored, because (%s) is set!\n",
@@ -60 +62 @@
-@@ -1901,10 +1901,10 @@ eal_parse_common_option(int opt, const char *optarg,
+@@ -1900,10 +1900,10 @@ eal_parse_common_option(int opt, const char *optarg,
@@ -64,2 +66,2 @@
--			EAL_LOG(ERR, "Option --lcore is ignored, because (%s) is set!",
-+			EAL_LOG(ERR, "Option --lcores is ignored, because (%s) is set!",
+-			RTE_LOG(ERR, EAL, "Option --lcore is ignored, because (%s) is set!\n",
++			RTE_LOG(ERR, EAL, "Option --lcores is ignored, because (%s) is set!\n",

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/fm10k: fix cleanup during init failure' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (48 preceding siblings ...)
  2024-06-24 23:58 ` patch 'eal: fix logs for '--lcores'' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'net/ixgbe: do not update link status in secondary process' " luca.boccassi
                   ` (29 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Julien Meunier; +Cc: Bruce Richardson, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/f461c249ff19a1744dea7c2ab117fa6872e1d606

Thanks.

Luca Boccassi

---
From f461c249ff19a1744dea7c2ab117fa6872e1d606 Mon Sep 17 00:00:00 2001
From: Julien Meunier <julien.meunier@nokia.com>
Date: Wed, 3 Apr 2024 13:55:41 +0200
Subject: [PATCH] net/fm10k: fix cleanup during init failure

[ upstream commit cd7f5da2e7d647863a3d6552b6787f413bbd05f2 ]

Cleanup was not done on this PMD if a error is seen during the init:
- possible memory leak due to a missing free
- interrupt handler was not disabled: if an IRQ is received after the
  init, a SIGSEGV can be seen (private data stored in
  rte_eth_devices[port_id] is pointing to NULL)

Fixes: a6061d9e7075 ("fm10k: register PF driver")
Fixes: 4c287332c39a ("fm10k: add PF and VF interrupt handling")

Signed-off-by: Julien Meunier <julien.meunier@nokia.com>
Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/fm10k/fm10k_ethdev.c | 39 +++++++++++++++++++++++++++-----
 1 file changed, 33 insertions(+), 6 deletions(-)

diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index 8b83063f0a..a4e06a0cfa 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -3055,7 +3055,7 @@ eth_fm10k_dev_init(struct rte_eth_dev *dev)
 	struct fm10k_hw *hw = FM10K_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	struct rte_pci_device *pdev = RTE_ETH_DEV_TO_PCI(dev);
 	struct rte_intr_handle *intr_handle = pdev->intr_handle;
-	int diag, i;
+	int diag, i, ret;
 	struct fm10k_macvlan_filter_info *macvlan;
 
 	PMD_INIT_FUNC_TRACE();
@@ -3144,21 +3144,24 @@ eth_fm10k_dev_init(struct rte_eth_dev *dev)
 	diag = fm10k_stats_reset(dev);
 	if (diag != 0) {
 		PMD_INIT_LOG(ERR, "Stats reset failed: %d", diag);
-		return diag;
+		ret = diag;
+		goto err_stat;
 	}
 
 	/* Reset the hw */
 	diag = fm10k_reset_hw(hw);
 	if (diag != FM10K_SUCCESS) {
 		PMD_INIT_LOG(ERR, "Hardware reset failed: %d", diag);
-		return -EIO;
+		ret = -EIO;
+		goto err_reset_hw;
 	}
 
 	/* Setup mailbox service */
 	diag = fm10k_setup_mbx_service(hw);
 	if (diag != FM10K_SUCCESS) {
 		PMD_INIT_LOG(ERR, "Failed to setup mailbox: %d", diag);
-		return -EIO;
+		ret = -EIO;
+		goto err_mbx;
 	}
 
 	/*PF/VF has different interrupt handling mechanism */
@@ -3197,7 +3200,8 @@ eth_fm10k_dev_init(struct rte_eth_dev *dev)
 
 		if (switch_ready == false) {
 			PMD_INIT_LOG(ERR, "switch is not ready");
-			return -1;
+			ret = -1;
+			goto err_switch_ready;
 		}
 	}
 
@@ -3232,7 +3236,8 @@ eth_fm10k_dev_init(struct rte_eth_dev *dev)
 
 		if (!hw->mac.default_vid) {
 			PMD_INIT_LOG(ERR, "default VID is not ready");
-			return -1;
+			ret = -1;
+			goto err_vid;
 		}
 	}
 
@@ -3241,6 +3246,28 @@ eth_fm10k_dev_init(struct rte_eth_dev *dev)
 		MAIN_VSI_POOL_NUMBER);
 
 	return 0;
+
+err_vid:
+err_switch_ready:
+	rte_intr_disable(intr_handle);
+
+	if (hw->mac.type == fm10k_mac_pf) {
+		fm10k_dev_disable_intr_pf(dev);
+		rte_intr_callback_unregister(intr_handle,
+			fm10k_dev_interrupt_handler_pf, (void *)dev);
+	} else {
+		fm10k_dev_disable_intr_vf(dev);
+		rte_intr_callback_unregister(intr_handle,
+			fm10k_dev_interrupt_handler_vf, (void *)dev);
+	}
+
+err_mbx:
+err_reset_hw:
+err_stat:
+	rte_free(dev->data->mac_addrs);
+	dev->data->mac_addrs = NULL;
+
+	return ret;
 }
 
 static int
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:16.503503953 +0100
+++ 0051-net-fm10k-fix-cleanup-during-init-failure.patch	2024-06-25 00:22:13.185185649 +0100
@@ -1 +1 @@
-From cd7f5da2e7d647863a3d6552b6787f413bbd05f2 Mon Sep 17 00:00:00 2001
+From f461c249ff19a1744dea7c2ab117fa6872e1d606 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit cd7f5da2e7d647863a3d6552b6787f413bbd05f2 ]
+
@@ -14 +15,0 @@
-Cc: stable@dpdk.org
@@ -23 +24 @@
-index fa0d16277e..7b490bea17 100644
+index 8b83063f0a..a4e06a0cfa 100644
@@ -26 +27 @@
-@@ -3058,7 +3058,7 @@ eth_fm10k_dev_init(struct rte_eth_dev *dev)
+@@ -3055,7 +3055,7 @@ eth_fm10k_dev_init(struct rte_eth_dev *dev)
@@ -35 +36 @@
-@@ -3147,21 +3147,24 @@ eth_fm10k_dev_init(struct rte_eth_dev *dev)
+@@ -3144,21 +3144,24 @@ eth_fm10k_dev_init(struct rte_eth_dev *dev)
@@ -63 +64 @@
-@@ -3200,7 +3203,8 @@ eth_fm10k_dev_init(struct rte_eth_dev *dev)
+@@ -3197,7 +3200,8 @@ eth_fm10k_dev_init(struct rte_eth_dev *dev)
@@ -73 +74 @@
-@@ -3235,7 +3239,8 @@ eth_fm10k_dev_init(struct rte_eth_dev *dev)
+@@ -3232,7 +3236,8 @@ eth_fm10k_dev_init(struct rte_eth_dev *dev)
@@ -83 +84 @@
-@@ -3244,6 +3249,28 @@ eth_fm10k_dev_init(struct rte_eth_dev *dev)
+@@ -3241,6 +3246,28 @@ eth_fm10k_dev_init(struct rte_eth_dev *dev)

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/ixgbe: do not update link status in secondary process' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (49 preceding siblings ...)
  2024-06-24 23:58 ` patch 'net/fm10k: fix cleanup during init failure' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'net/ixgbe: do not create delayed interrupt handler twice' " luca.boccassi
                   ` (28 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Jun Wang, Bruce Richardson, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/23efe3ba7a60f0af5d654d49474a5dfc6f6dff0f

Thanks.

Luca Boccassi

---
From 23efe3ba7a60f0af5d654d49474a5dfc6f6dff0f Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Wed, 20 Mar 2024 10:33:04 -0700
Subject: [PATCH] net/ixgbe: do not update link status in secondary process

[ upstream commit 5ffd40b85febd2a80b88b4cfbf4e1dd7e5f059c5 ]

The code to update link status is not safe in secondary process.
If called from secondary it will crash, example from dumpcap:
	ixgbe_dev_link_update_share()
	ixgbe_dev_link_update()
	rte_eth_link_get()

Fixes: af75078fece3 ("first public release")

Reported-by: Jun Wang <junwang01@cestc.cn>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 9c0e0efb66..311a6828a0 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -4283,6 +4283,9 @@ ixgbe_dev_link_update_share(struct rte_eth_dev *dev,
 	int wait = 1;
 	u32 esdp_reg;
 
+	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+		return -1;
+
 	memset(&link, 0, sizeof(link));
 	link.link_status = RTE_ETH_LINK_DOWN;
 	link.link_speed = RTE_ETH_SPEED_NUM_NONE;
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:16.549761459 +0100
+++ 0052-net-ixgbe-do-not-update-link-status-in-secondary-pro.patch	2024-06-25 00:22:13.193185812 +0100
@@ -1 +1 @@
-From 5ffd40b85febd2a80b88b4cfbf4e1dd7e5f059c5 Mon Sep 17 00:00:00 2001
+From 23efe3ba7a60f0af5d654d49474a5dfc6f6dff0f Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 5ffd40b85febd2a80b88b4cfbf4e1dd7e5f059c5 ]
+
@@ -13 +14,0 @@
-Cc: stable@dpdk.org
@@ -23 +24 @@
-index bbdc996f31..a6916da0c5 100644
+index 9c0e0efb66..311a6828a0 100644
@@ -26 +27 @@
-@@ -4293,6 +4293,9 @@ ixgbe_dev_link_update_share(struct rte_eth_dev *dev,
+@@ -4283,6 +4283,9 @@ ixgbe_dev_link_update_share(struct rte_eth_dev *dev,

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/ixgbe: do not create delayed interrupt handler twice' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (50 preceding siblings ...)
  2024-06-24 23:58 ` patch 'net/ixgbe: do not update link status in secondary process' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'net/e1000/base: fix link power down' " luca.boccassi
                   ` (27 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Edwin Brossette; +Cc: Anatoly Burakov, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/b2e98edd71e3695d23c9f83840246099fb23f28d

Thanks.

Luca Boccassi

---
From b2e98edd71e3695d23c9f83840246099fb23f28d Mon Sep 17 00:00:00 2001
From: Edwin Brossette <edwin.brossette@6wind.com>
Date: Thu, 18 Apr 2024 15:53:07 +0200
Subject: [PATCH] net/ixgbe: do not create delayed interrupt handler twice

[ upstream commit 130ece79670d57760acd18c9671f91a4cd4e07a0 ]

Since link state may need some time to stabilize after a link state
change, we cannot update the link state right after one occurs. So link
state change interrupts (LSC) are handled after a delay. To do this, an
alarm to call a delayed handler is programmed. This delayed handler is
tasked with updating the link after a variable delay of one to four
seconds which should be enough time for the link state to become stable
again.

However, a problem can occur with some models of network cards. For
example, ixgbe_mac_X550EM_x may trigger this interrupt twice because
another interrupt signal is received on the General Purpose Interrupt
pin SPD0, which has the same interrupt handler. In such a case, the
delayed interrupt handler would be programmed to be executed twice.

Since we save the original interrupt mask value to restore it after the
delayed handler is done with its work, we end up overwriting its value
after the second alarm is programmed. Even worse: when restoring it the
first time, the saved original mask variable is reset to 0, so we end up
completely disabling all interrupts when trying to restore this mask
after the second time the delayed handler is executed.

Add a check on the interrupt mask value when programming the alarm for
the delayed handler. If the bit for LSC interrupts is unset, it means an
alarm was already programmed for the delayed handler. In this case, skip
the alarm creation.

Fixes: 9b667210700e ("net/ixgbe: fix blocked interrupts")

Signed-off-by: Edwin Brossette <edwin.brossette@6wind.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 311a6828a0..9e1a65a50a 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -4660,14 +4660,20 @@ ixgbe_dev_interrupt_action(struct rte_eth_dev *dev)
 			timeout = IXGBE_LINK_DOWN_CHECK_TIMEOUT;
 
 		ixgbe_dev_link_status_print(dev);
-		if (rte_eal_alarm_set(timeout * 1000,
-				      ixgbe_dev_interrupt_delayed_handler, (void *)dev) < 0)
-			PMD_DRV_LOG(ERR, "Error setting alarm");
-		else {
-			/* remember original mask */
-			intr->mask_original = intr->mask;
-			/* only disable lsc interrupt */
-			intr->mask &= ~IXGBE_EIMS_LSC;
+
+		/* Don't program delayed handler if LSC interrupt is disabled.
+		 * It means one is already programmed.
+		 */
+		if (intr->mask & IXGBE_EIMS_LSC) {
+			if (rte_eal_alarm_set(timeout * 1000,
+					      ixgbe_dev_interrupt_delayed_handler, (void *)dev) < 0)
+				PMD_DRV_LOG(ERR, "Error setting alarm");
+			else {
+				/* remember original mask */
+				intr->mask_original = intr->mask;
+				/* only disable lsc interrupt */
+				intr->mask &= ~IXGBE_EIMS_LSC;
+			}
 		}
 	}
 
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:16.589954884 +0100
+++ 0053-net-ixgbe-do-not-create-delayed-interrupt-handler-tw.patch	2024-06-25 00:22:13.197185893 +0100
@@ -1 +1 @@
-From 130ece79670d57760acd18c9671f91a4cd4e07a0 Mon Sep 17 00:00:00 2001
+From b2e98edd71e3695d23c9f83840246099fb23f28d Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 130ece79670d57760acd18c9671f91a4cd4e07a0 ]
+
@@ -33 +34,0 @@
-Cc: stable@dpdk.org
@@ -42 +43 @@
-index a6916da0c5..1f93be98ca 100644
+index 311a6828a0..9e1a65a50a 100644
@@ -45 +46 @@
-@@ -4672,14 +4672,20 @@ ixgbe_dev_interrupt_action(struct rte_eth_dev *dev)
+@@ -4660,14 +4660,20 @@ ixgbe_dev_interrupt_action(struct rte_eth_dev *dev)

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/e1000/base: fix link power down' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (51 preceding siblings ...)
  2024-06-24 23:58 ` patch 'net/ixgbe: do not create delayed interrupt handler twice' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'net/ixgbe/base: revert advertising for X550 2.5G/5G' " luca.boccassi
                   ` (26 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Anatoly Burakov; +Cc: Bruce Richardson, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/229bdd77bb5a0b0740caca211792eaaa577bebd4

Thanks.

Luca Boccassi

---
From 229bdd77bb5a0b0740caca211792eaaa577bebd4 Mon Sep 17 00:00:00 2001
From: Anatoly Burakov <anatoly.burakov@intel.com>
Date: Tue, 14 May 2024 16:17:16 +0100
Subject: [PATCH] net/e1000/base: fix link power down

[ upstream commit a8218d09e3aaae5307325ff4b2f92ed4a3c37a8c ]

Current code is a result of work to reduce duplication between various
device models. However, the logic that was replaced did not exactly
match the new logic, and as a result the link power down was not
working correctly for some NICs, and the link remained up even when
the interface is down.

Fix it to correctly power down the link under all circumstances that
were supported by old logic.

Fixes: 44dddd14059f ("net/e1000/base: remove duplicated codes")

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/e1000/base/e1000_base.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/e1000/base/e1000_base.c b/drivers/net/e1000/base/e1000_base.c
index ab73e1e59e..3ec32e7240 100644
--- a/drivers/net/e1000/base/e1000_base.c
+++ b/drivers/net/e1000/base/e1000_base.c
@@ -107,7 +107,7 @@ void e1000_power_down_phy_copper_base(struct e1000_hw *hw)
 		return;
 
 	/* If the management interface is not enabled, then power down */
-	if (phy->ops.check_reset_block(hw))
+	if (!(e1000_enable_mng_pass_thru(hw) || phy->ops.check_reset_block(hw)))
 		e1000_power_down_phy_copper(hw);
 }
 
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:16.628461719 +0100
+++ 0054-net-e1000-base-fix-link-power-down.patch	2024-06-25 00:22:13.197185893 +0100
@@ -1 +1 @@
-From a8218d09e3aaae5307325ff4b2f92ed4a3c37a8c Mon Sep 17 00:00:00 2001
+From 229bdd77bb5a0b0740caca211792eaaa577bebd4 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit a8218d09e3aaae5307325ff4b2f92ed4a3c37a8c ]
+
@@ -16 +17,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/ixgbe/base: revert advertising for X550 2.5G/5G' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (52 preceding siblings ...)
  2024-06-24 23:58 ` patch 'net/e1000/base: fix link power down' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'net/ixgbe/base: fix 5G link speed reported on VF' " luca.boccassi
                   ` (25 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Piotr Pietruszewski
  Cc: Piotr Skajewski, Marek Mical, Jeff Kirsher, Alice Michael, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

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

Thanks.

Luca Boccassi

---
From 5e73514050ef0367456e035b851ef83edf86676b Mon Sep 17 00:00:00 2001
From: Piotr Pietruszewski <piotr.pietruszewski@intel.com>
Date: Thu, 30 May 2024 12:13:34 +0100
Subject: [PATCH] net/ixgbe/base: revert advertising for X550 2.5G/5G

[ upstream commit 9ac063a739b00188281ba4ef5c6a0e43cc59a3b8 ]

The commit removing advertising 2.5G and 5G speeds from
ixgbe_get_copper_speeds_supported() was supposed to disable 2.5G and 5G
during the autonegotiation with default settings. However, that change
prevented OS-specific part of the driver from forcing these speeds at
user request.

This change reverts the commit and adds 2.5G and 5G as speeds supported
by the X550.

Fixes: 13de2444449e ("net/ixgbe/base: remove default advertising for x550 2.5G/5G")

Signed-off-by: Piotr Pietruszewski <piotr.pietruszewski@intel.com>
Reviewed-by: Piotr Skajewski <piotrx.skajewski@intel.com>
Reviewed-by: Marek Mical <marekx.mical@intel.com>
Reviewed-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Reviewed-by: Alice Michael <alice.michael@intel.com>
---
 .mailmap                           | 1 +
 drivers/net/ixgbe/base/ixgbe_phy.c | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/.mailmap b/.mailmap
index 2724a689fd..4cdd9f04d9 100644
--- a/.mailmap
+++ b/.mailmap
@@ -845,6 +845,7 @@ Marcin Wojtas <mw@semihalf.com>
 Marcin Zapolski <marcinx.a.zapolski@intel.com>
 Marco Varlese <mvarlese@suse.de>
 Marc Sune <marcdevel@gmail.com> <marc.sune@bisdn.de>
+Marek Mical <marekx.mical@intel.com>
 Maria Lingemark <maria.lingemark@ericsson.com>
 Mario Carrillo <mario.alfredo.c.arevalo@intel.com>
 Mário Kuka <kuka@cesnet.cz>
diff --git a/drivers/net/ixgbe/base/ixgbe_phy.c b/drivers/net/ixgbe/base/ixgbe_phy.c
index 74c5db16fa..3a8e603472 100644
--- a/drivers/net/ixgbe/base/ixgbe_phy.c
+++ b/drivers/net/ixgbe/base/ixgbe_phy.c
@@ -915,6 +915,10 @@ static s32 ixgbe_get_copper_speeds_supported(struct ixgbe_hw *hw)
 		hw->phy.speeds_supported |= IXGBE_LINK_SPEED_100_FULL;
 
 	switch (hw->mac.type) {
+	case ixgbe_mac_X550:
+		hw->phy.speeds_supported |= IXGBE_LINK_SPEED_2_5GB_FULL;
+		hw->phy.speeds_supported |= IXGBE_LINK_SPEED_5GB_FULL;
+		break;
 	case ixgbe_mac_X550EM_x:
 	case ixgbe_mac_X550EM_a:
 		hw->phy.speeds_supported &= ~IXGBE_LINK_SPEED_100_FULL;
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:16.661860969 +0100
+++ 0055-net-ixgbe-base-revert-advertising-for-X550-2.5G-5G.patch	2024-06-25 00:22:13.201185974 +0100
@@ -1 +1 @@
-From 9ac063a739b00188281ba4ef5c6a0e43cc59a3b8 Mon Sep 17 00:00:00 2001
+From 5e73514050ef0367456e035b851ef83edf86676b Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 9ac063a739b00188281ba4ef5c6a0e43cc59a3b8 ]
+
@@ -16 +17,0 @@
-Cc: stable@dpdk.org
@@ -29 +30 @@
-index 075ea40f17..508d4eba24 100644
+index 2724a689fd..4cdd9f04d9 100644
@@ -32 +33 @@
-@@ -892,6 +892,7 @@ Marcin Wojtas <mw@semihalf.com>
+@@ -845,6 +845,7 @@ Marcin Wojtas <mw@semihalf.com>

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/ixgbe/base: fix 5G link speed reported on VF' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (53 preceding siblings ...)
  2024-06-24 23:58 ` patch 'net/ixgbe/base: revert advertising for X550 2.5G/5G' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'net/ixgbe/base: fix PHY ID for X550' " luca.boccassi
                   ` (24 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Piotr Skajewski
  Cc: Radoslaw Tyl, Slawomir Mrozowicz, Alice Michael, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/7b94a8b53e76bc9cdc14b5d423e3643318090e6a

Thanks.

Luca Boccassi

---
From 7b94a8b53e76bc9cdc14b5d423e3643318090e6a Mon Sep 17 00:00:00 2001
From: Piotr Skajewski <piotrx.skajewski@intel.com>
Date: Thu, 30 May 2024 12:13:35 +0100
Subject: [PATCH] net/ixgbe/base: fix 5G link speed reported on VF

[ upstream commit 9eb7fdbd47cf02068715a6e8bef767b0deea6f94 ]

When 5000 Base-T was set on PF the VF reported 100 Base-T. This patch
changes ixgbe_check_mac_link_vf function where there was an incorrect
conditional which checks using PF mac types, now it is correctly
using VF mac types.

Fixes: 12e20906905c ("net/ixgbe/base: include new speeds in VFLINK interpretation")

Signed-off-by: Piotr Skajewski <piotrx.skajewski@intel.com>
Reviewed-by: Radoslaw Tyl <radoslawx.tyl@intel.com>
Reviewed-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
Reviewed-by: Alice Michael <alice.michael@intel.com>
---
 .mailmap                          | 1 +
 drivers/net/ixgbe/base/ixgbe_vf.c | 6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/.mailmap b/.mailmap
index 4cdd9f04d9..e8953af6f0 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1112,6 +1112,7 @@ Quentin Armitage <quentin@armitage.org.uk>
 Qun Wan <qun.wan@intel.com>
 Radha Mohan Chintakuntla <radhac@marvell.com>
 Radoslaw Biernacki <rad@semihalf.com> <radoslaw.biernacki@linaro.org>
+Radoslaw Tyl <radoslawx.tyl@intel.com>
 Radu Bulie <radu-andrei.bulie@nxp.com>
 Radu Nicolau <radu.nicolau@intel.com>
 Rafael Ávila de Espíndola <espindola@scylladb.com>
diff --git a/drivers/net/ixgbe/base/ixgbe_vf.c b/drivers/net/ixgbe/base/ixgbe_vf.c
index 5e3ae1b519..11dbbe2a86 100644
--- a/drivers/net/ixgbe/base/ixgbe_vf.c
+++ b/drivers/net/ixgbe/base/ixgbe_vf.c
@@ -585,7 +585,7 @@ s32 ixgbe_check_mac_link_vf(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
 	switch (links_reg & IXGBE_LINKS_SPEED_82599) {
 	case IXGBE_LINKS_SPEED_10G_82599:
 		*speed = IXGBE_LINK_SPEED_10GB_FULL;
-		if (hw->mac.type >= ixgbe_mac_X550) {
+		if (hw->mac.type >= ixgbe_mac_X550_vf) {
 			if (links_reg & IXGBE_LINKS_SPEED_NON_STD)
 				*speed = IXGBE_LINK_SPEED_2_5GB_FULL;
 		}
@@ -595,7 +595,7 @@ s32 ixgbe_check_mac_link_vf(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
 		break;
 	case IXGBE_LINKS_SPEED_100_82599:
 		*speed = IXGBE_LINK_SPEED_100_FULL;
-		if (hw->mac.type == ixgbe_mac_X550) {
+		if (hw->mac.type == ixgbe_mac_X550_vf) {
 			if (links_reg & IXGBE_LINKS_SPEED_NON_STD)
 				*speed = IXGBE_LINK_SPEED_5GB_FULL;
 		}
@@ -603,7 +603,7 @@ s32 ixgbe_check_mac_link_vf(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
 	case IXGBE_LINKS_SPEED_10_X550EM_A:
 		*speed = IXGBE_LINK_SPEED_UNKNOWN;
 		/* Since Reserved in older MAC's */
-		if (hw->mac.type >= ixgbe_mac_X550)
+		if (hw->mac.type >= ixgbe_mac_X550_vf)
 			*speed = IXGBE_LINK_SPEED_10_FULL;
 		break;
 	default:
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:16.698596890 +0100
+++ 0056-net-ixgbe-base-fix-5G-link-speed-reported-on-VF.patch	2024-06-25 00:22:13.205186057 +0100
@@ -1 +1 @@
-From 9eb7fdbd47cf02068715a6e8bef767b0deea6f94 Mon Sep 17 00:00:00 2001
+From 7b94a8b53e76bc9cdc14b5d423e3643318090e6a Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 9eb7fdbd47cf02068715a6e8bef767b0deea6f94 ]
+
@@ -12 +13,0 @@
-Cc: stable@dpdk.org
@@ -24 +25 @@
-index 508d4eba24..be16cabd07 100644
+index 4cdd9f04d9..e8953af6f0 100644
@@ -27 +28 @@
-@@ -1173,6 +1173,7 @@ Quentin Armitage <quentin@armitage.org.uk>
+@@ -1112,6 +1112,7 @@ Quentin Armitage <quentin@armitage.org.uk>

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/ixgbe/base: fix PHY ID for X550' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (54 preceding siblings ...)
  2024-06-24 23:58 ` patch 'net/ixgbe/base: fix 5G link speed reported on VF' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'net/cnxk: fix RSS config' " luca.boccassi
                   ` (23 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Radoslaw Tyl; +Cc: Piotr Skajewski, Alice Michael, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/8873f14545fb51cc67f25d38f0eb7d3c1c5cc24b

Thanks.

Luca Boccassi

---
From 8873f14545fb51cc67f25d38f0eb7d3c1c5cc24b Mon Sep 17 00:00:00 2001
From: Radoslaw Tyl <radoslawx.tyl@intel.com>
Date: Thu, 30 May 2024 12:13:36 +0100
Subject: [PATCH] net/ixgbe/base: fix PHY ID for X550

[ upstream commit a9f5a3bd4c179e54b5ca95b0ce191bf4f33d2add ]

Function ixgbe_get_phy_type_from_id() for X550_PHY_ID2 and
X550_PHY_ID3 always return ixgbe_phy_unknown instead of ixgbe_phy_aq
because phy ID's last 4 bits are always masked, and should not be
taken into account when selecting phy type.

This patch adds default PHY ID for X550 devices with mask on last 4
bits (0xFFFFFFF0), and fixes the switch statement to use it.

Fixes: 58ddc803e412 ("ixgbe/base: add new X550 PHY ids")

Signed-off-by: Radoslaw Tyl <radoslawx.tyl@intel.com>
Reviewed-by: Piotr Skajewski <piotrx.skajewski@intel.com>
Reviewed-by: Alice Michael <alice.michael@intel.com>
---
 drivers/net/ixgbe/base/ixgbe_phy.c  | 3 +--
 drivers/net/ixgbe/base/ixgbe_type.h | 1 +
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ixgbe/base/ixgbe_phy.c b/drivers/net/ixgbe/base/ixgbe_phy.c
index 3a8e603472..56267bb00d 100644
--- a/drivers/net/ixgbe/base/ixgbe_phy.c
+++ b/drivers/net/ixgbe/base/ixgbe_phy.c
@@ -432,8 +432,7 @@ enum ixgbe_phy_type ixgbe_get_phy_type_from_id(u32 phy_id)
 	case TN1010_PHY_ID:
 		phy_type = ixgbe_phy_tn;
 		break;
-	case X550_PHY_ID2:
-	case X550_PHY_ID3:
+	case X550_PHY_ID:
 	case X540_PHY_ID:
 		phy_type = ixgbe_phy_aq;
 		break;
diff --git a/drivers/net/ixgbe/base/ixgbe_type.h b/drivers/net/ixgbe/base/ixgbe_type.h
index dc765f13c9..5973c60477 100644
--- a/drivers/net/ixgbe/base/ixgbe_type.h
+++ b/drivers/net/ixgbe/base/ixgbe_type.h
@@ -1663,6 +1663,7 @@ struct ixgbe_dmac_config {
 #define TN1010_PHY_ID	0x00A19410
 #define TNX_FW_REV	0xB
 #define X540_PHY_ID	0x01540200
+#define X550_PHY_ID	0x01540220
 #define X550_PHY_ID2	0x01540223
 #define X550_PHY_ID3	0x01540221
 #define X557_PHY_ID	0x01540240
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:16.733656108 +0100
+++ 0057-net-ixgbe-base-fix-PHY-ID-for-X550.patch	2024-06-25 00:22:13.209186138 +0100
@@ -1 +1 @@
-From a9f5a3bd4c179e54b5ca95b0ce191bf4f33d2add Mon Sep 17 00:00:00 2001
+From 8873f14545fb51cc67f25d38f0eb7d3c1c5cc24b Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit a9f5a3bd4c179e54b5ca95b0ce191bf4f33d2add ]
+
@@ -15 +16,0 @@
-Cc: stable@dpdk.org
@@ -40 +41 @@
-index 35212a561b..f709681df2 100644
+index dc765f13c9..5973c60477 100644
@@ -43 +44 @@
-@@ -1664,6 +1664,7 @@ struct ixgbe_dmac_config {
+@@ -1663,6 +1663,7 @@ struct ixgbe_dmac_config {

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/cnxk: fix RSS config' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (55 preceding siblings ...)
  2024-06-24 23:58 ` patch 'net/ixgbe/base: fix PHY ID for X550' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'net/cnxk: fix outbound security with higher packet burst' " luca.boccassi
                   ` (22 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Sunil Kumar Kori; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/d1c48d821e1b78aeafc0921710bcb28702c3f137

Thanks.

Luca Boccassi

---
From d1c48d821e1b78aeafc0921710bcb28702c3f137 Mon Sep 17 00:00:00 2001
From: Sunil Kumar Kori <skori@marvell.com>
Date: Thu, 23 May 2024 20:23:21 +0530
Subject: [PATCH] net/cnxk: fix RSS config

[ upstream commit d3654d35176dcc6e5ebb7bab00c7fdd6b61fc1f0 ]

Currently user passed RSS configuration is ignored via
rte_eth_dev_configure() API. Instead default RSS setup
is done by driver.

Adding handling for user passed RSS configuration too
via rte_eth_dev_configure().

Fixes: b75e0aca84b0 ("net/cnxk: add device configuration operation")

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
---
 drivers/net/cnxk/cnxk_ethdev.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/cnxk/cnxk_ethdev.c b/drivers/net/cnxk/cnxk_ethdev.c
index f9245258cb..56b26a9650 100644
--- a/drivers/net/cnxk/cnxk_ethdev.c
+++ b/drivers/net/cnxk/cnxk_ethdev.c
@@ -1334,6 +1334,13 @@ cnxk_nix_configure(struct rte_eth_dev *eth_dev)
 		goto free_nix_lf;
 	}
 
+	/* Overwrite default RSS setup if requested by user */
+	rc = cnxk_nix_rss_hash_update(eth_dev, &conf->rx_adv_conf.rss_conf);
+	if (rc) {
+		plt_err("Failed to configure rss rc=%d", rc);
+		goto free_nix_lf;
+	}
+
 	/* Init the default TM scheduler hierarchy */
 	rc = roc_nix_tm_init(nix);
 	if (rc) {
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:16.773206636 +0100
+++ 0058-net-cnxk-fix-RSS-config.patch	2024-06-25 00:22:13.209186138 +0100
@@ -1 +1 @@
-From d3654d35176dcc6e5ebb7bab00c7fdd6b61fc1f0 Mon Sep 17 00:00:00 2001
+From d1c48d821e1b78aeafc0921710bcb28702c3f137 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit d3654d35176dcc6e5ebb7bab00c7fdd6b61fc1f0 ]
+
@@ -14 +15,0 @@
-Cc: stable@dpdk.org
@@ -22 +23 @@
-index 6b37bd877f..95a3d8aaf9 100644
+index f9245258cb..56b26a9650 100644
@@ -25 +26 @@
-@@ -1384,6 +1384,13 @@ cnxk_nix_configure(struct rte_eth_dev *eth_dev)
+@@ -1334,6 +1334,13 @@ cnxk_nix_configure(struct rte_eth_dev *eth_dev)

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/cnxk: fix outbound security with higher packet burst' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (56 preceding siblings ...)
  2024-06-24 23:58 ` patch 'net/cnxk: fix RSS config' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'net/cnxk: fix promiscuous state after MAC change' " luca.boccassi
                   ` (21 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Nithin Dabilpuram; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/d9d6771ebabe8fef3a5263a89ef81e44ff3806ca

Thanks.

Luca Boccassi

---
From d9d6771ebabe8fef3a5263a89ef81e44ff3806ca Mon Sep 17 00:00:00 2001
From: Nithin Dabilpuram <ndabilpuram@marvell.com>
Date: Tue, 28 May 2024 12:35:19 +0530
Subject: [PATCH] net/cnxk: fix outbound security with higher packet burst

[ upstream commit 062f6f652445a283a186dc6c62c692ba7c91cc3c ]

Fix issue with outbound security path while handling mixed traffic i.e
both plain and inline outbound packets being present as part of burst
and burst size is > 32. The loop needs to be broken when
we don't have space for 4 packets in LMT lines for CPT considering
both the full LMT lines and partial LMT lines used.

Fixes: 55bfac717c72 ("net/cnxk: support Tx security offload on cn10k")

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
---
 drivers/net/cnxk/cn10k_tx.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/cnxk/cn10k_tx.h b/drivers/net/cnxk/cn10k_tx.h
index 254ddf0536..e96030621b 100644
--- a/drivers/net/cnxk/cn10k_tx.h
+++ b/drivers/net/cnxk/cn10k_tx.h
@@ -1843,7 +1843,8 @@ again:
 	}
 
 	for (i = 0; i < burst; i += NIX_DESCS_PER_LOOP) {
-		if (flags & NIX_TX_OFFLOAD_SECURITY_F && c_lnum + 2 > 16) {
+		if (flags & NIX_TX_OFFLOAD_SECURITY_F &&
+		    (((int)((16 - c_lnum) << 1) - c_loff) < 4)) {
 			burst = i;
 			break;
 		}
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:16.807683374 +0100
+++ 0059-net-cnxk-fix-outbound-security-with-higher-packet-bu.patch	2024-06-25 00:22:13.213186220 +0100
@@ -1 +1 @@
-From 062f6f652445a283a186dc6c62c692ba7c91cc3c Mon Sep 17 00:00:00 2001
+From d9d6771ebabe8fef3a5263a89ef81e44ff3806ca Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 062f6f652445a283a186dc6c62c692ba7c91cc3c ]
+
@@ -13 +14,0 @@
-Cc: stable@dpdk.org
@@ -21 +22 @@
-index 5c4b9e559e..9ce41fe80f 100644
+index 254ddf0536..e96030621b 100644
@@ -24 +25 @@
-@@ -2272,7 +2272,8 @@ again:
+@@ -1843,7 +1843,8 @@ again:

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/cnxk: fix promiscuous state after MAC change' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (57 preceding siblings ...)
  2024-06-24 23:58 ` patch 'net/cnxk: fix outbound security with higher packet burst' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'graph: fix ID collisions' " luca.boccassi
                   ` (20 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Rahul Bhansali; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/e0da7a253dbd6dac1cba895d81742a50313e44fc

Thanks.

Luca Boccassi

---
From e0da7a253dbd6dac1cba895d81742a50313e44fc Mon Sep 17 00:00:00 2001
From: Rahul Bhansali <rbhansali@marvell.com>
Date: Tue, 28 May 2024 14:02:46 +0530
Subject: [PATCH] net/cnxk: fix promiscuous state after MAC change

[ upstream commit 5f1bce00fddffc63e5634891df2b02859c010944 ]

If promiscuous mode is enabled and default MAC address is set
again then promiscuous mode gets disabled in hardware.

This change will restore promiscuous behavior after configuring
default MAC address.

Fixes: 5fe86db2a0dd ("net/cnxk: support MAC address set")

Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
---
 drivers/net/cnxk/cnxk_ethdev_ops.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/cnxk/cnxk_ethdev_ops.c b/drivers/net/cnxk/cnxk_ethdev_ops.c
index be29b385a4..5fd39149cb 100644
--- a/drivers/net/cnxk/cnxk_ethdev_ops.c
+++ b/drivers/net/cnxk/cnxk_ethdev_ops.c
@@ -413,6 +413,13 @@ cnxk_nix_mac_addr_set(struct rte_eth_dev *eth_dev, struct rte_ether_addr *addr)
 			roc_nix_npc_mac_addr_set(nix, dev->mac_addr);
 			goto exit;
 		}
+
+		if (eth_dev->data->promiscuous) {
+			rc = roc_nix_mac_promisc_mode_enable(nix, true);
+			if (rc)
+				plt_err("Failed to setup promisc mode in mac, rc=%d(%s)", rc,
+					roc_error_msg_get(rc));
+		}
 	}
 
 	/* Update mac address to cnxk ethernet device */
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:16.843038050 +0100
+++ 0060-net-cnxk-fix-promiscuous-state-after-MAC-change.patch	2024-06-25 00:22:13.213186220 +0100
@@ -1 +1 @@
-From 5f1bce00fddffc63e5634891df2b02859c010944 Mon Sep 17 00:00:00 2001
+From e0da7a253dbd6dac1cba895d81742a50313e44fc Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 5f1bce00fddffc63e5634891df2b02859c010944 ]
+
@@ -13 +14,0 @@
-Cc: stable@dpdk.org
@@ -21 +22 @@
-index c8260fcb9c..b1093dd584 100644
+index be29b385a4..5fd39149cb 100644
@@ -24 +25 @@
-@@ -451,6 +451,13 @@ cnxk_nix_mac_addr_set(struct rte_eth_dev *eth_dev, struct rte_ether_addr *addr)
+@@ -413,6 +413,13 @@ cnxk_nix_mac_addr_set(struct rte_eth_dev *eth_dev, struct rte_ether_addr *addr)

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'graph: fix ID collisions' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (58 preceding siblings ...)
  2024-06-24 23:58 ` patch 'net/cnxk: fix promiscuous state after MAC change' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'bpf: disable on 32-bit x86' " luca.boccassi
                   ` (19 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Robin Jarry; +Cc: Kiran Kumar K, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/145220677b0b20859be722c4cc6f90d882ce395d

Thanks.

Luca Boccassi

---
From 145220677b0b20859be722c4cc6f90d882ce395d Mon Sep 17 00:00:00 2001
From: Robin Jarry <rjarry@redhat.com>
Date: Tue, 18 Jun 2024 11:23:25 +0200
Subject: [PATCH] graph: fix ID collisions

[ upstream commit d5c8b6bb74a06051232cbbd92d25220606b280c0 ]

The graph id is determined based on a global variable that is
incremented every time a graph is created, and decremented every time
a graph is destroyed. This only works if graphs are destroyed in the
reverse order in which they have been created.

The following code produces duplicate graph IDs which can lead to
use-after-free bugs and other undefined behaviours:

  a = rte_graph_create(...); // id=0 graph_id=1
  b = rte_graph_create(...); // id=1 graph_id=2
  rte_graph_destroy(a);      // graph_id=1
  c = rte_graph_create(...); // id=1 graph_id=2 (duplicate with b)
  rte_graph_destroy(c);      // frees memory still used by b

Remove the global counter. Make sure that the graph list is always
ordered by increasing graph ids. When creating a new graph, pick a free
id which is not allocated.

Update unit tests to ensure it works as expected.

Fixes: a91fecc19c5c ("graph: implement create and destroy")

Signed-off-by: Robin Jarry <rjarry@redhat.com>
Acked-by: Kiran Kumar K <kirankumark@marvell.com>
---
 lib/graph/graph.c | 72 +++++++++++++++++++++++++++++++++++++++--------
 1 file changed, 61 insertions(+), 11 deletions(-)

diff --git a/lib/graph/graph.c b/lib/graph/graph.c
index 3a617cc369..9027e62a26 100644
--- a/lib/graph/graph.c
+++ b/lib/graph/graph.c
@@ -18,11 +18,54 @@
 
 static struct graph_head graph_list = STAILQ_HEAD_INITIALIZER(graph_list);
 static rte_spinlock_t graph_lock = RTE_SPINLOCK_INITIALIZER;
-static rte_graph_t graph_id;
-
-#define GRAPH_ID_CHECK(id) ID_CHECK(id, graph_id)
 
 /* Private functions */
+static struct graph *
+graph_from_id(rte_graph_t id)
+{
+	struct graph *graph;
+	STAILQ_FOREACH(graph, &graph_list, next) {
+		if (graph->id == id)
+			return graph;
+	}
+	rte_errno = EINVAL;
+	return NULL;
+}
+
+static rte_graph_t
+graph_next_free_id(void)
+{
+	struct graph *graph;
+	rte_graph_t id = 0;
+
+	STAILQ_FOREACH(graph, &graph_list, next) {
+		if (id < graph->id)
+			break;
+		id = graph->id + 1;
+	}
+
+	return id;
+}
+
+static void
+graph_insert_ordered(struct graph *graph)
+{
+	struct graph *after, *g;
+
+	after = NULL;
+	STAILQ_FOREACH(g, &graph_list, next) {
+		if (g->id < graph->id)
+			after = g;
+		else if (g->id > graph->id)
+			break;
+	}
+	if (after == NULL) {
+		STAILQ_INSERT_HEAD(&graph_list, graph, next);
+	} else {
+		STAILQ_INSERT_AFTER(&graph_list, after, graph, next);
+	}
+}
+
 struct graph_head *
 graph_list_head_get(void)
 {
@@ -327,7 +370,7 @@ rte_graph_create(const char *name, struct rte_graph_param *prm)
 	graph->socket = prm->socket_id;
 	graph->src_node_count = src_node_count;
 	graph->node_count = graph_nodes_count(graph);
-	graph->id = graph_id;
+	graph->id = graph_next_free_id();
 
 	/* Allocate the Graph fast path memory and populate the data */
 	if (graph_fp_mem_create(graph))
@@ -338,8 +381,7 @@ rte_graph_create(const char *name, struct rte_graph_param *prm)
 		goto graph_mem_destroy;
 
 	/* All good, Lets add the graph to the list */
-	graph_id++;
-	STAILQ_INSERT_TAIL(&graph_list, graph, next);
+	graph_insert_ordered(graph);
 
 	graph_spinlock_unlock();
 	return graph->id;
@@ -378,7 +420,6 @@ rte_graph_destroy(rte_graph_t id)
 			graph_cleanup(graph);
 			STAILQ_REMOVE(&graph_list, graph, graph, next);
 			free(graph);
-			graph_id--;
 			goto done;
 		}
 		graph = tmp;
@@ -405,7 +446,8 @@ rte_graph_id_to_name(rte_graph_t id)
 {
 	struct graph *graph;
 
-	GRAPH_ID_CHECK(id);
+	if (graph_from_id(id) == NULL)
+		goto fail;
 	STAILQ_FOREACH(graph, &graph_list, next)
 		if (graph->id == id)
 			return graph->name;
@@ -422,7 +464,8 @@ rte_graph_node_get(rte_graph_t gid, uint32_t nid)
 	rte_graph_off_t off;
 	rte_node_t count;
 
-	GRAPH_ID_CHECK(gid);
+	if (graph_from_id(gid) == NULL)
+		goto fail;
 	STAILQ_FOREACH(graph, &graph_list, next)
 		if (graph->id == gid) {
 			rte_graph_foreach_node(count, off, graph->graph,
@@ -547,7 +590,8 @@ graph_scan_dump(FILE *f, rte_graph_t id, bool all)
 	struct graph *graph;
 
 	RTE_VERIFY(f);
-	GRAPH_ID_CHECK(id);
+	if (graph_from_id(id) == NULL)
+		goto fail;
 
 	STAILQ_FOREACH(graph, &graph_list, next) {
 		if (all == true) {
@@ -576,7 +620,13 @@ rte_graph_list_dump(FILE *f)
 rte_graph_t
 rte_graph_max_count(void)
 {
-	return graph_id;
+	struct graph *graph;
+	rte_graph_t count = 0;
+
+	STAILQ_FOREACH(graph, &graph_list, next)
+		count++;
+
+	return count;
 }
 
 RTE_LOG_REGISTER_DEFAULT(rte_graph_logtype, INFO);
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:16.877740054 +0100
+++ 0061-graph-fix-ID-collisions.patch	2024-06-25 00:22:13.213186220 +0100
@@ -1 +1 @@
-From d5c8b6bb74a06051232cbbd92d25220606b280c0 Mon Sep 17 00:00:00 2001
+From 145220677b0b20859be722c4cc6f90d882ce395d Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit d5c8b6bb74a06051232cbbd92d25220606b280c0 ]
+
@@ -27 +28,0 @@
-Cc: stable@dpdk.org
@@ -32,3 +33,2 @@
- app/test/test_graph.c | 72 ++++++++++++++++++++++++++++++++++++
- lib/graph/graph.c     | 86 ++++++++++++++++++++++++++++++++++---------
- 2 files changed, 141 insertions(+), 17 deletions(-)
+ lib/graph/graph.c | 72 +++++++++++++++++++++++++++++++++++++++--------
+ 1 file changed, 61 insertions(+), 11 deletions(-)
@@ -36,90 +35,0 @@
-diff --git a/app/test/test_graph.c b/app/test/test_graph.c
-index b8409bc604..2840a25b13 100644
---- a/app/test/test_graph.c
-+++ b/app/test/test_graph.c
-@@ -696,6 +696,77 @@ test_graph_clone(void)
- 	return ret;
- }
- 
-+static int
-+test_graph_id_collisions(void)
-+{
-+	static const char *node_patterns[] = {"test_node_source1", "test_node00"};
-+	struct rte_graph_param gconf = {
-+		.socket_id = SOCKET_ID_ANY,
-+		.nb_node_patterns = 2,
-+		.node_patterns = node_patterns,
-+	};
-+	rte_graph_t g1, g2, g3, g4;
-+
-+	g1 = rte_graph_create("worker1", &gconf);
-+	if (g1 == RTE_GRAPH_ID_INVALID) {
-+		printf("Graph 1 creation failed with error = %d\n", rte_errno);
-+		return -1;
-+	}
-+	g2 = rte_graph_create("worker2", &gconf);
-+	if (g2 == RTE_GRAPH_ID_INVALID) {
-+		printf("Graph 2 creation failed with error = %d\n", rte_errno);
-+		return -1;
-+	}
-+	g3 = rte_graph_create("worker3", &gconf);
-+	if (g3 == RTE_GRAPH_ID_INVALID) {
-+		printf("Graph 3 creation failed with error = %d\n", rte_errno);
-+		return -1;
-+	}
-+	if (g1 == g2 || g2 == g3 || g1 == g3) {
-+		printf("Graph ids should be different\n");
-+		return -1;
-+	}
-+	if (rte_graph_destroy(g2) < 0) {
-+		printf("Graph 2 suppression failed\n");
-+		return -1;
-+	}
-+	g4 = rte_graph_create("worker4", &gconf);
-+	if (g4 == RTE_GRAPH_ID_INVALID) {
-+		printf("Graph 4 creation failed with error = %d\n", rte_errno);
-+		return -1;
-+	}
-+	if (g1 == g3 || g1 == g4 || g3 == g4) {
-+		printf("Graph ids should be different\n");
-+		return -1;
-+	}
-+	g2 = rte_graph_clone(g1, "worker2", &gconf);
-+	if (g2 == RTE_GRAPH_ID_INVALID) {
-+		printf("Graph 4 creation failed with error = %d\n", rte_errno);
-+		return -1;
-+	}
-+	if (g1 == g2 || g1 == g3 || g1 == g4 || g2 == g3 || g2 == g4 || g3 == g4) {
-+		printf("Graph ids should be different\n");
-+		return -1;
-+	}
-+	if (rte_graph_destroy(g1) < 0) {
-+		printf("Graph 1 suppression failed\n");
-+		return -1;
-+	}
-+	if (rte_graph_destroy(g2) < 0) {
-+		printf("Graph 2 suppression failed\n");
-+		return -1;
-+	}
-+	if (rte_graph_destroy(g3) < 0) {
-+		printf("Graph 3 suppression failed\n");
-+		return -1;
-+	}
-+	if (rte_graph_destroy(g4) < 0) {
-+		printf("Graph 4 suppression failed\n");
-+		return -1;
-+	}
-+	return 0;
-+}
-+
- static int
- test_graph_model_mcore_dispatch_node_lcore_affinity_set(void)
- {
-@@ -977,6 +1048,7 @@ static struct unit_test_suite graph_testsuite = {
- 		TEST_CASE(test_lookup_functions),
- 		TEST_CASE(test_create_graph),
- 		TEST_CASE(test_graph_clone),
-+		TEST_CASE(test_graph_id_collisions),
- 		TEST_CASE(test_graph_model_mcore_dispatch_node_lcore_affinity_set),
- 		TEST_CASE(test_graph_model_mcore_dispatch_core_bind_unbind),
- 		TEST_CASE(test_graph_worker_model_set_get),
@@ -127 +37 @@
-index 26f0968a97..8ea2109645 100644
+index 3a617cc369..9027e62a26 100644
@@ -130 +40 @@
-@@ -19,11 +19,54 @@
+@@ -18,11 +18,54 @@
@@ -188,21 +98 @@
-@@ -279,7 +322,8 @@ rte_graph_model_mcore_dispatch_core_bind(rte_graph_t id, int lcore)
- {
- 	struct graph *graph;
- 
--	GRAPH_ID_CHECK(id);
-+	if (graph_from_id(id) == NULL)
-+		goto fail;
- 	if (!rte_lcore_is_enabled(lcore))
- 		SET_ERR_JMP(ENOLINK, fail, "lcore %d not enabled", lcore);
- 
-@@ -309,7 +353,8 @@ rte_graph_model_mcore_dispatch_core_unbind(rte_graph_t id)
- {
- 	struct graph *graph;
- 
--	GRAPH_ID_CHECK(id);
-+	if (graph_from_id(id) == NULL)
-+		goto fail;
- 	STAILQ_FOREACH(graph, &graph_list, next)
- 		if (graph->id == id)
- 			break;
-@@ -406,7 +451,7 @@ rte_graph_create(const char *name, struct rte_graph_param *prm)
+@@ -327,7 +370,7 @@ rte_graph_create(const char *name, struct rte_graph_param *prm)
@@ -214,4 +104,4 @@
- 	graph->parent_id = RTE_GRAPH_ID_INVALID;
- 	graph->lcore_id = RTE_MAX_LCORE;
- 	graph->num_pkt_to_capture = prm->num_pkt_to_capture;
-@@ -422,8 +467,7 @@ rte_graph_create(const char *name, struct rte_graph_param *prm)
+ 
+ 	/* Allocate the Graph fast path memory and populate the data */
+ 	if (graph_fp_mem_create(graph))
+@@ -338,8 +381,7 @@ rte_graph_create(const char *name, struct rte_graph_param *prm)
@@ -227 +117 @@
-@@ -467,7 +511,6 @@ rte_graph_destroy(rte_graph_t id)
+@@ -378,7 +420,6 @@ rte_graph_destroy(rte_graph_t id)
@@ -235,30 +125 @@
-@@ -520,7 +563,7 @@ graph_clone(struct graph *parent_graph, const char *name, struct rte_graph_param
- 	graph->parent_id = parent_graph->id;
- 	graph->lcore_id = parent_graph->lcore_id;
- 	graph->socket = parent_graph->socket;
--	graph->id = graph_id;
-+	graph->id = graph_next_free_id();
- 
- 	/* Allocate the Graph fast path memory and populate the data */
- 	if (graph_fp_mem_create(graph))
-@@ -539,8 +582,7 @@ graph_clone(struct graph *parent_graph, const char *name, struct rte_graph_param
- 		goto graph_mem_destroy;
- 
- 	/* All good, Lets add the graph to the list */
--	graph_id++;
--	STAILQ_INSERT_TAIL(&graph_list, graph, next);
-+	graph_insert_ordered(graph);
- 
- 	graph_spinlock_unlock();
- 	return graph->id;
-@@ -561,7 +603,8 @@ rte_graph_clone(rte_graph_t id, const char *name, struct rte_graph_param *prm)
- {
- 	struct graph *graph;
- 
--	GRAPH_ID_CHECK(id);
-+	if (graph_from_id(id) == NULL)
-+		goto fail;
- 	STAILQ_FOREACH(graph, &graph_list, next)
- 		if (graph->id == id)
- 			return graph_clone(graph, name, prm);
-@@ -587,7 +630,8 @@ rte_graph_id_to_name(rte_graph_t id)
+@@ -405,7 +446,8 @@ rte_graph_id_to_name(rte_graph_t id)
@@ -274 +135 @@
-@@ -604,7 +648,8 @@ rte_graph_node_get(rte_graph_t gid, uint32_t nid)
+@@ -422,7 +464,8 @@ rte_graph_node_get(rte_graph_t gid, uint32_t nid)
@@ -284 +145 @@
-@@ -729,7 +774,8 @@ graph_scan_dump(FILE *f, rte_graph_t id, bool all)
+@@ -547,7 +590,8 @@ graph_scan_dump(FILE *f, rte_graph_t id, bool all)
@@ -294 +155 @@
-@@ -758,7 +804,13 @@ rte_graph_list_dump(FILE *f)
+@@ -576,7 +620,13 @@ rte_graph_list_dump(FILE *f)

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'bpf: disable on 32-bit x86' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (59 preceding siblings ...)
  2024-06-24 23:58 ` patch 'graph: fix ID collisions' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'hash: fix RCU reclamation size' " luca.boccassi
                   ` (18 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Luca Boccassi; +Cc: Stephen Hemminger, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/1f65019c2d7ff5396cb18a4ceeba231c6607b881

Thanks.

Luca Boccassi

---
From 1f65019c2d7ff5396cb18a4ceeba231c6607b881 Mon Sep 17 00:00:00 2001
From: Luca Boccassi <bluca@debian.org>
Date: Thu, 25 Apr 2024 16:05:58 +0100
Subject: [PATCH] bpf: disable on 32-bit x86

[ upstream commit 4edbcc7b5313949083f7694847342b1a45659d6b ]

As per Intel, this is not supported, and the librte-bpf test fails on
32bit x86 kernels, so disable the library and the pmd.

Signed-off-by: Luca Boccassi <bluca@debian.org>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
---
 app/test/meson.build           | 11 ++++++++---
 drivers/net/af_xdp/meson.build |  6 ++++++
 lib/bpf/meson.build            |  6 ++++++
 3 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/app/test/meson.build b/app/test/meson.build
index eee02cd8ff..09cbe5e620 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -15,7 +15,6 @@ test_sources = files(
         'test_barrier.c',
         'test_bitops.c',
         'test_bitmap.c',
-        'test_bpf.c',
         'test_byteorder.c',
         'test_cksum.c',
         'test_cksum_perf.c',
@@ -161,8 +160,6 @@ fast_tests = [
         ['acl_autotest', true, true],
         ['atomic_autotest', false, true],
         ['bitmap_autotest', true, true],
-        ['bpf_autotest', true, true],
-        ['bpf_convert_autotest', true, true],
         ['bitops_autotest', true, true],
         ['byteorder_autotest', true, true],
         ['cksum_autotest', true, true],
@@ -430,6 +427,14 @@ if dpdk_conf.has('RTE_HAS_LIBPCAP')
     endif
 endif
 
+if arch_subdir != 'x86' or dpdk_conf.get('RTE_ARCH_64')
+    test_sources += 'test_bpf.c'
+    fast_tests += [
+        ['bpf_autotest', true, true],
+        ['bpf_convert_autotest', true, true],
+    ]
+endif
+
 if cc.has_argument('-Wno-format-truncation')
     cflags += '-Wno-format-truncation'
 endif
diff --git a/drivers/net/af_xdp/meson.build b/drivers/net/af_xdp/meson.build
index 979b914bb6..1182ce5325 100644
--- a/drivers/net/af_xdp/meson.build
+++ b/drivers/net/af_xdp/meson.build
@@ -7,6 +7,12 @@ if is_windows
     subdir_done()
 endif
 
+if arch_subdir == 'x86' and dpdk_conf.get('RTE_ARCH_32')
+    build = false
+    reason = 'not supported on 32-bit x86'
+    subdir_done()
+endif
+
 sources = files('rte_eth_af_xdp.c')
 
 libxdp_ver = '>=1.2.2'
diff --git a/lib/bpf/meson.build b/lib/bpf/meson.build
index cd739bb827..aa258a9061 100644
--- a/lib/bpf/meson.build
+++ b/lib/bpf/meson.build
@@ -7,6 +7,12 @@ if is_windows
     subdir_done()
 endif
 
+if arch_subdir == 'x86' and dpdk_conf.get('RTE_ARCH_32')
+    build = false
+    reason = 'not supported on 32-bit x86'
+    subdir_done()
+endif
+
 sources = files('bpf.c',
         'bpf_dump.c',
         'bpf_exec.c',
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:16.912750848 +0100
+++ 0062-bpf-disable-on-32-bit-x86.patch	2024-06-25 00:22:13.217186301 +0100
@@ -1 +1 @@
-From 4edbcc7b5313949083f7694847342b1a45659d6b Mon Sep 17 00:00:00 2001
+From 1f65019c2d7ff5396cb18a4ceeba231c6607b881 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 4edbcc7b5313949083f7694847342b1a45659d6b ]
+
@@ -9,2 +10,0 @@
-Cc: stable@dpdk.org
-
@@ -14,4 +14,4 @@
- doc/guides/rel_notes/release_24_07.rst | 5 +++++
- drivers/net/af_xdp/meson.build         | 6 ++++++
- lib/bpf/meson.build                    | 6 ++++++
- 3 files changed, 17 insertions(+)
+ app/test/meson.build           | 11 ++++++++---
+ drivers/net/af_xdp/meson.build |  6 ++++++
+ lib/bpf/meson.build            |  6 ++++++
+ 3 files changed, 20 insertions(+), 3 deletions(-)
@@ -19,7 +19,24 @@
-diff --git a/doc/guides/rel_notes/release_24_07.rst b/doc/guides/rel_notes/release_24_07.rst
-index d4970cf6ec..1af7cb91a1 100644
---- a/doc/guides/rel_notes/release_24_07.rst
-+++ b/doc/guides/rel_notes/release_24_07.rst
-@@ -138,6 +138,11 @@ Removed Items
-    Also, make sure to start the actual text at the margin.
-    =======================================================
+diff --git a/app/test/meson.build b/app/test/meson.build
+index eee02cd8ff..09cbe5e620 100644
+--- a/app/test/meson.build
++++ b/app/test/meson.build
+@@ -15,7 +15,6 @@ test_sources = files(
+         'test_barrier.c',
+         'test_bitops.c',
+         'test_bitmap.c',
+-        'test_bpf.c',
+         'test_byteorder.c',
+         'test_cksum.c',
+         'test_cksum_perf.c',
+@@ -161,8 +160,6 @@ fast_tests = [
+         ['acl_autotest', true, true],
+         ['atomic_autotest', false, true],
+         ['bitmap_autotest', true, true],
+-        ['bpf_autotest', true, true],
+-        ['bpf_convert_autotest', true, true],
+         ['bitops_autotest', true, true],
+         ['byteorder_autotest', true, true],
+         ['cksum_autotest', true, true],
+@@ -430,6 +427,14 @@ if dpdk_conf.has('RTE_HAS_LIBPCAP')
+     endif
+ endif
@@ -27 +44,7 @@
-+* **Disabled the BPF library and net/af_xdp for 32-bit x86.**
++if arch_subdir != 'x86' or dpdk_conf.get('RTE_ARCH_64')
++    test_sources += 'test_bpf.c'
++    fast_tests += [
++        ['bpf_autotest', true, true],
++        ['bpf_convert_autotest', true, true],
++    ]
++endif
@@ -29,6 +52,3 @@
-+  BPF is not supported and the librte-bpf test fails on 32-bit x86 kernels.
-+  So disable the library and the pmd.
-+
- 
- API Changes
- -----------
+ if cc.has_argument('-Wno-format-truncation')
+     cflags += '-Wno-format-truncation'
+ endif
@@ -36 +56 @@
-index 280bfa8f80..69d109ff46 100644
+index 979b914bb6..1182ce5325 100644

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'hash: fix RCU reclamation size' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (60 preceding siblings ...)
  2024-06-24 23:58 ` patch 'bpf: disable on 32-bit x86' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'common/mlx5: fix unsigned/signed mismatch' " luca.boccassi
                   ` (17 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Abdullah Ömer Yamaç; +Cc: Honnappa Nagarahalli, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/0ac140899be5dba341dc0438ada302b636fe2dce

Thanks.

Luca Boccassi

---
From 0ac140899be5dba341dc0438ada302b636fe2dce Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Abdullah=20=C3=96mer=20Yama=C3=A7?= <aomeryamac@gmail.com>
Date: Mon, 13 May 2024 16:35:53 +0000
Subject: [PATCH] hash: fix RCU reclamation size
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit d45a7eed07d6b024956d10af529fcdcdd798227f ]

Set the maximum reclamation size to user provided value.

Fixes: 769b2de7fb52 ("hash: implement RCU resources reclamation")

Signed-off-by: Abdullah Ömer Yamaç <aomeryamac@gmail.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 .mailmap                   | 2 +-
 lib/hash/rte_cuckoo_hash.c | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/.mailmap b/.mailmap
index e8953af6f0..6a7e64e72d 100644
--- a/.mailmap
+++ b/.mailmap
@@ -2,7 +2,7 @@ Aakash Sasidharan <asasidharan@marvell.com>
 Aaro Koskinen <aaro.koskinen@nsn.com>
 Aaron Campbell <aaron@arbor.net>
 Aaron Conole <aconole@redhat.com>
-Abdullah Ömer Yamaç <omer.yamac@ceng.metu.edu.tr>
+Abdullah Ömer Yamaç <omer.yamac@ceng.metu.edu.tr> <aomeryamac@gmail.com>
 Abdullah Sevincer <abdullah.sevincer@intel.com>
 Abed Kamaluddin <akamaluddin@marvell.com>
 Abhijit Sinha <abhijit.sinha@intel.com>
diff --git a/lib/hash/rte_cuckoo_hash.c b/lib/hash/rte_cuckoo_hash.c
index 13c8337519..7da32f1d49 100644
--- a/lib/hash/rte_cuckoo_hash.c
+++ b/lib/hash/rte_cuckoo_hash.c
@@ -1543,6 +1543,7 @@ rte_hash_rcu_qsbr_add(struct rte_hash *h, struct rte_hash_rcu_config *cfg)
 		if (params.size == 0)
 			params.size = total_entries;
 		params.trigger_reclaim_limit = cfg->trigger_reclaim_limit;
+		params.max_reclaim_size = cfg->max_reclaim_size;
 		if (params.max_reclaim_size == 0)
 			params.max_reclaim_size = RTE_HASH_RCU_DQ_RECLAIM_MAX;
 		params.esize = sizeof(struct __rte_hash_rcu_dq_entry);
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:16.947801784 +0100
+++ 0063-hash-fix-RCU-reclamation-size.patch	2024-06-25 00:22:13.229186546 +0100
@@ -1 +1 @@
-From d45a7eed07d6b024956d10af529fcdcdd798227f Mon Sep 17 00:00:00 2001
+From 0ac140899be5dba341dc0438ada302b636fe2dce Mon Sep 17 00:00:00 2001
@@ -8,0 +9,2 @@
+[ upstream commit d45a7eed07d6b024956d10af529fcdcdd798227f ]
+
@@ -12 +13,0 @@
-Cc: stable@dpdk.org
@@ -22 +23 @@
-index 3e73eec762..9013e15ea9 100644
+index e8953af6f0..6a7e64e72d 100644
@@ -33 +34 @@
- Abhijit Gangurde <abhijit.gangurde@amd.com>
+ Abhijit Sinha <abhijit.sinha@intel.com>
@@ -35 +36 @@
-index 16c9c4c5c4..265335f845 100644
+index 13c8337519..7da32f1d49 100644
@@ -38 +39 @@
-@@ -1558,6 +1558,7 @@ rte_hash_rcu_qsbr_add(struct rte_hash *h, struct rte_hash_rcu_config *cfg)
+@@ -1543,6 +1543,7 @@ rte_hash_rcu_qsbr_add(struct rte_hash *h, struct rte_hash_rcu_config *cfg)

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'common/mlx5: fix unsigned/signed mismatch' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (61 preceding siblings ...)
  2024-06-24 23:58 ` patch 'hash: fix RCU reclamation size' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'net/mlx5/hws: decrease log level for creation failure' " luca.boccassi
                   ` (16 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Tyler Retzlaff; +Cc: Dariusz Sosnowski, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/17c527107800562b7a8f2bbbb5f78de78b7d2d65

Thanks.

Luca Boccassi

---
From 17c527107800562b7a8f2bbbb5f78de78b7d2d65 Mon Sep 17 00:00:00 2001
From: Tyler Retzlaff <roretzla@linux.microsoft.com>
Date: Mon, 15 Apr 2024 16:09:37 -0700
Subject: [PATCH] common/mlx5: fix unsigned/signed mismatch

[ upstream commit eec253d0a57d707306e4ac3128bc21f10bb8bc5f ]

Use unsigned int for 2 loop indexes that are being compared against an
unsigned int struct field to avoid signed/unsigned mismatch warning.

Fixes: 718d166e5504 ("net/mlx5: create advanced RxQ table via DevX")
Fixes: e1da60a8a6e9 ("common/mlx5: add DevX command to modify RQT")

Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
---
 drivers/common/mlx5/mlx5_devx_cmds.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/common/mlx5/mlx5_devx_cmds.c b/drivers/common/mlx5/mlx5_devx_cmds.c
index c570323fa8..f44be4c230 100644
--- a/drivers/common/mlx5/mlx5_devx_cmds.c
+++ b/drivers/common/mlx5/mlx5_devx_cmds.c
@@ -1661,7 +1661,7 @@ mlx5_devx_cmd_create_rqt(void *ctx,
 	uint32_t out[MLX5_ST_SZ_DW(create_rqt_out)] = {0};
 	void *rqt_ctx;
 	struct mlx5_devx_obj *rqt = NULL;
-	int i;
+	unsigned int i;
 
 	in = mlx5_malloc(MLX5_MEM_ZERO, inlen, 0, SOCKET_ID_ANY);
 	if (!in) {
@@ -1714,7 +1714,7 @@ mlx5_devx_cmd_modify_rqt(struct mlx5_devx_obj *rqt,
 	uint32_t out[MLX5_ST_SZ_DW(modify_rqt_out)] = {0};
 	uint32_t *in = mlx5_malloc(MLX5_MEM_ZERO, inlen, 0, SOCKET_ID_ANY);
 	void *rqt_ctx;
-	int i;
+	unsigned int i;
 	int ret;
 
 	if (!in) {
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:16.984553137 +0100
+++ 0064-common-mlx5-fix-unsigned-signed-mismatch.patch	2024-06-25 00:22:13.229186546 +0100
@@ -1 +1 @@
-From eec253d0a57d707306e4ac3128bc21f10bb8bc5f Mon Sep 17 00:00:00 2001
+From 17c527107800562b7a8f2bbbb5f78de78b7d2d65 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit eec253d0a57d707306e4ac3128bc21f10bb8bc5f ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org
@@ -20 +21 @@
-index 9b7ababae7..9952733c90 100644
+index c570323fa8..f44be4c230 100644
@@ -23 +24 @@
-@@ -1816,7 +1816,7 @@ mlx5_devx_cmd_create_rqt(void *ctx,
+@@ -1661,7 +1661,7 @@ mlx5_devx_cmd_create_rqt(void *ctx,
@@ -32 +33 @@
-@@ -1869,7 +1869,7 @@ mlx5_devx_cmd_modify_rqt(struct mlx5_devx_obj *rqt,
+@@ -1714,7 +1714,7 @@ mlx5_devx_cmd_modify_rqt(struct mlx5_devx_obj *rqt,

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/mlx5/hws: decrease log level for creation failure' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (62 preceding siblings ...)
  2024-06-24 23:58 ` patch 'common/mlx5: fix unsigned/signed mismatch' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'common/mlx5: fix PRM structs' " luca.boccassi
                   ` (15 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Erez Shitrit; +Cc: Matan Azrad, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/a05258399acb2c3262b612ab6e8e94f4363d93ca

Thanks.

Luca Boccassi

---
From a05258399acb2c3262b612ab6e8e94f4363d93ca Mon Sep 17 00:00:00 2001
From: Erez Shitrit <erezsh@nvidia.com>
Date: Mon, 6 May 2024 14:44:04 +0300
Subject: [PATCH] net/mlx5/hws: decrease log level for creation failure

[ upstream commit e014d5e2e49994fbc504a49814ed480a60c85d63 ]

When the user tries to create a matcher and if failed  with specific
errno (E2BIG) the message will be in debug level and not in warning.
It is a part of a feature when the user re-try to insert a new matching
depends on that errno, no need the annoying message.

Fixes: c55c2bf35333 ("net/mlx5/hws: add definer layer")

Signed-off-by: Erez Shitrit <erezsh@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/hws/mlx5dr_definer.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/hws/mlx5dr_definer.c b/drivers/net/mlx5/hws/mlx5dr_definer.c
index d81d66523a..bc1decbec9 100644
--- a/drivers/net/mlx5/hws/mlx5dr_definer.c
+++ b/drivers/net/mlx5/hws/mlx5dr_definer.c
@@ -1842,7 +1842,7 @@ mlx5dr_definer_find_best_hl_fit(struct mlx5dr_context *ctx,
 		return 0;
 	}
 
-	DR_LOG(ERR, "Unable to find supporting match/jumbo definer combination");
+	DR_LOG(DEBUG, "Unable to find supporting match/jumbo definer combination");
 	rte_errno = ENOTSUP;
 	return rte_errno;
 }
@@ -1934,7 +1934,7 @@ int mlx5dr_definer_get(struct mlx5dr_context *ctx,
 	/* Convert items to hl and allocate the field copy array (fc) */
 	ret = mlx5dr_definer_conv_items_to_hl(ctx, mt, hl);
 	if (ret) {
-		DR_LOG(ERR, "Failed to convert items to hl");
+		DR_LOG(DEBUG, "Failed to convert items to hl");
 		goto free_hl;
 	}
 
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:17.020521867 +0100
+++ 0065-net-mlx5-hws-decrease-log-level-for-creation-failure.patch	2024-06-25 00:22:13.233186627 +0100
@@ -1 +1 @@
-From e014d5e2e49994fbc504a49814ed480a60c85d63 Mon Sep 17 00:00:00 2001
+From a05258399acb2c3262b612ab6e8e94f4363d93ca Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit e014d5e2e49994fbc504a49814ed480a60c85d63 ]
+
@@ -12 +13,0 @@
-Cc: stable@dpdk.org
@@ -17,3 +18,2 @@
- drivers/net/mlx5/hws/mlx5dr_definer.c | 6 +++---
- drivers/net/mlx5/hws/mlx5dr_matcher.c | 2 +-
- 2 files changed, 4 insertions(+), 4 deletions(-)
+ drivers/net/mlx5/hws/mlx5dr_definer.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
@@ -22 +22 @@
-index a0f95c6923..88be27dcbb 100644
+index d81d66523a..bc1decbec9 100644
@@ -25 +25 @@
-@@ -3539,7 +3539,7 @@ mlx5dr_definer_find_best_match_fit(struct mlx5dr_context *ctx,
+@@ -1842,7 +1842,7 @@ mlx5dr_definer_find_best_hl_fit(struct mlx5dr_context *ctx,
@@ -31 +31 @@
- 	rte_errno = E2BIG;
+ 	rte_errno = ENOTSUP;
@@ -34,25 +34,3 @@
-@@ -3694,7 +3694,7 @@ mlx5dr_definer_calc_layout(struct mlx5dr_matcher *matcher,
- 	/* Find the match definer layout for header layout match union */
- 	ret = mlx5dr_definer_find_best_match_fit(ctx, match_definer, match_hl);
- 	if (ret) {
--		DR_LOG(ERR, "Failed to create match definer from header layout");
-+		DR_LOG(DEBUG, "Failed to create match definer from header layout");
- 		goto free_fc;
- 	}
- 
-@@ -4046,7 +4046,7 @@ int mlx5dr_definer_matcher_init(struct mlx5dr_context *ctx,
- 
- 	ret = mlx5dr_definer_calc_layout(matcher, &match_layout, &range_layout);
- 	if (ret) {
--		DR_LOG(ERR, "Failed to calculate matcher definer layout");
-+		DR_LOG(DEBUG, "Failed to calculate matcher definer layout");
- 		return ret;
- 	}
- 
-diff --git a/drivers/net/mlx5/hws/mlx5dr_matcher.c b/drivers/net/mlx5/hws/mlx5dr_matcher.c
-index aeff300467..c9f5e46d24 100644
---- a/drivers/net/mlx5/hws/mlx5dr_matcher.c
-+++ b/drivers/net/mlx5/hws/mlx5dr_matcher.c
-@@ -877,7 +877,7 @@ static int mlx5dr_matcher_bind_mt(struct mlx5dr_matcher *matcher)
- 	/* Calculate match, range and hash definers */
- 	ret = mlx5dr_definer_matcher_init(ctx, matcher);
+@@ -1934,7 +1934,7 @@ int mlx5dr_definer_get(struct mlx5dr_context *ctx,
+ 	/* Convert items to hl and allocate the field copy array (fc) */
+ 	ret = mlx5dr_definer_conv_items_to_hl(ctx, mt, hl);
@@ -60,3 +38,3 @@
--		DR_LOG(ERR, "Failed to set matcher templates with match definers");
-+		DR_LOG(DEBUG, "Failed to set matcher templates with match definers");
- 		return ret;
+-		DR_LOG(ERR, "Failed to convert items to hl");
++		DR_LOG(DEBUG, "Failed to convert items to hl");
+ 		goto free_hl;

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'common/mlx5: fix PRM structs' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (63 preceding siblings ...)
  2024-06-24 23:58 ` patch 'net/mlx5/hws: decrease log level for creation failure' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'net/mlx5/hws: fix function comment' " luca.boccassi
                   ` (14 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Yevgeny Kliteynik; +Cc: Matan Azrad, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/06de40842ef37ce6b557e3186d493b219be492e4

Thanks.

Luca Boccassi

---
From 06de40842ef37ce6b557e3186d493b219be492e4 Mon Sep 17 00:00:00 2001
From: Yevgeny Kliteynik <kliteyn@nvidia.com>
Date: Mon, 6 May 2024 14:44:05 +0300
Subject: [PATCH] common/mlx5: fix PRM structs

[ upstream commit 39b1cce562a4e1fa3137fd91a3b1dfed98f23db4 ]

Fix wrong reserved size and add helpful comment

Fixes: 365cdf5f8ce7 ("net/mlx5/hws: add command layer")

Signed-off-by: Yevgeny Kliteynik <kliteyn@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/common/mlx5/mlx5_prm.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/common/mlx5/mlx5_prm.h b/drivers/common/mlx5/mlx5_prm.h
index dab70b9469..f2cd353672 100644
--- a/drivers/common/mlx5/mlx5_prm.h
+++ b/drivers/common/mlx5/mlx5_prm.h
@@ -2116,8 +2116,8 @@ struct mlx5_ifc_cmd_hca_cap_2_bits {
 	u8 reserved_at_d0[0x3];
 	u8 log_conn_track_max_alloc[0x5];
 	u8 reserved_at_d8[0x3];
-	u8 log_max_conn_track_offload[0x5];
-	u8 reserved_at_e0[0x20]; /* End of DW7. */
+	u8 log_max_conn_track_offload[0x5]; /* End of DW7. */
+	u8 reserved_at_e0[0x20];
 	u8 reserved_at_100[0x60];
 	u8 reserved_at_160[0x3];
 	u8 hairpin_sq_wqe_bb_size[0x5];
@@ -3311,7 +3311,7 @@ struct mlx5_ifc_stc_ste_param_vport_bits {
 	u8 eswitch_owner_vhca_id[0x10];
 	u8 vport_number[0x10];
 	u8 eswitch_owner_vhca_id_valid[0x1];
-	u8 reserved_at_21[0x59];
+	u8 reserved_at_21[0x5f];
 };
 
 union mlx5_ifc_stc_param_bits {
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:17.058542614 +0100
+++ 0066-common-mlx5-fix-PRM-structs.patch	2024-06-25 00:22:13.237186709 +0100
@@ -1 +1 @@
-From 39b1cce562a4e1fa3137fd91a3b1dfed98f23db4 Mon Sep 17 00:00:00 2001
+From 06de40842ef37ce6b557e3186d493b219be492e4 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 39b1cce562a4e1fa3137fd91a3b1dfed98f23db4 ]
+
@@ -9 +10,0 @@
-Cc: stable@dpdk.org
@@ -18 +19 @@
-index 2bbbc446fc..178a18a978 100644
+index dab70b9469..f2cd353672 100644
@@ -21 +22 @@
-@@ -2360,8 +2360,8 @@ struct mlx5_ifc_cmd_hca_cap_2_bits {
+@@ -2116,8 +2116,8 @@ struct mlx5_ifc_cmd_hca_cap_2_bits {
@@ -26 +27 @@
--	u8 cross_vhca_object_to_object_supported[0x20]; /* End of DW7. */
+-	u8 reserved_at_e0[0x20]; /* End of DW7. */
@@ -28,5 +29,5 @@
-+	u8 cross_vhca_object_to_object_supported[0x20];
- 	u8 allowed_object_for_other_vhca_access_high[0x20];
- 	u8 allowed_object_for_other_vhca_access[0x20];
- 	u8 reserved_at_140[0x20];
-@@ -3655,7 +3655,7 @@ struct mlx5_ifc_stc_ste_param_vport_bits {
++	u8 reserved_at_e0[0x20];
+ 	u8 reserved_at_100[0x60];
+ 	u8 reserved_at_160[0x3];
+ 	u8 hairpin_sq_wqe_bb_size[0x5];
+@@ -3311,7 +3311,7 @@ struct mlx5_ifc_stc_ste_param_vport_bits {

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/mlx5/hws: fix function comment' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (64 preceding siblings ...)
  2024-06-24 23:58 ` patch 'common/mlx5: fix PRM structs' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'net/mlx5/hws: fix spinlock release on context open' " luca.boccassi
                   ` (13 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Yevgeny Kliteynik; +Cc: Matan Azrad, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/ef9f7c1fd8bf43a5582e3aaca173da5c1c4bae56

Thanks.

Luca Boccassi

---
From ef9f7c1fd8bf43a5582e3aaca173da5c1c4bae56 Mon Sep 17 00:00:00 2001
From: Yevgeny Kliteynik <kliteyn@nvidia.com>
Date: Mon, 6 May 2024 14:44:06 +0300
Subject: [PATCH] net/mlx5/hws: fix function comment

[ upstream commit 735a47fb4ad305a7cc4a191d69afcc6d12763a5c ]

Remove comment that documents parameter that doesn't exist.

Fixes: 3eb748869d2d ("net/mlx5/hws: add send layer")

Signed-off-by: Yevgeny Kliteynik <kliteyn@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/hws/mlx5dr_send.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/mlx5/hws/mlx5dr_send.h b/drivers/net/mlx5/hws/mlx5dr_send.h
index 8d4769495d..28efd70c64 100644
--- a/drivers/net/mlx5/hws/mlx5dr_send.h
+++ b/drivers/net/mlx5/hws/mlx5dr_send.h
@@ -192,8 +192,6 @@ struct mlx5dr_send_ste_attr {
  *   value to write in CPU endian format.
  * @param addr
  *   Address to write to.
- * @param lock
- *   Address of the lock to use for that UAR access.
  */
 static __rte_always_inline void
 mlx5dr_uar_write64_relaxed(uint64_t val, void *addr)
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:17.096417144 +0100
+++ 0067-net-mlx5-hws-fix-function-comment.patch	2024-06-25 00:22:13.237186709 +0100
@@ -1 +1 @@
-From 735a47fb4ad305a7cc4a191d69afcc6d12763a5c Mon Sep 17 00:00:00 2001
+From ef9f7c1fd8bf43a5582e3aaca173da5c1c4bae56 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 735a47fb4ad305a7cc4a191d69afcc6d12763a5c ]
+
@@ -9 +10,0 @@
-Cc: stable@dpdk.org
@@ -18 +19 @@
-index 0c67a9e12d..c4f5a96f9c 100644
+index 8d4769495d..28efd70c64 100644
@@ -21 +22 @@
-@@ -203,8 +203,6 @@ struct mlx5dr_send_ste_attr {
+@@ -192,8 +192,6 @@ struct mlx5dr_send_ste_attr {

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/mlx5/hws: fix spinlock release on context open' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (65 preceding siblings ...)
  2024-06-24 23:58 ` patch 'net/mlx5/hws: fix function comment' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'net/mlx5/hws: add template match none flag' " luca.boccassi
                   ` (12 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Yevgeny Kliteynik; +Cc: Matan Azrad, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/df1753ebe821021b54a0c3bddb33d6e20b72cdef

Thanks.

Luca Boccassi

---
From df1753ebe821021b54a0c3bddb33d6e20b72cdef Mon Sep 17 00:00:00 2001
From: Yevgeny Kliteynik <kliteyn@nvidia.com>
Date: Mon, 6 May 2024 14:44:10 +0300
Subject: [PATCH] net/mlx5/hws: fix spinlock release on context open

[ upstream commit 36ae32b64e607c788961ab48adf24ad1cdf38140 ]

Add missing spinlock destruction in error flow.

Fixes: b0290e56dd08 ("net/mlx5/hws: add context object")

Signed-off-by: Yevgeny Kliteynik <kliteyn@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/hws/mlx5dr_context.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/mlx5/hws/mlx5dr_context.c b/drivers/net/mlx5/hws/mlx5dr_context.c
index 76ada7bb7f..d1923a8e93 100644
--- a/drivers/net/mlx5/hws/mlx5dr_context.c
+++ b/drivers/net/mlx5/hws/mlx5dr_context.c
@@ -210,6 +210,7 @@ struct mlx5dr_context *mlx5dr_context_open(struct ibv_context *ibv_ctx,
 free_caps:
 	simple_free(ctx->caps);
 free_ctx:
+	pthread_spin_destroy(&ctx->ctrl_lock);
 	simple_free(ctx);
 	return NULL;
 }
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:17.130184759 +0100
+++ 0068-net-mlx5-hws-fix-spinlock-release-on-context-open.patch	2024-06-25 00:22:13.237186709 +0100
@@ -1 +1 @@
-From 36ae32b64e607c788961ab48adf24ad1cdf38140 Mon Sep 17 00:00:00 2001
+From df1753ebe821021b54a0c3bddb33d6e20b72cdef Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 36ae32b64e607c788961ab48adf24ad1cdf38140 ]
+
@@ -9 +10,0 @@
-Cc: stable@dpdk.org
@@ -18 +19 @@
-index 15d53c578a..7f120b3b1b 100644
+index 76ada7bb7f..d1923a8e93 100644
@@ -21 +22 @@
-@@ -263,6 +263,7 @@ struct mlx5dr_context *mlx5dr_context_open(struct ibv_context *ibv_ctx,
+@@ -210,6 +210,7 @@ struct mlx5dr_context *mlx5dr_context_open(struct ibv_context *ibv_ctx,

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/mlx5/hws: add template match none flag' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (66 preceding siblings ...)
  2024-06-24 23:58 ` patch 'net/mlx5/hws: fix spinlock release on context open' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'net/mlx5/hws: fix action template dump' " luca.boccassi
                   ` (11 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Yevgeny Kliteynik; +Cc: Matan Azrad, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/4a75ad8a7ea487f596c9d943e2c8b38290ab80fd

Thanks.

Luca Boccassi

---
From 4a75ad8a7ea487f596c9d943e2c8b38290ab80fd Mon Sep 17 00:00:00 2001
From: Yevgeny Kliteynik <kliteyn@nvidia.com>
Date: Mon, 6 May 2024 14:44:11 +0300
Subject: [PATCH] net/mlx5/hws: add template match none flag

[ upstream commit 2471994eedab4090cb73173d9986834b15e98aad ]

Instead of passing 0 as an enum parameter, define flag NONE.
This resolves the following code analysis error: "enumerated
type mixed with another type".
This value is currently used in tests only, and will later
be used in backward-compatible steering API.

Fixes: 5cadd74fbc08 ("net/mlx5: add HW steering low-level abstract stub")

Signed-off-by: Yevgeny Kliteynik <kliteyn@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/hws/mlx5dr.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/mlx5/hws/mlx5dr.h b/drivers/net/mlx5/hws/mlx5dr.h
index f8de27c615..d570810e95 100644
--- a/drivers/net/mlx5/hws/mlx5dr.h
+++ b/drivers/net/mlx5/hws/mlx5dr.h
@@ -81,6 +81,7 @@ enum mlx5dr_action_aso_ct_flags {
 };
 
 enum mlx5dr_match_template_flags {
+	MLX5DR_MATCH_TEMPLATE_FLAG_NONE = 0,
 	/* Allow relaxed matching by skipping derived dependent match fields. */
 	MLX5DR_MATCH_TEMPLATE_FLAG_RELAXED_MATCH = 1,
 };
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:17.167257313 +0100
+++ 0069-net-mlx5-hws-add-template-match-none-flag.patch	2024-06-25 00:22:13.237186709 +0100
@@ -1 +1 @@
-From 2471994eedab4090cb73173d9986834b15e98aad Mon Sep 17 00:00:00 2001
+From 4a75ad8a7ea487f596c9d943e2c8b38290ab80fd Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 2471994eedab4090cb73173d9986834b15e98aad ]
+
@@ -13 +14,0 @@
-Cc: stable@dpdk.org
@@ -22 +23 @@
-index 36ecccf9ac..86cd4f1db5 100644
+index f8de27c615..d570810e95 100644

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/mlx5/hws: fix action template dump' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (67 preceding siblings ...)
  2024-06-24 23:58 ` patch 'net/mlx5/hws: add template match none flag' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'net/mlx5: fix indexed pool with invalid index' " luca.boccassi
                   ` (10 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Hamdan Igbaria; +Cc: Matan Azrad, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/06af59ff2f1c0a192134a097b64fce2f7c231b68

Thanks.

Luca Boccassi

---
From 06af59ff2f1c0a192134a097b64fce2f7c231b68 Mon Sep 17 00:00:00 2001
From: Hamdan Igbaria <hamdani@nvidia.com>
Date: Mon, 6 May 2024 14:44:19 +0300
Subject: [PATCH] net/mlx5/hws: fix action template dump

[ upstream commit 98638051a93963bde144b85e7621ca30252de384 ]

The debug print of only_term param in the action template
was printed incorrectly.

Fixes: 78580cf4e796 ("net/mlx5/hws: add debug layer")

Signed-off-by: Hamdan Igbaria <hamdani@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/hws/mlx5dr_debug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/hws/mlx5dr_debug.c b/drivers/net/mlx5/hws/mlx5dr_debug.c
index 890a761c48..092a87921d 100644
--- a/drivers/net/mlx5/hws/mlx5dr_debug.c
+++ b/drivers/net/mlx5/hws/mlx5dr_debug.c
@@ -129,7 +129,7 @@ mlx5dr_debug_dump_matcher_action_template(FILE *f, struct mlx5dr_matcher *matche
 			      MLX5DR_DEBUG_RES_TYPE_MATCHER_ACTION_TEMPLATE,
 			      (uint64_t)(uintptr_t)at,
 			      (uint64_t)(uintptr_t)matcher,
-			      at->only_term ? 0 : 1,
+			      at->only_term,
 			      is_root ? 0 : at->num_of_action_stes,
 			      at->num_actions);
 		if (ret < 0) {
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:17.200184494 +0100
+++ 0070-net-mlx5-hws-fix-action-template-dump.patch	2024-06-25 00:22:13.241186790 +0100
@@ -1 +1 @@
-From 98638051a93963bde144b85e7621ca30252de384 Mon Sep 17 00:00:00 2001
+From 06af59ff2f1c0a192134a097b64fce2f7c231b68 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 98638051a93963bde144b85e7621ca30252de384 ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -19 +20 @@
-index 5ad4ca2da5..741a725842 100644
+index 890a761c48..092a87921d 100644
@@ -22 +23 @@
-@@ -153,7 +153,7 @@ mlx5dr_debug_dump_matcher_action_template(FILE *f, struct mlx5dr_matcher *matche
+@@ -129,7 +129,7 @@ mlx5dr_debug_dump_matcher_action_template(FILE *f, struct mlx5dr_matcher *matche

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/mlx5: fix indexed pool with invalid index' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (68 preceding siblings ...)
  2024-06-24 23:58 ` patch 'net/mlx5/hws: fix action template dump' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'net/mlx5: fix hash Rx queue release in flow sample' " luca.boccassi
                   ` (9 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Haifei Luo; +Cc: Suanming Mou, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/a752b66a9a502642c47cb4d0f99efbbdc63e62a5

Thanks.

Luca Boccassi

---
From a752b66a9a502642c47cb4d0f99efbbdc63e62a5 Mon Sep 17 00:00:00 2001
From: Haifei Luo <haifeil@nvidia.com>
Date: Wed, 15 May 2024 12:36:53 +0300
Subject: [PATCH] net/mlx5: fix indexed pool with invalid index

[ upstream commit 16a7b5d14e3dfb4d3d385375b94bb2f360883cd6 ]

When _mlx5_ipool_get_cache is called, idx may be invalid and
the "trunk" is NULL in this case. Assert is not correct and add
checks that if trunk is NULL or not. Return NULL If trunk is NULL.

Fixes: 42f463395f8f ("net/mlx5: support indexed pool non-lcore operations")

Signed-off-by: Haifei Luo <haifeil@nvidia.com>
Acked-by: Suanming Mou <suanmingm@nvidia.com>
---
 drivers/net/mlx5/mlx5_utils.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_utils.c b/drivers/net/mlx5/mlx5_utils.c
index b295702fd4..bbe07cd7a3 100644
--- a/drivers/net/mlx5/mlx5_utils.c
+++ b/drivers/net/mlx5/mlx5_utils.c
@@ -379,7 +379,8 @@ _mlx5_ipool_get_cache(struct mlx5_indexed_pool *pool, int cidx, uint32_t idx)
 	idx -= 1;
 	trunk_idx = mlx5_trunk_idx_get(pool, idx);
 	trunk = lc->trunks[trunk_idx];
-	MLX5_ASSERT(trunk);
+	if (!trunk)
+		return NULL;
 	entry_idx = idx - mlx5_trunk_idx_offset_get(pool, trunk_idx);
 	return &trunk->data[entry_idx * pool->cfg.size];
 }
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:17.232911179 +0100
+++ 0071-net-mlx5-fix-indexed-pool-with-invalid-index.patch	2024-06-25 00:22:13.241186790 +0100
@@ -1 +1 @@
-From 16a7b5d14e3dfb4d3d385375b94bb2f360883cd6 Mon Sep 17 00:00:00 2001
+From a752b66a9a502642c47cb4d0f99efbbdc63e62a5 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 16a7b5d14e3dfb4d3d385375b94bb2f360883cd6 ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org
@@ -20 +21 @@
-index fc03cc054b..d52119f0be 100644
+index b295702fd4..bbe07cd7a3 100644

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/mlx5: fix hash Rx queue release in flow sample' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (69 preceding siblings ...)
  2024-06-24 23:58 ` patch 'net/mlx5: fix indexed pool with invalid index' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:58 ` patch 'net/mlx5: fix flow template indirect action failure' " luca.boccassi
                   ` (8 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Jiawei Wang; +Cc: Bing Zhao, Dariusz Sosnowski, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/c8ee47f1a628a73945e85d5b7eaaf290dfeebf3e

Thanks.

Luca Boccassi

---
From c8ee47f1a628a73945e85d5b7eaaf290dfeebf3e Mon Sep 17 00:00:00 2001
From: Jiawei Wang <jiaweiw@nvidia.com>
Date: Mon, 20 May 2024 18:07:09 +0300
Subject: [PATCH] net/mlx5: fix hash Rx queue release in flow sample

[ upstream commit cf3f6ba146abe613c811a281ceadf7b22ef82ab6 ]

While the queue/RSS action was added to sample action lists,
the Rx hash queue resource was allocated in the sample action
translation to create the sample DR action later.

While there's a failure in the flow creation, the Rx hash queue
resource of the sample action list was destroyed in the wrong place.

This patch adds the checking to release the Rx hash queue
resource after the sample action release, to avoid one more
extra release if there's a failure.

Fixes: ca5eb60ecd5b ("net/mlx5: fix resource release for mirror flow")

Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Reviewed-by: Bing Zhao <bingz@nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 1069b84157..f8431386e0 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -14882,7 +14882,8 @@ error:
 	SILIST_FOREACH(priv->sh->ipool[MLX5_IPOOL_MLX5_FLOW], flow->dev_handles,
 		       handle_idx, dh, next) {
 		/* hrxq is union, don't clear it if the flag is not set. */
-		if (dh->fate_action == MLX5_FLOW_FATE_QUEUE && dh->rix_hrxq) {
+		if (dh->fate_action == MLX5_FLOW_FATE_QUEUE && dh->rix_hrxq &&
+		    !dh->dvh.rix_sample && !dh->dvh.rix_dest_array) {
 			mlx5_hrxq_release(dev, dh->rix_hrxq);
 			dh->rix_hrxq = 0;
 		} else if (dh->fate_action == MLX5_FLOW_FATE_SHARED_RSS) {
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:17.266755069 +0100
+++ 0072-net-mlx5-fix-hash-Rx-queue-release-in-flow-sample.patch	2024-06-25 00:22:13.257187117 +0100
@@ -1 +1 @@
-From cf3f6ba146abe613c811a281ceadf7b22ef82ab6 Mon Sep 17 00:00:00 2001
+From c8ee47f1a628a73945e85d5b7eaaf290dfeebf3e Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit cf3f6ba146abe613c811a281ceadf7b22ef82ab6 ]
+
@@ -18 +19,0 @@
-Cc: stable@dpdk.org
@@ -28 +29 @@
-index 04cb9291a8..7330e13787 100644
+index 1069b84157..f8431386e0 100644
@@ -31 +32 @@
-@@ -15668,7 +15668,8 @@ error:
+@@ -14882,7 +14882,8 @@ error:

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/mlx5: fix flow template indirect action failure' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (70 preceding siblings ...)
  2024-06-24 23:58 ` patch 'net/mlx5: fix hash Rx queue release in flow sample' " luca.boccassi
@ 2024-06-24 23:58 ` luca.boccassi
  2024-06-24 23:59 ` patch 'net/mlx5: break flow resource release loop' " luca.boccassi
                   ` (7 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:58 UTC (permalink / raw)
  To: Maayan Kashani; +Cc: Suanming Mou, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/42e1eb6a45859dbc9b51f80ef7344747dfbaef78

Thanks.

Luca Boccassi

---
From 42e1eb6a45859dbc9b51f80ef7344747dfbaef78 Mon Sep 17 00:00:00 2001
From: Maayan Kashani <mkashani@nvidia.com>
Date: Sun, 26 May 2024 16:22:44 +0300
Subject: [PATCH] net/mlx5: fix flow template indirect action failure

[ upstream commit b79ac509105a2cf9fce1734a6798632a0414cd1c ]

For indirect action type, on  error case the function jumped to err
but returned zero cause rte_errno was not initialized before the jump.
It caused no error in table creation.

In case reaching an error, if rte_errno is not initialized,
it will be set to EINVAL.
Now table creation should fail if the translate of the action fails.
Added driver log warnings so it can be easy to track failure on shared
actions translate.

Fixes: 7ab3962d2d2b ("net/mlx5: add indirect HW steering action")

Signed-off-by: Maayan Kashani <mkashani@nvidia.com>
Acked-by: Suanming Mou <suanmingm@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_hw.c | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index fd3e51bf0d..5333495a59 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -769,15 +769,19 @@ flow_hw_shared_action_translate(struct rte_eth_dev *dev,
 		if (!shared_rss || __flow_hw_act_data_shared_rss_append
 		    (priv, acts,
 		    (enum rte_flow_action_type)MLX5_RTE_FLOW_ACTION_TYPE_RSS,
-		    action_src, action_dst, idx, shared_rss))
+		    action_src, action_dst, idx, shared_rss)) {
+			DRV_LOG(WARNING, "Indirect RSS action index %d translate failed", act_idx);
 			return -1;
+		}
 		break;
 	case MLX5_INDIRECT_ACTION_TYPE_COUNT:
 		if (__flow_hw_act_data_shared_cnt_append(priv, acts,
 			(enum rte_flow_action_type)
 			MLX5_RTE_FLOW_ACTION_TYPE_COUNT,
-			action_src, action_dst, act_idx))
+			action_src, action_dst, act_idx)) {
+			DRV_LOG(WARNING, "Indirect count action translate failed");
 			return -1;
+		}
 		break;
 	case MLX5_INDIRECT_ACTION_TYPE_AGE:
 		/* Not supported, prevent by validate function. */
@@ -785,15 +789,19 @@ flow_hw_shared_action_translate(struct rte_eth_dev *dev,
 		break;
 	case MLX5_INDIRECT_ACTION_TYPE_CT:
 		if (flow_hw_ct_compile(dev, MLX5_HW_INV_QUEUE,
-				       idx, &acts->rule_acts[action_dst]))
+				       idx, &acts->rule_acts[action_dst])) {
+			DRV_LOG(WARNING, "Indirect CT action translate failed");
 			return -1;
+		}
 		break;
 	case MLX5_INDIRECT_ACTION_TYPE_METER_MARK:
 		if (__flow_hw_act_data_shared_mtr_append(priv, acts,
 			(enum rte_flow_action_type)
 			MLX5_RTE_FLOW_ACTION_TYPE_METER_MARK,
-			action_src, action_dst, idx))
+			action_src, action_dst, idx)) {
+			DRV_LOG(WARNING, "Indirect meter mark action translate failed");
 			return -1;
+		}
 		break;
 	default:
 		DRV_LOG(WARNING, "Unsupported shared action type:%d", type);
@@ -1758,6 +1766,9 @@ __flow_hw_actions_translate(struct rte_eth_dev *dev,
 	}
 	return 0;
 err:
+	/* If rte_errno was not initialized and reached error state. */
+	if (!rte_errno)
+		rte_errno = EINVAL;
 	err = rte_errno;
 	__flow_hw_action_template_destroy(dev, acts);
 	return rte_flow_error_set(error, err,
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:17.314201284 +0100
+++ 0073-net-mlx5-fix-flow-template-indirect-action-failure.patch	2024-06-25 00:22:13.265187280 +0100
@@ -1 +1 @@
-From b79ac509105a2cf9fce1734a6798632a0414cd1c Mon Sep 17 00:00:00 2001
+From 42e1eb6a45859dbc9b51f80ef7344747dfbaef78 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit b79ac509105a2cf9fce1734a6798632a0414cd1c ]
+
@@ -17 +18,0 @@
-Cc: stable@dpdk.org
@@ -26 +27 @@
-index d9140dbf23..463f7b87a3 100644
+index fd3e51bf0d..5333495a59 100644
@@ -29 +30 @@
-@@ -1106,15 +1106,19 @@ flow_hw_shared_action_translate(struct rte_eth_dev *dev,
+@@ -769,15 +769,19 @@ flow_hw_shared_action_translate(struct rte_eth_dev *dev,
@@ -51 +52 @@
-@@ -1122,15 +1126,19 @@ flow_hw_shared_action_translate(struct rte_eth_dev *dev,
+@@ -785,15 +789,19 @@ flow_hw_shared_action_translate(struct rte_eth_dev *dev,
@@ -71,3 +72,3 @@
- 	case MLX5_INDIRECT_ACTION_TYPE_QUOTA:
- 		flow_hw_construct_quota(priv, &acts->rule_acts[action_dst], idx);
-@@ -2645,6 +2653,9 @@ __flow_hw_actions_translate(struct rte_eth_dev *dev,
+ 	default:
+ 		DRV_LOG(WARNING, "Unsupported shared action type:%d", type);
+@@ -1758,6 +1766,9 @@ __flow_hw_actions_translate(struct rte_eth_dev *dev,

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/mlx5: break flow resource release loop' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (71 preceding siblings ...)
  2024-06-24 23:58 ` patch 'net/mlx5: fix flow template indirect action failure' " luca.boccassi
@ 2024-06-24 23:59 ` luca.boccassi
  2024-06-24 23:59 ` patch 'net/mlx5: fix access to flow template operations' " luca.boccassi
                   ` (6 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:59 UTC (permalink / raw)
  To: Alexander Kozyrev; +Cc: Dariusz Sosnowski, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/68b68c76e1f2f9112d5016c732a00e97a0e5460f

Thanks.

Luca Boccassi

---
From 68b68c76e1f2f9112d5016c732a00e97a0e5460f Mon Sep 17 00:00:00 2001
From: Alexander Kozyrev <akozyrev@nvidia.com>
Date: Thu, 30 May 2024 00:46:32 +0300
Subject: [PATCH] net/mlx5: break flow resource release loop

[ upstream commit 4fcb7a05e38172aed60f87a6287bb2ee3d9828fd ]

There is a loop inside the flow_hw_resource_release() function
that tries to free all the template patterns and tables until they
are successfully released. But some of the tables may be still in use
in case of the ungraceful application termination. Which causes the
forever loop in the app on the exit. Don't wait for the tables release
and try them to free only once and proceed with the exit.

Fixes: d1559d66ed2d ("net/mlx5: add table management")

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_hw.c | 44 +++++++++++++++++++--------------
 1 file changed, 26 insertions(+), 18 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index 5333495a59..c902b35f0b 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -3407,7 +3407,7 @@ flow_hw_table_destroy(struct rte_eth_dev *dev,
 		return rte_flow_error_set(error, EBUSY,
 				   RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
 				   NULL,
-				   "table in using");
+				   "table is in use");
 	}
 	LIST_REMOVE(table, next);
 	for (i = 0; i < table->nb_item_templates; i++)
@@ -4660,7 +4660,7 @@ flow_hw_actions_template_destroy(struct rte_eth_dev *dev __rte_unused,
 		return rte_flow_error_set(error, EBUSY,
 				   RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
 				   NULL,
-				   "action template in using");
+				   "action template is in use");
 	}
 	LIST_REMOVE(template, next);
 	if (template->tmpl)
@@ -5013,7 +5013,7 @@ flow_hw_pattern_template_destroy(struct rte_eth_dev *dev __rte_unused,
 		return rte_flow_error_set(error, EBUSY,
 				   RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
 				   NULL,
-				   "item template in using");
+				   "item template is in use");
 	}
 	LIST_REMOVE(template, next);
 	claim_zero(mlx5dr_match_template_destroy(template->mt));
@@ -7458,9 +7458,9 @@ void
 flow_hw_resource_release(struct rte_eth_dev *dev)
 {
 	struct mlx5_priv *priv = dev->data->dev_private;
-	struct rte_flow_template_table *tbl;
-	struct rte_flow_pattern_template *it;
-	struct rte_flow_actions_template *at;
+	struct rte_flow_template_table *tbl, *temp_tbl;
+	struct rte_flow_pattern_template *it, *temp_it;
+	struct rte_flow_actions_template *at, *temp_at;
 	uint32_t i;
 
 	if (!priv->dr_ctx)
@@ -7470,21 +7470,29 @@ flow_hw_resource_release(struct rte_eth_dev *dev)
 	flow_hw_cleanup_ctrl_fdb_tables(dev);
 	flow_hw_cleanup_tx_repr_tagging(dev);
 	flow_hw_cleanup_ctrl_rx_tables(dev);
-	while (!LIST_EMPTY(&priv->flow_hw_tbl_ongo)) {
-		tbl = LIST_FIRST(&priv->flow_hw_tbl_ongo);
-		flow_hw_table_destroy(dev, tbl, NULL);
+	tbl = LIST_FIRST(&priv->flow_hw_tbl_ongo);
+	while (tbl) {
+		temp_tbl = LIST_NEXT(tbl, next);
+		claim_zero(flow_hw_table_destroy(dev, tbl, NULL));
+		tbl = temp_tbl;
 	}
-	while (!LIST_EMPTY(&priv->flow_hw_tbl)) {
-		tbl = LIST_FIRST(&priv->flow_hw_tbl);
-		flow_hw_table_destroy(dev, tbl, NULL);
+	tbl = LIST_FIRST(&priv->flow_hw_tbl);
+	while (tbl) {
+		temp_tbl = LIST_NEXT(tbl, next);
+		claim_zero(flow_hw_table_destroy(dev, tbl, NULL));
+		tbl = temp_tbl;
 	}
-	while (!LIST_EMPTY(&priv->flow_hw_itt)) {
-		it = LIST_FIRST(&priv->flow_hw_itt);
-		flow_hw_pattern_template_destroy(dev, it, NULL);
+	it = LIST_FIRST(&priv->flow_hw_itt);
+	while (it) {
+		temp_it = LIST_NEXT(it, next);
+		claim_zero(flow_hw_pattern_template_destroy(dev, it, NULL));
+		it = temp_it;
 	}
-	while (!LIST_EMPTY(&priv->flow_hw_at)) {
-		at = LIST_FIRST(&priv->flow_hw_at);
-		flow_hw_actions_template_destroy(dev, at, NULL);
+	at = LIST_FIRST(&priv->flow_hw_at);
+	while (at) {
+		temp_at = LIST_NEXT(at, next);
+		claim_zero(flow_hw_actions_template_destroy(dev, at, NULL));
+		at = temp_at;
 	}
 	for (i = 0; i < MLX5_HW_ACTION_FLAG_MAX; i++) {
 		if (priv->hw_drop[i])
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:17.360608425 +0100
+++ 0074-net-mlx5-break-flow-resource-release-loop.patch	2024-06-25 00:22:13.273187443 +0100
@@ -1 +1 @@
-From 4fcb7a05e38172aed60f87a6287bb2ee3d9828fd Mon Sep 17 00:00:00 2001
+From 68b68c76e1f2f9112d5016c732a00e97a0e5460f Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 4fcb7a05e38172aed60f87a6287bb2ee3d9828fd ]
+
@@ -14 +15,0 @@
-Cc: stable@dpdk.org
@@ -19,2 +20,2 @@
- drivers/net/mlx5/mlx5_flow_hw.c | 54 +++++++++++++++++++--------------
- 1 file changed, 32 insertions(+), 22 deletions(-)
+ drivers/net/mlx5/mlx5_flow_hw.c | 44 +++++++++++++++++++--------------
+ 1 file changed, 26 insertions(+), 18 deletions(-)
@@ -23 +24 @@
-index e8c06387f8..53c6cc5961 100644
+index 5333495a59..c902b35f0b 100644
@@ -26 +27 @@
-@@ -5062,7 +5062,7 @@ flow_hw_table_destroy(struct rte_eth_dev *dev,
+@@ -3407,7 +3407,7 @@ flow_hw_table_destroy(struct rte_eth_dev *dev,
@@ -30 +31 @@
--				   "table in use");
+-				   "table in using");
@@ -35 +36 @@
-@@ -7362,7 +7362,7 @@ flow_hw_actions_template_destroy(struct rte_eth_dev *dev,
+@@ -4660,7 +4660,7 @@ flow_hw_actions_template_destroy(struct rte_eth_dev *dev __rte_unused,
@@ -42,3 +43,3 @@
- 	if (template->action_flags & flag)
- 		mlx5_free_srh_flex_parser(dev);
-@@ -7986,7 +7986,7 @@ flow_hw_pattern_template_destroy(struct rte_eth_dev *dev,
+ 	LIST_REMOVE(template, next);
+ 	if (template->tmpl)
+@@ -5013,7 +5013,7 @@ flow_hw_pattern_template_destroy(struct rte_eth_dev *dev __rte_unused,
@@ -51,3 +52,3 @@
- 	if (template->item_flags & (MLX5_FLOW_ITEM_OUTER_IPV6_ROUTING_EXT |
- 				    MLX5_FLOW_ITEM_INNER_IPV6_ROUTING_EXT))
-@@ -10787,10 +10787,10 @@ void
+ 	LIST_REMOVE(template, next);
+ 	claim_zero(mlx5dr_match_template_destroy(template->mt));
+@@ -7458,9 +7458,9 @@ void
@@ -60 +60,0 @@
--	struct mlx5_flow_group *grp;
@@ -64 +63,0 @@
-+	struct mlx5_flow_group *grp, *temp_grp;
@@ -68 +67,2 @@
-@@ -10802,25 +10802,35 @@ flow_hw_resource_release(struct rte_eth_dev *dev)
+@@ -7470,21 +7470,29 @@ flow_hw_resource_release(struct rte_eth_dev *dev)
+ 	flow_hw_cleanup_ctrl_fdb_tables(dev);
@@ -71,10 +70,0 @@
- 	flow_hw_action_template_drop_release(dev);
--	while (!LIST_EMPTY(&priv->flow_hw_grp)) {
--		grp = LIST_FIRST(&priv->flow_hw_grp);
--		flow_hw_group_unset_miss_group(dev, grp, NULL);
-+	grp = LIST_FIRST(&priv->flow_hw_grp);
-+	while (grp) {
-+		temp_grp = LIST_NEXT(grp, next);
-+		claim_zero(flow_hw_group_unset_miss_group(dev, grp, NULL));
-+		grp = temp_grp;
- 	}

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/mlx5: fix access to flow template operations' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (72 preceding siblings ...)
  2024-06-24 23:59 ` patch 'net/mlx5: break flow resource release loop' " luca.boccassi
@ 2024-06-24 23:59 ` luca.boccassi
  2024-06-24 23:59 ` patch 'net/mlx5: support jump in meter hierarchy' " luca.boccassi
                   ` (5 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:59 UTC (permalink / raw)
  To: Gregory Etelson; +Cc: Dariusz Sosnowski, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/739bd81a4664d03fc0357dab0de07e87d8896f4a

Thanks.

Luca Boccassi

---
From 739bd81a4664d03fc0357dab0de07e87d8896f4a Mon Sep 17 00:00:00 2001
From: Gregory Etelson <getelson@nvidia.com>
Date: Sun, 2 Jun 2024 09:00:49 +0300
Subject: [PATCH] net/mlx5: fix access to flow template operations

[ upstream commit acbb57b25d30147d1fd0edf1e8314a0a3d3c38c9 ]

PMD activates HWS template API context during port configuration.

There was no validation that the HWS context was activated before
the PMD tried to process other template function calls.

The patch adds HWS context validation.

Fixes: b401400db24e ("net/mlx5: add port flow configuration")

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_hw.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index c902b35f0b..45709c9fd2 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -56,6 +56,20 @@
 #define MLX5_HW_VLAN_PUSH_VID_IDX 1
 #define MLX5_HW_VLAN_PUSH_PCP_IDX 2
 
+static bool
+mlx5_hw_ctx_validate(const struct rte_eth_dev *dev, struct rte_flow_error *error)
+{
+	const struct mlx5_priv *priv = dev->data->dev_private;
+
+	if (!priv->dr_ctx) {
+		rte_flow_error_set(error, EINVAL,
+				   RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
+				   "non-template flow engine was not configured");
+		return false;
+	}
+	return true;
+}
+
 static int flow_hw_flush_all_ctrl_flows(struct rte_eth_dev *dev);
 static int flow_hw_translate_group(struct rte_eth_dev *dev,
 				   const struct mlx5_flow_template_table_cfg *cfg,
@@ -3965,6 +3979,8 @@ mlx5_flow_hw_actions_validate(struct rte_eth_dev *dev,
 	bool actions_end = false;
 	int ret;
 
+	if (!mlx5_hw_ctx_validate(dev, error))
+		return -rte_errno;
 	/* FDB actions are only valid to proxy port. */
 	if (attr->transfer && (!priv->sh->config.dv_esw_en || !priv->master))
 		return rte_flow_error_set(error, EINVAL,
@@ -4717,6 +4733,8 @@ flow_hw_pattern_validate(struct rte_eth_dev *dev,
 	bool items_end = false;
 	uint32_t tag_bitmap = 0;
 
+	if (!mlx5_hw_ctx_validate(dev, error))
+		return -rte_errno;
 	if (!attr->ingress && !attr->egress && !attr->transfer)
 		return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ATTR, NULL,
 					  "at least one of the direction attributes"
@@ -7975,6 +7993,9 @@ flow_hw_action_handle_create(struct rte_eth_dev *dev, uint32_t queue,
 	bool push = true;
 	bool aso = false;
 
+	if (!mlx5_hw_ctx_validate(dev, error))
+		return NULL;
+
 	if (attr) {
 		MLX5_ASSERT(queue != MLX5_HW_INV_QUEUE);
 		if (unlikely(!priv->hw_q[queue].job_idx)) {
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:17.404405798 +0100
+++ 0075-net-mlx5-fix-access-to-flow-template-operations.patch	2024-06-25 00:22:13.281187606 +0100
@@ -1 +1 @@
-From acbb57b25d30147d1fd0edf1e8314a0a3d3c38c9 Mon Sep 17 00:00:00 2001
+From 739bd81a4664d03fc0357dab0de07e87d8896f4a Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit acbb57b25d30147d1fd0edf1e8314a0a3d3c38c9 ]
+
@@ -14 +15,0 @@
-Cc: stable@dpdk.org
@@ -19,2 +20,2 @@
- drivers/net/mlx5/mlx5_flow_hw.c | 22 ++++++++++++++++++++++
- 1 file changed, 22 insertions(+)
+ drivers/net/mlx5/mlx5_flow_hw.c | 21 +++++++++++++++++++++
+ 1 file changed, 21 insertions(+)
@@ -23 +24 @@
-index 53c6cc5961..e97afb0c86 100644
+index c902b35f0b..45709c9fd2 100644
@@ -26,3 +27,3 @@
-@@ -206,6 +206,20 @@ mlx5_destroy_multi_pattern_segment(struct mlx5_multi_pattern_segment *segment);
- static __rte_always_inline enum mlx5_indirect_list_type
- flow_hw_inlist_type_get(const struct rte_flow_action *actions);
+@@ -56,6 +56,20 @@
+ #define MLX5_HW_VLAN_PUSH_VID_IDX 1
+ #define MLX5_HW_VLAN_PUSH_PCP_IDX 2
@@ -44,4 +45,5 @@
- static __rte_always_inline int
- mlx5_multi_pattern_reformat_to_index(enum mlx5dr_action_type type)
- {
-@@ -6399,6 +6413,8 @@ mlx5_flow_hw_actions_validate(struct rte_eth_dev *dev,
+ static int flow_hw_flush_all_ctrl_flows(struct rte_eth_dev *dev);
+ static int flow_hw_translate_group(struct rte_eth_dev *dev,
+ 				   const struct mlx5_flow_template_table_cfg *cfg,
+@@ -3965,6 +3979,8 @@ mlx5_flow_hw_actions_validate(struct rte_eth_dev *dev,
+ 	bool actions_end = false;
@@ -49 +50,0 @@
- 	const struct rte_flow_action_ipv6_ext_remove *remove_data;
@@ -56 +57,2 @@
-@@ -7528,6 +7544,8 @@ flow_hw_pattern_validate(struct rte_eth_dev *dev,
+@@ -4717,6 +4733,8 @@ flow_hw_pattern_validate(struct rte_eth_dev *dev,
+ 	bool items_end = false;
@@ -58 +59,0 @@
- 	int ret;
@@ -65 +66,2 @@
-@@ -11259,6 +11277,8 @@ flow_hw_action_handle_create(struct rte_eth_dev *dev, uint32_t queue,
+@@ -7975,6 +7993,9 @@ flow_hw_action_handle_create(struct rte_eth_dev *dev, uint32_t queue,
+ 	bool push = true;
@@ -67,10 +68,0 @@
- 	bool force_job = action->type == RTE_FLOW_ACTION_TYPE_METER_MARK;
- 
-+	if (!mlx5_hw_ctx_validate(dev, error))
-+		return NULL;
- 	if (attr || force_job) {
- 		job = flow_hw_action_job_init(priv, queue, NULL, user_data,
- 					      NULL, MLX5_HW_Q_JOB_TYPE_CREATE,
-@@ -12541,6 +12561,8 @@ flow_hw_async_action_list_handle_create(struct rte_eth_dev *dev, uint32_t queue,
- 		}
- 	};
@@ -80,3 +72,4 @@
- 	if (!actions) {
- 		rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION,
- 				   NULL, "No action list");
++
+ 	if (attr) {
+ 		MLX5_ASSERT(queue != MLX5_HW_INV_QUEUE);
+ 		if (unlikely(!priv->hw_q[queue].job_idx)) {

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/mlx5: support jump in meter hierarchy' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (73 preceding siblings ...)
  2024-06-24 23:59 ` patch 'net/mlx5: fix access to flow template operations' " luca.boccassi
@ 2024-06-24 23:59 ` luca.boccassi
  2024-06-24 23:59 ` patch 'net/mlx5: fix crash on counter pool destroy' " luca.boccassi
                   ` (4 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:59 UTC (permalink / raw)
  To: Shun Hao; +Cc: Suanming Mou, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/aadaf7fe72821e2d27cbf4f95c25b909ededc49d

Thanks.

Luca Boccassi

---
From aadaf7fe72821e2d27cbf4f95c25b909ededc49d Mon Sep 17 00:00:00 2001
From: Shun Hao <shunh@nvidia.com>
Date: Tue, 4 Jun 2024 05:51:56 +0300
Subject: [PATCH] net/mlx5: support jump in meter hierarchy

[ upstream commit dc1d92a4f547f8af6eb9b8824257ab3fd8dfbc77 ]

Currently in meter hierarchy, only meter action is supported for green
and yellow policy flow.
This patch adds support of jump action for green or yellow policy flow.

Fixes: 96ca87da4f46 ("net/mlx5: validate yellow meter action")

Signed-off-by: Shun Hao <shunh@nvidia.com>
Acked-by: Suanming Mou <suanmingm@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 36 ++++++++++++++++++---------------
 1 file changed, 20 insertions(+), 16 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index f8431386e0..2bdca754bc 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -17173,7 +17173,7 @@ __flow_dv_create_policy_matcher(struct rte_eth_dev *dev,
 static int
 __flow_dv_create_domain_policy_rules(struct rte_eth_dev *dev,
 		struct mlx5_flow_meter_sub_policy *sub_policy,
-		uint8_t egress, uint8_t transfer, bool match_src_port,
+		uint8_t egress, uint8_t transfer, bool *match_src_port,
 		struct mlx5_meter_policy_acts acts[RTE_COLORS])
 {
 	struct mlx5_priv *priv = dev->data->dev_private;
@@ -17188,6 +17188,7 @@ __flow_dv_create_domain_policy_rules(struct rte_eth_dev *dev,
 		.reserved = 0,
 	};
 	int i;
+	uint16_t priority;
 	int ret = mlx5_flow_get_reg_id(dev, MLX5_MTR_COLOR, 0, &flow_err);
 	struct mlx5_sub_policy_color_rule *color_rule;
 	struct mlx5_sub_policy_color_rule *tmp_rules[RTE_COLORS] = {NULL};
@@ -17222,12 +17223,12 @@ __flow_dv_create_domain_policy_rules(struct rte_eth_dev *dev,
 		TAILQ_INSERT_TAIL(&sub_policy->color_rules[i],
 				  color_rule, next_port);
 		color_rule->src_port = priv->representor_id;
-		/* No use. */
-		attr.priority = i;
+		priority = (match_src_port[i] == match_src_port[RTE_COLOR_GREEN]) ?
+			   MLX5_MTR_POLICY_MATCHER_PRIO : (MLX5_MTR_POLICY_MATCHER_PRIO + 1);
 		/* Create matchers for colors. */
 		if (__flow_dv_create_policy_matcher(dev, color_reg_c_idx,
-				MLX5_MTR_POLICY_MATCHER_PRIO, sub_policy,
-				&attr, match_src_port, NULL,
+				priority, sub_policy,
+				&attr, match_src_port[i], NULL,
 				&color_rule->matcher, &flow_err)) {
 			DRV_LOG(ERR, "Failed to create color%u matcher.", i);
 			goto err_exit;
@@ -17237,7 +17238,7 @@ __flow_dv_create_domain_policy_rules(struct rte_eth_dev *dev,
 				color_reg_c_idx, (enum rte_color)i,
 				color_rule->matcher,
 				acts[i].actions_n, acts[i].dv_actions,
-				match_src_port, NULL, &color_rule->rule,
+				match_src_port[i], NULL, &color_rule->rule,
 				&attr)) {
 			DRV_LOG(ERR, "Failed to create color%u rule.", i);
 			goto err_exit;
@@ -17285,7 +17286,7 @@ __flow_dv_create_policy_acts_rules(struct rte_eth_dev *dev,
 	uint8_t egress = (domain == MLX5_MTR_DOMAIN_EGRESS) ? 1 : 0;
 	uint8_t transfer = (domain == MLX5_MTR_DOMAIN_TRANSFER) ? 1 : 0;
 	bool mtr_first = egress || (transfer && priv->representor_id != UINT16_MAX);
-	bool match_src_port = false;
+	bool match_src_port[RTE_COLORS] = {false};
 	int i;
 
 	/* If RSS or Queue, no previous actions / rules is created. */
@@ -17356,7 +17357,7 @@ __flow_dv_create_policy_acts_rules(struct rte_eth_dev *dev,
 				acts[i].dv_actions[acts[i].actions_n] =
 					port_action->action;
 				acts[i].actions_n++;
-				match_src_port = true;
+				match_src_port[i] = true;
 				break;
 			case MLX5_FLOW_FATE_DROP:
 			case MLX5_FLOW_FATE_JUMP:
@@ -17408,7 +17409,7 @@ __flow_dv_create_policy_acts_rules(struct rte_eth_dev *dev,
 				acts[i].dv_actions[acts[i].actions_n++] =
 							tbl_data->jump.action;
 				if (mtr_policy->act_cnt[i].modify_hdr)
-					match_src_port = !!transfer;
+					match_src_port[i] = !!transfer;
 				break;
 			default:
 				/*Queue action do nothing*/
@@ -17422,9 +17423,9 @@ __flow_dv_create_policy_acts_rules(struct rte_eth_dev *dev,
 			"Failed to create policy rules per domain.");
 		goto err_exit;
 	}
-	if (match_src_port) {
-		mtr_policy->match_port = match_src_port;
-		mtr_policy->hierarchy_match_port = match_src_port;
+	if (match_src_port[RTE_COLOR_GREEN] || match_src_port[RTE_COLOR_YELLOW]) {
+		mtr_policy->match_port = 1;
+		mtr_policy->hierarchy_match_port = 1;
 	}
 	return 0;
 err_exit:
@@ -17486,6 +17487,7 @@ __flow_dv_create_domain_def_policy(struct rte_eth_dev *dev, uint32_t domain)
 	uint8_t egress, transfer;
 	struct rte_flow_error error;
 	struct mlx5_meter_policy_acts acts[RTE_COLORS];
+	bool match_src_port[RTE_COLORS] = {false};
 	int ret;
 
 	egress = (domain == MLX5_MTR_DOMAIN_EGRESS) ? 1 : 0;
@@ -17561,7 +17563,7 @@ __flow_dv_create_domain_def_policy(struct rte_eth_dev *dev, uint32_t domain)
 		/* Create default policy rules. */
 		ret = __flow_dv_create_domain_policy_rules(dev,
 					&def_policy->sub_policy,
-					egress, transfer, false, acts);
+					egress, transfer, match_src_port, acts);
 		if (ret) {
 			DRV_LOG(ERR, "Failed to create default policy rules.");
 			goto def_policy_error;
@@ -19142,11 +19144,13 @@ flow_dv_validate_mtr_policy_acts(struct rte_eth_dev *dev,
 		}
 	}
 	if (next_mtr && *policy_mode == MLX5_MTR_POLICY_MODE_ALL) {
-		if (!(action_flags[RTE_COLOR_GREEN] & action_flags[RTE_COLOR_YELLOW] &
-		      MLX5_FLOW_ACTION_METER_WITH_TERMINATED_POLICY))
+		uint64_t hierarchy_type_flag =
+			MLX5_FLOW_ACTION_METER_WITH_TERMINATED_POLICY | MLX5_FLOW_ACTION_JUMP;
+		if (!(action_flags[RTE_COLOR_GREEN] & hierarchy_type_flag) ||
+		    !(action_flags[RTE_COLOR_YELLOW] & hierarchy_type_flag))
 			return -rte_mtr_error_set(error, EINVAL, RTE_MTR_ERROR_TYPE_METER_POLICY,
 						  NULL,
-						  "Meter hierarchy supports meter action only.");
+						  "Unsupported action in meter hierarchy.");
 	}
 	/* If both colors have RSS, the attributes should be the same. */
 	if (flow_dv_mtr_policy_rss_compare(rss_color[RTE_COLOR_GREEN],
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:17.447954111 +0100
+++ 0076-net-mlx5-support-jump-in-meter-hierarchy.patch	2024-06-25 00:22:13.297187932 +0100
@@ -1 +1 @@
-From dc1d92a4f547f8af6eb9b8824257ab3fd8dfbc77 Mon Sep 17 00:00:00 2001
+From aadaf7fe72821e2d27cbf4f95c25b909ededc49d Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit dc1d92a4f547f8af6eb9b8824257ab3fd8dfbc77 ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org
@@ -20 +21 @@
-index 99abb2f2fb..220d92b1a7 100644
+index f8431386e0..2bdca754bc 100644
@@ -23 +24 @@
-@@ -17963,7 +17963,7 @@ __flow_dv_create_policy_matcher(struct rte_eth_dev *dev,
+@@ -17173,7 +17173,7 @@ __flow_dv_create_policy_matcher(struct rte_eth_dev *dev,
@@ -32 +33 @@
-@@ -17978,6 +17978,7 @@ __flow_dv_create_domain_policy_rules(struct rte_eth_dev *dev,
+@@ -17188,6 +17188,7 @@ __flow_dv_create_domain_policy_rules(struct rte_eth_dev *dev,
@@ -40 +41 @@
-@@ -18012,12 +18013,12 @@ __flow_dv_create_domain_policy_rules(struct rte_eth_dev *dev,
+@@ -17222,12 +17223,12 @@ __flow_dv_create_domain_policy_rules(struct rte_eth_dev *dev,
@@ -57 +58 @@
-@@ -18027,7 +18028,7 @@ __flow_dv_create_domain_policy_rules(struct rte_eth_dev *dev,
+@@ -17237,7 +17238,7 @@ __flow_dv_create_domain_policy_rules(struct rte_eth_dev *dev,
@@ -66 +67 @@
-@@ -18075,7 +18076,7 @@ __flow_dv_create_policy_acts_rules(struct rte_eth_dev *dev,
+@@ -17285,7 +17286,7 @@ __flow_dv_create_policy_acts_rules(struct rte_eth_dev *dev,
@@ -75 +76 @@
-@@ -18146,7 +18147,7 @@ __flow_dv_create_policy_acts_rules(struct rte_eth_dev *dev,
+@@ -17356,7 +17357,7 @@ __flow_dv_create_policy_acts_rules(struct rte_eth_dev *dev,
@@ -84 +85 @@
-@@ -18198,7 +18199,7 @@ __flow_dv_create_policy_acts_rules(struct rte_eth_dev *dev,
+@@ -17408,7 +17409,7 @@ __flow_dv_create_policy_acts_rules(struct rte_eth_dev *dev,
@@ -93 +94 @@
-@@ -18212,9 +18213,9 @@ __flow_dv_create_policy_acts_rules(struct rte_eth_dev *dev,
+@@ -17422,9 +17423,9 @@ __flow_dv_create_policy_acts_rules(struct rte_eth_dev *dev,
@@ -106 +107 @@
-@@ -18276,6 +18277,7 @@ __flow_dv_create_domain_def_policy(struct rte_eth_dev *dev, uint32_t domain)
+@@ -17486,6 +17487,7 @@ __flow_dv_create_domain_def_policy(struct rte_eth_dev *dev, uint32_t domain)
@@ -114 +115 @@
-@@ -18351,7 +18353,7 @@ __flow_dv_create_domain_def_policy(struct rte_eth_dev *dev, uint32_t domain)
+@@ -17561,7 +17563,7 @@ __flow_dv_create_domain_def_policy(struct rte_eth_dev *dev, uint32_t domain)
@@ -123 +124 @@
-@@ -19934,11 +19936,13 @@ flow_dv_validate_mtr_policy_acts(struct rte_eth_dev *dev,
+@@ -19142,11 +19144,13 @@ flow_dv_validate_mtr_policy_acts(struct rte_eth_dev *dev,

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/mlx5: fix crash on counter pool destroy' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (74 preceding siblings ...)
  2024-06-24 23:59 ` patch 'net/mlx5: support jump in meter hierarchy' " luca.boccassi
@ 2024-06-24 23:59 ` luca.boccassi
  2024-06-24 23:59 ` patch 'test/crypto: fix enqueue/dequeue callback case' " luca.boccassi
                   ` (3 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:59 UTC (permalink / raw)
  To: Maayan Kashani; +Cc: Dariusz Sosnowski, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/e12b4a47badb24b5b69c60fad22653aee3ee8869

Thanks.

Luca Boccassi

---
From e12b4a47badb24b5b69c60fad22653aee3ee8869 Mon Sep 17 00:00:00 2001
From: Maayan Kashani <mkashani@nvidia.com>
Date: Sun, 9 Jun 2024 14:01:02 +0300
Subject: [PATCH] net/mlx5: fix crash on counter pool destroy

[ upstream commit 3331d59551cdecd2db3a2064a7d6e4bf9396b849 ]

If the counter pool was not added to list,
and an error state was reached,
on attempt to destroy the counter pool,
segmentation fault was received during list remove action.

Added a check to verify the list is not empty before trying to
remove the cpool from the list.

Invalid state, leading to segfault,
can also be reached in the following scenario:
1.	mlx5_hws_cnt_pool_init() does a zmalloc and initializes most
        of the fields of cpool, but does not initialize the next field.
2.	mlx5_hws_cnt_pool_dcs_alloc() attempts to bulk allocate flow counters.
	If this fails, we skip straight to 4.
	In HW, this can fail simply if FW doesn't support bulk flow
	counter allocation.
3.	Right before the goto error, we insert the cpool to the hws_cpool_list.
	This is where the next field is initialized.
4.	mlx5_hws_cnt_pool_destroy() assumes the cpool's next field
	is initialized and SEGVs if not.

So, added a guard against cases where the entry was uninitialized
(checking le_prev field is not NULL).

Fixes: 6ac2104ac125 ("net/mlx5: fix counter query during port close")

Signed-off-by: Maayan Kashani <mkashani@nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
---
 drivers/net/mlx5/mlx5_hws_cnt.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_hws_cnt.c b/drivers/net/mlx5/mlx5_hws_cnt.c
index d4ef44d1a3..8415aa411f 100644
--- a/drivers/net/mlx5/mlx5_hws_cnt.c
+++ b/drivers/net/mlx5/mlx5_hws_cnt.c
@@ -717,7 +717,9 @@ mlx5_hws_cnt_pool_destroy(struct mlx5_dev_ctx_shared *sh,
 	 * Maybe blocked for at most 200ms here.
 	 */
 	rte_spinlock_lock(&sh->cpool_lock);
-	LIST_REMOVE(cpool, next);
+	/* Try to remove cpool before it was added to list caused segfault. */
+	if (!LIST_EMPTY(&sh->hws_cpool_list) && cpool->next.le_prev)
+		LIST_REMOVE(cpool, next);
 	rte_spinlock_unlock(&sh->cpool_lock);
 	if (--sh->cnt_svc->refcnt == 0)
 		mlx5_hws_cnt_svc_deinit(sh);
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:17.493745565 +0100
+++ 0077-net-mlx5-fix-crash-on-counter-pool-destroy.patch	2024-06-25 00:22:13.297187932 +0100
@@ -1 +1 @@
-From 3331d59551cdecd2db3a2064a7d6e4bf9396b849 Mon Sep 17 00:00:00 2001
+From e12b4a47badb24b5b69c60fad22653aee3ee8869 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 3331d59551cdecd2db3a2064a7d6e4bf9396b849 ]
+
@@ -31 +32,0 @@
-Cc: stable@dpdk.org
@@ -40 +41 @@
-index 36d422bdfa..a46a4bd94e 100644
+index d4ef44d1a3..8415aa411f 100644
@@ -43 +44 @@
-@@ -718,7 +718,9 @@ mlx5_hws_cnt_pool_destroy(struct mlx5_dev_ctx_shared *sh,
+@@ -717,7 +717,9 @@ mlx5_hws_cnt_pool_destroy(struct mlx5_dev_ctx_shared *sh,
@@ -52,2 +53,2 @@
- 	if (cpool->cfg.host_cpool == NULL) {
- 		if (--sh->cnt_svc->refcnt == 0)
+ 	if (--sh->cnt_svc->refcnt == 0)
+ 		mlx5_hws_cnt_svc_deinit(sh);

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'test/crypto: fix enqueue/dequeue callback case' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (75 preceding siblings ...)
  2024-06-24 23:59 ` patch 'net/mlx5: fix crash on counter pool destroy' " luca.boccassi
@ 2024-06-24 23:59 ` luca.boccassi
  2024-06-24 23:59 ` patch 'telemetry: lower log level on socket error' " luca.boccassi
                   ` (2 subsequent siblings)
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:59 UTC (permalink / raw)
  To: Akhil Goyal; +Cc: Ganapati Kundapura, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

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

Thanks.

Luca Boccassi

---
From 5cbc25e40f540b3518433c420f947ce3842a8cfe Mon Sep 17 00:00:00 2001
From: Akhil Goyal <gakhil@marvell.com>
Date: Fri, 24 May 2024 22:43:27 +0530
Subject: [PATCH] test/crypto: fix enqueue/dequeue callback case

[ upstream commit 4ad17a1c8fb336a182f2c1b62127d8871d45f804 ]

The enqueue/dequeue callback test cases were using the
test_null_burst_operation() for doing enqueue/dequeue.
But this function is only designed to be run for NULL PMD.
Hence for other PMDs, the callback was not getting called.
Now, separate processing thread is removed, instead NULL crypto
operation is created and processed so that callbacks are called.
Also added a check on a global static variable to verify
that the callback is actually called and fail the case if
it is not getting called.

Fixes: 5523a75af539 ("test/crypto: add case for enqueue/dequeue callbacks")

Signed-off-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Ganapati Kundapura <ganapati.kundapura@intel.com>
---
 app/test/test_cryptodev.c | 106 ++++++++++++++++++++++++++++++++------
 1 file changed, 89 insertions(+), 17 deletions(-)

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index b75edb2f2b..96cd9ef7dc 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -194,6 +194,8 @@ post_process_raw_dp_op(void *user_data,	uint32_t index __rte_unused,
 static struct crypto_testsuite_params testsuite_params = { NULL };
 struct crypto_testsuite_params *p_testsuite_params = &testsuite_params;
 static struct crypto_unittest_params unittest_params;
+static bool enq_cb_called;
+static bool deq_cb_called;
 
 void
 process_sym_raw_dp_op(uint8_t dev_id, uint16_t qp_id,
@@ -12607,6 +12609,7 @@ test_enq_callback(uint16_t dev_id, uint16_t qp_id, struct rte_crypto_op **ops,
 	RTE_SET_USED(ops);
 	RTE_SET_USED(user_param);
 
+	enq_cb_called = true;
 	printf("crypto enqueue callback called\n");
 	return nb_ops;
 }
@@ -12620,21 +12623,58 @@ test_deq_callback(uint16_t dev_id, uint16_t qp_id, struct rte_crypto_op **ops,
 	RTE_SET_USED(ops);
 	RTE_SET_USED(user_param);
 
+	deq_cb_called = true;
 	printf("crypto dequeue callback called\n");
 	return nb_ops;
 }
 
 /*
- * Thread using enqueue/dequeue callback with RCU.
+ * Process enqueue/dequeue NULL crypto request to verify callback with RCU.
  */
 static int
-test_enqdeq_callback_thread(void *arg)
+test_enqdeq_callback_null_cipher(void)
 {
-	RTE_SET_USED(arg);
-	/* DP thread calls rte_cryptodev_enqueue_burst()/
-	 * rte_cryptodev_dequeue_burst() and invokes callback.
-	 */
-	test_null_burst_operation();
+	struct crypto_testsuite_params *ts_params = &testsuite_params;
+	struct crypto_unittest_params *ut_params = &unittest_params;
+
+	/* Setup Cipher Parameters */
+	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
+	ut_params->cipher_xform.next = &ut_params->auth_xform;
+
+	ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_NULL;
+	ut_params->cipher_xform.cipher.op = RTE_CRYPTO_CIPHER_OP_ENCRYPT;
+
+	/* Setup Auth Parameters */
+	ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
+	ut_params->auth_xform.next = NULL;
+
+	ut_params->auth_xform.auth.algo = RTE_CRYPTO_AUTH_NULL;
+	ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_GENERATE;
+
+	/* Create Crypto session */
+	ut_params->sess = rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
+				&ut_params->auth_xform, ts_params->session_mpool);
+	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
+
+	ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool, RTE_CRYPTO_OP_TYPE_SYMMETRIC);
+	TEST_ASSERT_NOT_NULL(ut_params->op, "Failed to allocate symmetric crypto op");
+
+	/* Allocate mbuf */
+	ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool);
+	TEST_ASSERT_NOT_NULL(ut_params->ibuf, "Failed to allocate mbuf");
+
+	/* Append some random data */
+	TEST_ASSERT_NOT_NULL(rte_pktmbuf_append(ut_params->ibuf, sizeof(unsigned int)),
+			"no room to append data");
+
+	rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess);
+
+	ut_params->op->sym->m_src = ut_params->ibuf;
+
+	/* Process crypto operation */
+	TEST_ASSERT_NOT_NULL(process_crypto_request(ts_params->valid_devs[0], ut_params->op),
+			"failed to process sym crypto op");
+
 	return 0;
 }
 
@@ -12642,6 +12682,7 @@ static int
 test_enq_callback_setup(void)
 {
 	struct crypto_testsuite_params *ts_params = &testsuite_params;
+	struct rte_cryptodev_sym_capability_idx cap_idx;
 	struct rte_cryptodev_info dev_info;
 	struct rte_cryptodev_qp_conf qp_conf = {
 		.nb_descriptors = MAX_NUM_OPS_INFLIGHT
@@ -12649,6 +12690,19 @@ test_enq_callback_setup(void)
 
 	struct rte_cryptodev_cb *cb;
 	uint16_t qp_id = 0;
+	int j = 0;
+
+	/* Verify the crypto capabilities for which enqueue/dequeue is done. */
+	cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
+	cap_idx.algo.auth = RTE_CRYPTO_AUTH_NULL;
+	if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+			&cap_idx) == NULL)
+		return TEST_SKIPPED;
+	cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
+	cap_idx.algo.cipher = RTE_CRYPTO_CIPHER_NULL;
+	if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+			&cap_idx) == NULL)
+		return TEST_SKIPPED;
 
 	/* Stop the device in case it's started so it can be configured */
 	rte_cryptodev_stop(ts_params->valid_devs[0]);
@@ -12672,6 +12726,7 @@ test_enq_callback_setup(void)
 			qp_conf.nb_descriptors, qp_id,
 			ts_params->valid_devs[0]);
 
+	enq_cb_called = false;
 	/* Test with invalid crypto device */
 	cb = rte_cryptodev_add_enq_callback(RTE_CRYPTO_MAX_DEVS,
 			qp_id, test_enq_callback, NULL);
@@ -12704,12 +12759,11 @@ test_enq_callback_setup(void)
 
 	rte_cryptodev_start(ts_params->valid_devs[0]);
 
-	/* Launch a thread */
-	rte_eal_remote_launch(test_enqdeq_callback_thread, NULL,
-				rte_get_next_lcore(-1, 1, 0));
+	TEST_ASSERT_SUCCESS(test_enqdeq_callback_null_cipher(), "Crypto Processing failed");
 
-	/* Wait until reader exited. */
-	rte_eal_mp_wait_lcore();
+	/* Wait until callback not called. */
+	while (!enq_cb_called && (j++ < 10))
+		rte_delay_ms(10);
 
 	/* Test with invalid crypto device */
 	TEST_ASSERT_FAIL(rte_cryptodev_remove_enq_callback(
@@ -12734,6 +12788,8 @@ test_enq_callback_setup(void)
 			"qp %u on cryptodev %u",
 			qp_id, ts_params->valid_devs[0]);
 
+	TEST_ASSERT(enq_cb_called == true, "Crypto enqueue callback not called");
+
 	return TEST_SUCCESS;
 }
 
@@ -12741,6 +12797,7 @@ static int
 test_deq_callback_setup(void)
 {
 	struct crypto_testsuite_params *ts_params = &testsuite_params;
+	struct rte_cryptodev_sym_capability_idx cap_idx;
 	struct rte_cryptodev_info dev_info;
 	struct rte_cryptodev_qp_conf qp_conf = {
 		.nb_descriptors = MAX_NUM_OPS_INFLIGHT
@@ -12748,6 +12805,19 @@ test_deq_callback_setup(void)
 
 	struct rte_cryptodev_cb *cb;
 	uint16_t qp_id = 0;
+	int j = 0;
+
+	/* Verify the crypto capabilities for which enqueue/dequeue is done. */
+	cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
+	cap_idx.algo.auth = RTE_CRYPTO_AUTH_NULL;
+	if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+			&cap_idx) == NULL)
+		return TEST_SKIPPED;
+	cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
+	cap_idx.algo.cipher = RTE_CRYPTO_CIPHER_NULL;
+	if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
+			&cap_idx) == NULL)
+		return TEST_SKIPPED;
 
 	/* Stop the device in case it's started so it can be configured */
 	rte_cryptodev_stop(ts_params->valid_devs[0]);
@@ -12771,6 +12841,7 @@ test_deq_callback_setup(void)
 			qp_conf.nb_descriptors, qp_id,
 			ts_params->valid_devs[0]);
 
+	deq_cb_called = false;
 	/* Test with invalid crypto device */
 	cb = rte_cryptodev_add_deq_callback(RTE_CRYPTO_MAX_DEVS,
 			qp_id, test_deq_callback, NULL);
@@ -12803,12 +12874,11 @@ test_deq_callback_setup(void)
 
 	rte_cryptodev_start(ts_params->valid_devs[0]);
 
-	/* Launch a thread */
-	rte_eal_remote_launch(test_enqdeq_callback_thread, NULL,
-				rte_get_next_lcore(-1, 1, 0));
+	TEST_ASSERT_SUCCESS(test_enqdeq_callback_null_cipher(), "Crypto processing failed");
 
-	/* Wait until reader exited. */
-	rte_eal_mp_wait_lcore();
+	/* Wait until callback not called. */
+	while (!deq_cb_called && (j++ < 10))
+		rte_delay_ms(10);
 
 	/* Test with invalid crypto device */
 	TEST_ASSERT_FAIL(rte_cryptodev_remove_deq_callback(
@@ -12833,6 +12903,8 @@ test_deq_callback_setup(void)
 			"qp %u on cryptodev %u",
 			qp_id, ts_params->valid_devs[0]);
 
+	TEST_ASSERT(deq_cb_called == true, "Crypto dequeue callback not called");
+
 	return TEST_SUCCESS;
 }
 
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:17.527652919 +0100
+++ 0078-test-crypto-fix-enqueue-dequeue-callback-case.patch	2024-06-25 00:22:13.309188176 +0100
@@ -1 +1 @@
-From 4ad17a1c8fb336a182f2c1b62127d8871d45f804 Mon Sep 17 00:00:00 2001
+From 5cbc25e40f540b3518433c420f947ce3842a8cfe Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 4ad17a1c8fb336a182f2c1b62127d8871d45f804 ]
+
@@ -17 +18,0 @@
-Cc: stable@dpdk.org
@@ -26 +27 @@
-index f2d249f6b8..94438c587a 100644
+index b75edb2f2b..96cd9ef7dc 100644
@@ -29 +30 @@
-@@ -199,6 +199,8 @@ post_process_raw_dp_op(void *user_data,	uint32_t index __rte_unused,
+@@ -194,6 +194,8 @@ post_process_raw_dp_op(void *user_data,	uint32_t index __rte_unused,
@@ -36 +37 @@
- int
+ void
@@ -38 +39 @@
-@@ -14671,6 +14673,7 @@ test_enq_callback(uint16_t dev_id, uint16_t qp_id, struct rte_crypto_op **ops,
+@@ -12607,6 +12609,7 @@ test_enq_callback(uint16_t dev_id, uint16_t qp_id, struct rte_crypto_op **ops,
@@ -46 +47 @@
-@@ -14684,21 +14687,58 @@ test_deq_callback(uint16_t dev_id, uint16_t qp_id, struct rte_crypto_op **ops,
+@@ -12620,21 +12623,58 @@ test_deq_callback(uint16_t dev_id, uint16_t qp_id, struct rte_crypto_op **ops,
@@ -112 +113 @@
-@@ -14706,6 +14746,7 @@ static int
+@@ -12642,6 +12682,7 @@ static int
@@ -120 +121 @@
-@@ -14713,6 +14754,19 @@ test_enq_callback_setup(void)
+@@ -12649,6 +12690,19 @@ test_enq_callback_setup(void)
@@ -140 +141 @@
-@@ -14736,6 +14790,7 @@ test_enq_callback_setup(void)
+@@ -12672,6 +12726,7 @@ test_enq_callback_setup(void)
@@ -148 +149 @@
-@@ -14768,12 +14823,11 @@ test_enq_callback_setup(void)
+@@ -12704,12 +12759,11 @@ test_enq_callback_setup(void)
@@ -165 +166 @@
-@@ -14798,6 +14852,8 @@ test_enq_callback_setup(void)
+@@ -12734,6 +12788,8 @@ test_enq_callback_setup(void)
@@ -174 +175 @@
-@@ -14805,6 +14861,7 @@ static int
+@@ -12741,6 +12797,7 @@ static int
@@ -182 +183 @@
-@@ -14812,6 +14869,19 @@ test_deq_callback_setup(void)
+@@ -12748,6 +12805,19 @@ test_deq_callback_setup(void)
@@ -202 +203 @@
-@@ -14835,6 +14905,7 @@ test_deq_callback_setup(void)
+@@ -12771,6 +12841,7 @@ test_deq_callback_setup(void)
@@ -210 +211 @@
-@@ -14867,12 +14938,11 @@ test_deq_callback_setup(void)
+@@ -12803,12 +12874,11 @@ test_deq_callback_setup(void)
@@ -227 +228 @@
-@@ -14897,6 +14967,8 @@ test_deq_callback_setup(void)
+@@ -12833,6 +12903,8 @@ test_deq_callback_setup(void)

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'telemetry: lower log level on socket error' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (76 preceding siblings ...)
  2024-06-24 23:59 ` patch 'test/crypto: fix enqueue/dequeue callback case' " luca.boccassi
@ 2024-06-24 23:59 ` luca.boccassi
  2024-06-24 23:59 ` patch 'bus/vdev: revert fix devargs in secondary process' " luca.boccassi
  2024-06-24 23:59 ` patch 'doc: fix link to hugepage mapping from Linux guide' " luca.boccassi
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:59 UTC (permalink / raw)
  To: David Marchand; +Cc: Christian Ehrhardt, Bruce Richardson, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/1620b6d7177b48d01411482465939166026af214

Thanks.

Luca Boccassi

---
From 1620b6d7177b48d01411482465939166026af214 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Thu, 6 Jun 2024 14:26:54 +0200
Subject: [PATCH] telemetry: lower log level on socket error

[ upstream commit 80b7993ba1b45d8aad7c294a7aaf66f4cdf860a5 ]

When starting two DPDK programs using the same DPDK prefix (like for
example OVS and testpmd, both running as primary processes in
--in-memory mode), the first DPDK process of the two spews some error
log when the second starts:

TELEMETRY: Socket write base info to client failed

This is because telemetry init involves trying to connect on existing
sockets to check if it can take over an existing socket file.

On the other hand, this error log provides no helpful information.
Lower this log to debug level.

Fixes: e14bb5f10509 ("telemetry: fix connected clients count")

Reported-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 lib/telemetry/telemetry.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/telemetry/telemetry.c b/lib/telemetry/telemetry.c
index af5da11866..491c4d21dd 100644
--- a/lib/telemetry/telemetry.c
+++ b/lib/telemetry/telemetry.c
@@ -383,7 +383,7 @@ client_handler(void *sock_id)
 			"{\"version\":\"%s\",\"pid\":%d,\"max_output_len\":%d}",
 			telemetry_version, getpid(), MAX_OUTPUT_LEN);
 	if (write(s, info_str, strlen(info_str)) < 0) {
-		TMTY_LOG(ERR, "Socket write base info to client failed");
+		TMTY_LOG(DEBUG, "Socket write base info to client failed");
 		goto exit;
 	}
 
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:17.574495288 +0100
+++ 0079-telemetry-lower-log-level-on-socket-error.patch	2024-06-25 00:22:13.309188176 +0100
@@ -1 +1 @@
-From 80b7993ba1b45d8aad7c294a7aaf66f4cdf860a5 Mon Sep 17 00:00:00 2001
+From 1620b6d7177b48d01411482465939166026af214 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 80b7993ba1b45d8aad7c294a7aaf66f4cdf860a5 ]
+
@@ -20 +21,0 @@
-Cc: stable@dpdk.org
@@ -30 +31 @@
-index 1663bd8c68..509fae76ec 100644
+index af5da11866..491c4d21dd 100644
@@ -33 +34 @@
-@@ -382,7 +382,7 @@ client_handler(void *sock_id)
+@@ -383,7 +383,7 @@ client_handler(void *sock_id)
@@ -37,2 +38,2 @@
--		TMTY_LOG_LINE(ERR, "Socket write base info to client failed");
-+		TMTY_LOG_LINE(DEBUG, "Socket write base info to client failed");
+-		TMTY_LOG(ERR, "Socket write base info to client failed");
++		TMTY_LOG(DEBUG, "Socket write base info to client failed");

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'bus/vdev: revert fix devargs in secondary process' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (77 preceding siblings ...)
  2024-06-24 23:59 ` patch 'telemetry: lower log level on socket error' " luca.boccassi
@ 2024-06-24 23:59 ` luca.boccassi
  2024-06-24 23:59 ` patch 'doc: fix link to hugepage mapping from Linux guide' " luca.boccassi
  79 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:59 UTC (permalink / raw)
  To: Mingjin Ye; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/6a3050209505a7b82cc8f20591a54fab5cd86bc2

Thanks.

Luca Boccassi

---
From 6a3050209505a7b82cc8f20591a54fab5cd86bc2 Mon Sep 17 00:00:00 2001
From: Mingjin Ye <mingjinx.ye@intel.com>
Date: Thu, 14 Mar 2024 09:36:28 +0000
Subject: [PATCH] bus/vdev: revert fix devargs in secondary process

[ upstream commit 22ce39b3aadb109cbefabb91aad44c94e8c2a5e6 ]

The ASan tool detected a memory leak in the vdev driver
alloc_devargs. The previous commit was that when inserting
a vdev device, the primary process alloc devargs and the
secondary process looks for devargs. This causes the
device to not be created if the secondary process does
not initialise the vdev device. And, this is not the
root cause.

Therefore the following commit was reverted accordingly.

After restoring this commit, the memory leak still exists.

Bugzilla ID: 1450
Fixes: 6666628362c9 ("bus/vdev: fix devargs in secondary process")

Signed-off-by: Mingjin Ye <mingjinx.ye@intel.com>
---
 drivers/bus/vdev/vdev.c | 21 +--------------------
 1 file changed, 1 insertion(+), 20 deletions(-)

diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c
index 14cf856237..38d05a9fe9 100644
--- a/drivers/bus/vdev/vdev.c
+++ b/drivers/bus/vdev/vdev.c
@@ -263,22 +263,6 @@ alloc_devargs(const char *name, const char *args)
 	return devargs;
 }
 
-static struct rte_devargs *
-vdev_devargs_lookup(const char *name)
-{
-	struct rte_devargs *devargs;
-	char dev_name[32];
-
-	RTE_EAL_DEVARGS_FOREACH("vdev", devargs) {
-		devargs->bus->parse(devargs->name, &dev_name);
-		if (strcmp(dev_name, name) == 0) {
-			VDEV_LOG(INFO, "devargs matched %s", dev_name);
-			return devargs;
-		}
-	}
-	return NULL;
-}
-
 static int
 insert_vdev(const char *name, const char *args,
 		struct rte_vdev_device **p_dev,
@@ -291,10 +275,7 @@ insert_vdev(const char *name, const char *args,
 	if (name == NULL)
 		return -EINVAL;
 
-	if (rte_eal_process_type() == RTE_PROC_PRIMARY)
-		devargs = alloc_devargs(name, args);
-	else
-		devargs = vdev_devargs_lookup(name);
+	devargs = alloc_devargs(name, args);
 
 	if (!devargs)
 		return -ENOMEM;
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:17.610348157 +0100
+++ 0080-bus-vdev-revert-fix-devargs-in-secondary-process.patch	2024-06-25 00:22:13.313188258 +0100
@@ -1 +1 @@
-From 22ce39b3aadb109cbefabb91aad44c94e8c2a5e6 Mon Sep 17 00:00:00 2001
+From 6a3050209505a7b82cc8f20591a54fab5cd86bc2 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 22ce39b3aadb109cbefabb91aad44c94e8c2a5e6 ]
+
@@ -20 +21,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'doc: fix link to hugepage mapping from Linux guide' has been queued to stable release 22.11.6
  2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' has been queued to stable release 22.11.6 luca.boccassi
                   ` (78 preceding siblings ...)
  2024-06-24 23:59 ` patch 'bus/vdev: revert fix devargs in secondary process' " luca.boccassi
@ 2024-06-24 23:59 ` luca.boccassi
  2024-07-15 15:25   ` patch 'config: fix warning for cross build with meson >= 1.3.0' " luca.boccassi
  79 siblings, 1 reply; 167+ messages in thread
From: luca.boccassi @ 2024-06-24 23:59 UTC (permalink / raw)
  To: David Marchand; +Cc: Alessio Igor Bogani, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/1a055be1a3756b5bc4cc814e939c81985cd59289

Thanks.

Luca Boccassi

---
From 1a055be1a3756b5bc4cc814e939c81985cd59289 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Mon, 17 Jun 2024 16:29:08 +0200
Subject: [PATCH] doc: fix link to hugepage mapping from Linux guide

[ upstream commit a886540e5ab5b6e342b628180a9d9a5379847087 ]

As reported by Alessio, the link to the hugepage mapping page is broken.

Fixes: 979bb5d493fb ("doc: add more instructions for running as non-root")

Reported-by: Alessio Igor Bogani <alessio.bogani@elettra.eu>
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 .mailmap                             | 1 +
 doc/guides/linux_gsg/enable_func.rst | 3 +--
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/.mailmap b/.mailmap
index 6a7e64e72d..5941400f42 100644
--- a/.mailmap
+++ b/.mailmap
@@ -41,6 +41,7 @@ Aleksandr Miloshenko <a.miloshenko@f5.com>
 Aleksey Baulin <aleksey.baulin@gmail.com>
 Aleksey Katargin <gureedo@gmail.com>
 Ales Musil <amusil@redhat.com>
+Alessio Igor Bogani <alessio.bogani@elettra.eu>
 Alexander Bechikov <asb.tyum@gmail.com>
 Alexander Belyakov <abelyako@gmail.com>
 Alexander Chernavin <achernavin@netgate.com>
diff --git a/doc/guides/linux_gsg/enable_func.rst b/doc/guides/linux_gsg/enable_func.rst
index 2344d97403..5511640cb8 100644
--- a/doc/guides/linux_gsg/enable_func.rst
+++ b/doc/guides/linux_gsg/enable_func.rst
@@ -85,8 +85,7 @@ need to be adjusted in order to ensure normal DPDK operation:
 The above limits can usually be adjusted by editing
 ``/etc/security/limits.conf`` file, and rebooting.
 
-See `Hugepage Mapping <hugepage_mapping>`_
-section to learn how these limits affect EAL.
+See :ref:`Hugepage Mapping <hugepage_mapping>` section to learn how these limits affect EAL.
 
 Device Control
 ~~~~~~~~~~~~~~
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:17.646165163 +0100
+++ 0081-doc-fix-link-to-hugepage-mapping-from-Linux-guide.patch	2024-06-25 00:22:13.313188258 +0100
@@ -1 +1 @@
-From a886540e5ab5b6e342b628180a9d9a5379847087 Mon Sep 17 00:00:00 2001
+From 1a055be1a3756b5bc4cc814e939c81985cd59289 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit a886540e5ab5b6e342b628180a9d9a5379847087 ]
+
@@ -9 +10,0 @@
-Cc: stable@dpdk.org
@@ -19 +20 @@
-index 3a10392e74..f76037213d 100644
+index 6a7e64e72d..5941400f42 100644
@@ -22 +23 @@
-@@ -44,6 +44,7 @@ Aleksandr Miloshenko <a.miloshenko@f5.com>
+@@ -41,6 +41,7 @@ Aleksandr Miloshenko <a.miloshenko@f5.com>

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'config: fix warning for cross build with meson >= 1.3.0' has been queued to stable release 22.11.6
  2024-06-24 23:59 ` patch 'doc: fix link to hugepage mapping from Linux guide' " luca.boccassi
@ 2024-07-15 15:25   ` luca.boccassi
  2024-07-15 15:25     ` patch 'build: use builtin helper for python dependencies' " luca.boccassi
                       ` (84 more replies)
  0 siblings, 85 replies; 167+ messages in thread
From: luca.boccassi @ 2024-07-15 15:25 UTC (permalink / raw)
  To: David Marchand; +Cc: Bruce Richardson, Ruifeng Wang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/09386932889cd7ed36c61ea2f615291f593dcadd

Thanks.

Luca Boccassi

---
From 09386932889cd7ed36c61ea2f615291f593dcadd Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Mon, 17 Jun 2024 17:05:18 +0200
Subject: [PATCH] config: fix warning for cross build with meson >= 1.3.0

[ upstream commit be4c001bd67864981103fa98c3375c601778852e ]

Starting meson 1.3.0, the pkgconfig variable is deprecated in favor of
pkg-config. Keep both variables as suggested in meson RN.

Link: https://mesonbuild.com/Release-notes-for-1-3-0.html#machine-files-pkgconfig-field-deprecated-and-replaced-by-pkgconfig

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Ruifeng Wang <ruifeng.wang@arm.com>
---
 config/arm/arm32_armv8_linux_gcc          | 1 +
 config/arm/arm64_armada_linux_gcc         | 1 +
 config/arm/arm64_armv8_linux_clang_ubuntu | 1 +
 config/arm/arm64_armv8_linux_gcc          | 1 +
 config/arm/arm64_bluefield_linux_gcc      | 1 +
 config/arm/arm64_centriq2400_linux_gcc    | 1 +
 config/arm/arm64_cn10k_linux_gcc          | 1 +
 config/arm/arm64_cn9k_linux_gcc           | 1 +
 config/arm/arm64_dpaa_linux_gcc           | 1 +
 config/arm/arm64_emag_linux_gcc           | 1 +
 config/arm/arm64_ft2000plus_linux_gcc     | 1 +
 config/arm/arm64_graviton2_linux_gcc      | 1 +
 config/arm/arm64_graviton3_linux_gcc      | 1 +
 config/arm/arm64_kunpeng920_linux_gcc     | 1 +
 config/arm/arm64_kunpeng930_linux_gcc     | 1 +
 config/arm/arm64_n1sdp_linux_gcc          | 1 +
 config/arm/arm64_n2_linux_gcc             | 1 +
 config/arm/arm64_stingray_linux_gcc       | 1 +
 config/arm/arm64_thunderx2_linux_gcc      | 1 +
 config/arm/arm64_thunderxt83_linux_gcc    | 1 +
 config/arm/arm64_thunderxt88_linux_gcc    | 1 +
 config/arm/arm64_tys2500_linux_gcc        | 1 +
 config/x86/cross-mingw                    | 1 +
 23 files changed, 23 insertions(+)

diff --git a/config/arm/arm32_armv8_linux_gcc b/config/arm/arm32_armv8_linux_gcc
index 269a60ba19..abcb182b16 100644
--- a/config/arm/arm32_armv8_linux_gcc
+++ b/config/arm/arm32_armv8_linux_gcc
@@ -4,6 +4,7 @@ cpp = ['ccache', 'arm-linux-gnueabihf-g++']
 ar = 'arm-linux-gnueabihf-gcc-ar'
 strip = 'arm-linux-gnueabihf-strip'
 pkgconfig = 'arm-linux-gnueabihf-pkg-config'
+pkg-config = 'arm-linux-gnueabihf-pkg-config'
 pcap-config = ''
 
 [host_machine]
diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index 635b4946a3..8f36d895da 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -5,6 +5,7 @@ ar = 'aarch64-linux-gnu-ar'
 as = 'aarch64-linux-gnu-as'
 strip = 'aarch64-linux-gnu-strip'
 pkgconfig = 'aarch64-linux-gnu-pkg-config'
+pkg-config = 'aarch64-linux-gnu-pkg-config'
 pcap-config = ''
 
 [host_machine]
diff --git a/config/arm/arm64_armv8_linux_clang_ubuntu b/config/arm/arm64_armv8_linux_clang_ubuntu
index 86ae43937b..e34fabebe5 100644
--- a/config/arm/arm64_armv8_linux_clang_ubuntu
+++ b/config/arm/arm64_armv8_linux_clang_ubuntu
@@ -6,6 +6,7 @@ strip = 'llvm-strip'
 llvm-config = 'llvm-config'
 pcap-config = 'llvm-config'
 pkgconfig = 'aarch64-linux-gnu-pkg-config'
+pkg-config = 'aarch64-linux-gnu-pkg-config'
 
 [host_machine]
 system = 'linux'
diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 529694b49d..a9b136cf48 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -4,6 +4,7 @@ cpp = ['ccache', 'aarch64-linux-gnu-g++']
 ar = 'aarch64-linux-gnu-gcc-ar'
 strip = 'aarch64-linux-gnu-strip'
 pkgconfig = 'aarch64-linux-gnu-pkg-config'
+pkg-config = 'aarch64-linux-gnu-pkg-config'
 pcap-config = ''
 
 [host_machine]
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index 1286227915..bcffb6534b 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -4,6 +4,7 @@ cpp = ['ccache', 'aarch64-linux-gnu-g++']
 ar = 'aarch64-linux-gnu-gcc-ar'
 strip = 'aarch64-linux-gnu-strip'
 pkgconfig = 'aarch64-linux-gnu-pkg-config'
+pkg-config = 'aarch64-linux-gnu-pkg-config'
 pcap-config = ''
 
 [host_machine]
diff --git a/config/arm/arm64_centriq2400_linux_gcc b/config/arm/arm64_centriq2400_linux_gcc
index bc8737e072..33cb5ef675 100644
--- a/config/arm/arm64_centriq2400_linux_gcc
+++ b/config/arm/arm64_centriq2400_linux_gcc
@@ -4,6 +4,7 @@ cpp = ['ccache', 'aarch64-linux-gnu-g++']
 ar = 'aarch64-linux-gnu-gcc-ar'
 strip = 'aarch64-linux-gnu-strip'
 pkgconfig = 'aarch64-linux-gnu-pkg-config'
+pkg-config = 'aarch64-linux-gnu-pkg-config'
 pcap-config = ''
 
 [host_machine]
diff --git a/config/arm/arm64_cn10k_linux_gcc b/config/arm/arm64_cn10k_linux_gcc
index 05d2d64cf2..586af83031 100644
--- a/config/arm/arm64_cn10k_linux_gcc
+++ b/config/arm/arm64_cn10k_linux_gcc
@@ -4,6 +4,7 @@ cpp = ['ccache', 'aarch64-linux-gnu-g++']
 ar = 'aarch64-linux-gnu-gcc-ar'
 strip = 'aarch64-linux-gnu-strip'
 pkgconfig = 'aarch64-linux-gnu-pkg-config'
+pkg-config = 'aarch64-linux-gnu-pkg-config'
 pcap-config = ''
 
 [host_machine]
diff --git a/config/arm/arm64_cn9k_linux_gcc b/config/arm/arm64_cn9k_linux_gcc
index 7416454de0..7e77ee06ae 100644
--- a/config/arm/arm64_cn9k_linux_gcc
+++ b/config/arm/arm64_cn9k_linux_gcc
@@ -4,6 +4,7 @@ cpp = ['ccache', 'aarch64-linux-gnu-g++']
 ar = 'aarch64-linux-gnu-gcc-ar'
 strip = 'aarch64-linux-gnu-strip'
 pkgconfig = 'aarch64-linux-gnu-pkg-config'
+pkg-config = 'aarch64-linux-gnu-pkg-config'
 pcap-config = ''
 
 [host_machine]
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index 8465b5097b..bf0eab18e2 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -5,6 +5,7 @@ ar = 'aarch64-linux-gnu-ar'
 as = 'aarch64-linux-gnu-as'
 strip = 'aarch64-linux-gnu-strip'
 pkgconfig = 'aarch64-linux-gnu-pkg-config'
+pkg-config = 'aarch64-linux-gnu-pkg-config'
 pcap-config = ''
 
 [host_machine]
diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index 248169ed68..3e8c15f8a4 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -4,6 +4,7 @@ cpp = ['ccache', 'aarch64-linux-gnu-g++']
 ar = 'aarch64-linux-gnu-gcc-ar'
 strip = 'aarch64-linux-gnu-strip'
 pkgconfig = 'aarch64-linux-gnu-pkg-config'
+pkg-config = 'aarch64-linux-gnu-pkg-config'
 pcap-config = ''
 
 [host_machine]
diff --git a/config/arm/arm64_ft2000plus_linux_gcc b/config/arm/arm64_ft2000plus_linux_gcc
index ae9f779056..4ecb251d3f 100644
--- a/config/arm/arm64_ft2000plus_linux_gcc
+++ b/config/arm/arm64_ft2000plus_linux_gcc
@@ -4,6 +4,7 @@ cpp = ['ccache', 'aarch64-linux-gnu-g++']
 ar = 'aarch64-linux-gnu-gcc-ar'
 strip = 'aarch64-linux-gnu-strip'
 pkgconfig = 'aarch64-linux-gnu-pkg-config'
+pkg-config = 'aarch64-linux-gnu-pkg-config'
 pcap-config = ''
 
 [host_machine]
diff --git a/config/arm/arm64_graviton2_linux_gcc b/config/arm/arm64_graviton2_linux_gcc
index fdb298bb11..b5f681bc27 100644
--- a/config/arm/arm64_graviton2_linux_gcc
+++ b/config/arm/arm64_graviton2_linux_gcc
@@ -4,6 +4,7 @@ cpp = ['ccache', 'aarch64-linux-gnu-g++']
 ar = 'aarch64-linux-gnu-gcc-ar'
 strip = 'aarch64-linux-gnu-strip'
 pkgconfig = 'aarch64-linux-gnu-pkg-config'
+pkg-config = 'aarch64-linux-gnu-pkg-config'
 pcap-config = ''
 
 [host_machine]
diff --git a/config/arm/arm64_graviton3_linux_gcc b/config/arm/arm64_graviton3_linux_gcc
index 19b422075d..77b5168836 100644
--- a/config/arm/arm64_graviton3_linux_gcc
+++ b/config/arm/arm64_graviton3_linux_gcc
@@ -4,6 +4,7 @@ cpp = ['ccache', 'aarch64-linux-gnu-g++']
 ar = 'aarch64-linux-gnu-gcc-ar'
 strip = 'aarch64-linux-gnu-strip'
 pkgconfig = 'aarch64-linux-gnu-pkg-config'
+pkg-config = 'aarch64-linux-gnu-pkg-config'
 pcap-config = ''
 
 [host_machine]
diff --git a/config/arm/arm64_kunpeng920_linux_gcc b/config/arm/arm64_kunpeng920_linux_gcc
index 193fb48a61..6e7d8ac667 100644
--- a/config/arm/arm64_kunpeng920_linux_gcc
+++ b/config/arm/arm64_kunpeng920_linux_gcc
@@ -4,6 +4,7 @@ cpp = ['ccache', 'aarch64-linux-gnu-g++']
 ar = 'aarch64-linux-gnu-gcc-ar'
 strip = 'aarch64-linux-gnu-strip'
 pkgconfig = 'aarch64-linux-gnu-pkg-config'
+pkg-config = 'aarch64-linux-gnu-pkg-config'
 pcap-config = ''
 
 [host_machine]
diff --git a/config/arm/arm64_kunpeng930_linux_gcc b/config/arm/arm64_kunpeng930_linux_gcc
index e4281ceb4f..61fe482a2e 100644
--- a/config/arm/arm64_kunpeng930_linux_gcc
+++ b/config/arm/arm64_kunpeng930_linux_gcc
@@ -4,6 +4,7 @@ cpp = ['ccache', 'aarch64-linux-gnu-g++']
 ar = 'aarch64-linux-gnu-gcc-ar'
 strip = 'aarch64-linux-gnu-strip'
 pkgconfig = 'aarch64-linux-gnu-pkg-config'
+pkg-config = 'aarch64-linux-gnu-pkg-config'
 pcap-config = ''
 
 [host_machine]
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index 2806a4241b..c3c12098d8 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -4,6 +4,7 @@ cpp = ['ccache', 'aarch64-linux-gnu-g++']
 ar = 'aarch64-linux-gnu-gcc-ar'
 strip = 'aarch64-linux-gnu-strip'
 pkgconfig = 'aarch64-linux-gnu-pkg-config'
+pkg-config = 'aarch64-linux-gnu-pkg-config'
 pcap-config = ''
 
 [host_machine]
diff --git a/config/arm/arm64_n2_linux_gcc b/config/arm/arm64_n2_linux_gcc
index 7404bd197b..89200861c4 100644
--- a/config/arm/arm64_n2_linux_gcc
+++ b/config/arm/arm64_n2_linux_gcc
@@ -4,6 +4,7 @@ cpp = ['ccache', 'aarch64-linux-gnu-g++']
 ar = 'aarch64-linux-gnu-gcc-ar'
 strip = 'aarch64-linux-gnu-strip'
 pkgconfig = 'aarch64-linux-gnu-pkg-config'
+pkg-config = 'aarch64-linux-gnu-pkg-config'
 pcap-config = ''
 
 [host_machine]
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index 08148b5c3d..358f3b43d3 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -4,6 +4,7 @@ cpp = ['ccache', 'aarch64-linux-gnu-g++']
 ar = 'aarch64-linux-gnu-gcc-ar'
 strip = 'aarch64-linux-gnu-strip'
 pkgconfig = 'aarch64-linux-gnu-pkg-config'
+pkg-config = 'aarch64-linux-gnu-pkg-config'
 pcap-config = ''
 
 [host_machine]
diff --git a/config/arm/arm64_thunderx2_linux_gcc b/config/arm/arm64_thunderx2_linux_gcc
index 32ae938e95..124a97da01 100644
--- a/config/arm/arm64_thunderx2_linux_gcc
+++ b/config/arm/arm64_thunderx2_linux_gcc
@@ -4,6 +4,7 @@ cpp = ['ccache', 'aarch64-linux-gnu-g++']
 ar = 'aarch64-linux-gnu-gcc-ar'
 strip = 'aarch64-linux-gnu-strip'
 pkgconfig = 'aarch64-linux-gnu-pkg-config'
+pkg-config = 'aarch64-linux-gnu-pkg-config'
 pcap-config = ''
 
 [host_machine]
diff --git a/config/arm/arm64_thunderxt83_linux_gcc b/config/arm/arm64_thunderxt83_linux_gcc
index e9d9e62d44..433c3cb4e3 100644
--- a/config/arm/arm64_thunderxt83_linux_gcc
+++ b/config/arm/arm64_thunderxt83_linux_gcc
@@ -4,6 +4,7 @@ cpp = ['ccache', 'aarch64-linux-gnu-g++']
 ar = 'aarch64-linux-gnu-gcc-ar'
 strip = 'aarch64-linux-gnu-strip'
 pkgconfig = 'aarch64-linux-gnu-pkg-config'
+pkg-config = 'aarch64-linux-gnu-pkg-config'
 pcap-config = ''
 
 [host_machine]
diff --git a/config/arm/arm64_thunderxt88_linux_gcc b/config/arm/arm64_thunderxt88_linux_gcc
index c6e5a5656a..81975aea14 100644
--- a/config/arm/arm64_thunderxt88_linux_gcc
+++ b/config/arm/arm64_thunderxt88_linux_gcc
@@ -4,6 +4,7 @@ cpp = ['ccache', 'aarch64-linux-gnu-g++']
 ar = 'aarch64-linux-gnu-gcc-ar'
 strip = 'aarch64-linux-gnu-strip'
 pkgconfig = 'aarch64-linux-gnu-pkg-config'
+pkg-config = 'aarch64-linux-gnu-pkg-config'
 pcap-config = ''
 
 [host_machine]
diff --git a/config/arm/arm64_tys2500_linux_gcc b/config/arm/arm64_tys2500_linux_gcc
index fce85fb0d8..24e6539a15 100644
--- a/config/arm/arm64_tys2500_linux_gcc
+++ b/config/arm/arm64_tys2500_linux_gcc
@@ -4,6 +4,7 @@ cpp = ['ccache', 'aarch64-linux-gnu-g++']
 ar = 'aarch64-linux-gnu-gcc-ar'
 strip = 'aarch64-linux-gnu-strip'
 pkgconfig = 'aarch64-linux-gnu-pkg-config'
+pkg-config = 'aarch64-linux-gnu-pkg-config'
 pcap-config = ''
 
 [host_machine]
diff --git a/config/x86/cross-mingw b/config/x86/cross-mingw
index cddebda5b5..11597eaa26 100644
--- a/config/x86/cross-mingw
+++ b/config/x86/cross-mingw
@@ -5,6 +5,7 @@ ld = 'x86_64-w64-mingw32-ld'
 ar = 'x86_64-w64-mingw32-ar'
 strip = 'x86_64-w64-mingw32-strip'
 pkgconfig = 'x86_64-w64-mingw32-pkg-config'
+pkg-config = 'x86_64-w64-mingw32-pkg-config'
 objdump = 'x86_64-w64-mingw32-objdump'
 
 [host_machine]
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-15 16:19:34.823083062 +0100
+++ 0001-config-fix-warning-for-cross-build-with-meson-1.3.0.patch	2024-07-15 16:19:34.428203474 +0100
@@ -1 +1 @@
-From be4c001bd67864981103fa98c3375c601778852e Mon Sep 17 00:00:00 2001
+From 09386932889cd7ed36c61ea2f615291f593dcadd Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit be4c001bd67864981103fa98c3375c601778852e ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -17,2 +17,0 @@
- config/arm/arm64_altra_linux_gcc          | 1 +
- config/arm/arm64_ampereone_linux_gcc      | 1 +
@@ -22 +20,0 @@
- config/arm/arm64_bluefield3_linux_gcc     | 1 +
@@ -24,2 +21,0 @@
- config/arm/arm64_capri_linux_gcc          | 1 +
- config/arm/arm64_cdx_linux_gcc            | 1 +
@@ -30 +25,0 @@
- config/arm/arm64_elba_linux_gcc           | 1 +
@@ -33 +27,0 @@
- config/arm/arm64_grace_linux_gcc          | 1 +
@@ -36,2 +29,0 @@
- config/arm/arm64_graviton4_linux_gcc      | 1 +
- config/arm/arm64_hip10_linux_gcc          | 1 +
@@ -42 +33,0 @@
- config/arm/arm64_odyssey_linux_gcc        | 1 +
@@ -48 +38,0 @@
- config/arm/arm64_v2_linux_gcc             | 1 +
@@ -50 +40 @@
- 34 files changed, 34 insertions(+)
+ 23 files changed, 23 insertions(+)
@@ -64,24 +53,0 @@
-diff --git a/config/arm/arm64_altra_linux_gcc b/config/arm/arm64_altra_linux_gcc
-index ce0667ebe2..769503d936 100644
---- a/config/arm/arm64_altra_linux_gcc
-+++ b/config/arm/arm64_altra_linux_gcc
-@@ -4,6 +4,7 @@ cpp = ['ccache', 'aarch64-linux-gnu-g++']
- ar = 'aarch64-linux-gnu-gcc-ar'
- strip = 'aarch64-linux-gnu-strip'
- pkgconfig = 'aarch64-linux-gnu-pkg-config'
-+pkg-config = 'aarch64-linux-gnu-pkg-config'
- pcap-config = ''
- 
- [host_machine]
-diff --git a/config/arm/arm64_ampereone_linux_gcc b/config/arm/arm64_ampereone_linux_gcc
-index 8964432a74..bb6acfc4cf 100644
---- a/config/arm/arm64_ampereone_linux_gcc
-+++ b/config/arm/arm64_ampereone_linux_gcc
-@@ -4,6 +4,7 @@ cpp = ['ccache', 'aarch64-linux-gnu-g++']
- ar = 'aarch64-linux-gnu-gcc-ar'
- strip = 'aarch64-linux-gnu-strip'
- pkgconfig = 'aarch64-linux-gnu-pkg-config'
-+pkg-config = 'aarch64-linux-gnu-pkg-config'
- pcap-config = ''
- 
- [host_machine]
@@ -124,12 +89,0 @@
-diff --git a/config/arm/arm64_bluefield3_linux_gcc b/config/arm/arm64_bluefield3_linux_gcc
-index 775cf5883d..d900e72a6d 100644
---- a/config/arm/arm64_bluefield3_linux_gcc
-+++ b/config/arm/arm64_bluefield3_linux_gcc
-@@ -4,6 +4,7 @@ cpp = ['ccache', 'aarch64-linux-gnu-g++']
- ar = 'aarch64-linux-gnu-gcc-ar'
- strip = 'aarch64-linux-gnu-strip'
- pkgconfig = 'aarch64-linux-gnu-pkg-config'
-+pkg-config = 'aarch64-linux-gnu-pkg-config'
- pcap-config = ''
- 
- [host_machine]
@@ -148,24 +101,0 @@
-diff --git a/config/arm/arm64_capri_linux_gcc b/config/arm/arm64_capri_linux_gcc
-index 1a6313e684..5099ec66a5 100644
---- a/config/arm/arm64_capri_linux_gcc
-+++ b/config/arm/arm64_capri_linux_gcc
-@@ -4,6 +4,7 @@ cpp = ['ccache', 'aarch64-linux-gnu-g++']
- ar = 'aarch64-linux-gnu-gcc-ar'
- strip = 'aarch64-linux-gnu-strip'
- pkgconfig = 'aarch64-linux-gnu-pkg-config'
-+pkg-config = 'aarch64-linux-gnu-pkg-config'
- pcap-config = ''
- 
- [host_machine]
-diff --git a/config/arm/arm64_cdx_linux_gcc b/config/arm/arm64_cdx_linux_gcc
-index 8e6d619dae..bf494b776e 100644
---- a/config/arm/arm64_cdx_linux_gcc
-+++ b/config/arm/arm64_cdx_linux_gcc
-@@ -5,6 +5,7 @@ ar = 'aarch64-linux-gnu-ar'
- as = 'aarch64-linux-gnu-as'
- strip = 'aarch64-linux-gnu-strip'
- pkgconfig = 'aarch64-linux-gnu-pkg-config'
-+pkg-config = 'aarch64-linux-gnu-pkg-config'
- pcap-config = ''
- 
- [host_machine]
@@ -185 +115 @@
-index fa904af5d0..63fcca9cbe 100644
+index 05d2d64cf2..586af83031 100644
@@ -194 +123,0 @@
- cmake = 'cmake'
@@ -195,0 +125 @@
+ [host_machine]
@@ -197 +127 @@
-index 646ce4b5d3..fa4618e370 100644
+index 7416454de0..7e77ee06ae 100644
@@ -206 +135,0 @@
- cmake = 'cmake'
@@ -207,0 +137 @@
+ [host_machine]
@@ -220,12 +149,0 @@
-diff --git a/config/arm/arm64_elba_linux_gcc b/config/arm/arm64_elba_linux_gcc
-index 4d891bd5a7..624a821adb 100644
---- a/config/arm/arm64_elba_linux_gcc
-+++ b/config/arm/arm64_elba_linux_gcc
-@@ -4,6 +4,7 @@ cpp = ['ccache', 'aarch64-linux-gnu-g++']
- ar = 'aarch64-linux-gnu-gcc-ar'
- strip = 'aarch64-linux-gnu-strip'
- pkgconfig = 'aarch64-linux-gnu-pkg-config'
-+pkg-config = 'aarch64-linux-gnu-pkg-config'
- pcap-config = ''
- 
- [host_machine]
@@ -256,12 +173,0 @@
-diff --git a/config/arm/arm64_grace_linux_gcc b/config/arm/arm64_grace_linux_gcc
-index bde55b17a8..81e56674f6 100644
---- a/config/arm/arm64_grace_linux_gcc
-+++ b/config/arm/arm64_grace_linux_gcc
-@@ -4,6 +4,7 @@ cpp = ['ccache', 'aarch64-linux-gnu-g++']
- ar = 'aarch64-linux-gnu-gcc-ar'
- strip = 'aarch64-linux-gnu-strip'
- pkgconfig = 'aarch64-linux-gnu-pkg-config'
-+pkg-config = 'aarch64-linux-gnu-pkg-config'
- pcap-config = ''
- 
- [host_machine]
@@ -292,24 +197,0 @@
-diff --git a/config/arm/arm64_graviton4_linux_gcc b/config/arm/arm64_graviton4_linux_gcc
-index 839224bca7..3b674f7800 100644
---- a/config/arm/arm64_graviton4_linux_gcc
-+++ b/config/arm/arm64_graviton4_linux_gcc
-@@ -4,6 +4,7 @@ cpp = ['ccache', 'aarch64-linux-gnu-g++']
- ar = 'aarch64-linux-gnu-gcc-ar'
- strip = 'aarch64-linux-gnu-strip'
- pkgconfig = 'aarch64-linux-gnu-pkg-config'
-+pkg-config = 'aarch64-linux-gnu-pkg-config'
- pcap-config = ''
- 
- [host_machine]
-diff --git a/config/arm/arm64_hip10_linux_gcc b/config/arm/arm64_hip10_linux_gcc
-index 2943e4abbf..85bcd05887 100644
---- a/config/arm/arm64_hip10_linux_gcc
-+++ b/config/arm/arm64_hip10_linux_gcc
-@@ -4,6 +4,7 @@ cpp = ['ccache', 'aarch64-linux-gnu-g++']
- ar = 'aarch64-linux-gnu-gcc-ar'
- strip = 'aarch64-linux-gnu-strip'
- pkgconfig = 'aarch64-linux-gnu-pkg-config'
-+pkg-config = 'aarch64-linux-gnu-pkg-config'
- pcap-config = ''
- 
- [host_machine]
@@ -364,12 +245,0 @@
-diff --git a/config/arm/arm64_odyssey_linux_gcc b/config/arm/arm64_odyssey_linux_gcc
-index 532c708bde..9cd49b5717 100644
---- a/config/arm/arm64_odyssey_linux_gcc
-+++ b/config/arm/arm64_odyssey_linux_gcc
-@@ -4,6 +4,7 @@ cpp = ['ccache', 'aarch64-marvell-linux-gnu-g++']
- ar = 'aarch64-marvell-linux-gnu-gcc-ar'
- strip = 'aarch64-marvell-linux-gnu-strip'
- pkgconfig = 'aarch64-linux-gnu-pkg-config'
-+pkg-config = 'aarch64-linux-gnu-pkg-config'
- 
- [host_machine]
- system = 'linux'
@@ -428,12 +297,0 @@
-@@ -4,6 +4,7 @@ cpp = ['ccache', 'aarch64-linux-gnu-g++']
- ar = 'aarch64-linux-gnu-gcc-ar'
- strip = 'aarch64-linux-gnu-strip'
- pkgconfig = 'aarch64-linux-gnu-pkg-config'
-+pkg-config = 'aarch64-linux-gnu-pkg-config'
- pcap-config = ''
- 
- [host_machine]
-diff --git a/config/arm/arm64_v2_linux_gcc b/config/arm/arm64_v2_linux_gcc
-index 50d9be3da3..f27eeead66 100644
---- a/config/arm/arm64_v2_linux_gcc
-+++ b/config/arm/arm64_v2_linux_gcc

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'build: use builtin helper for python dependencies' has been queued to stable release 22.11.6
  2024-07-15 15:25   ` patch 'config: fix warning for cross build with meson >= 1.3.0' " luca.boccassi
@ 2024-07-15 15:25     ` luca.boccassi
  2024-07-15 15:25     ` patch 'app/bbdev: fix interrupt tests' " luca.boccassi
                       ` (83 subsequent siblings)
  84 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-07-15 15:25 UTC (permalink / raw)
  To: Luca Boccassi; +Cc: Dmitry Kozlyuk, Bruce Richardson, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/fcfe871790d34c1a3b4eaa5d3d3eed732b79def0

Thanks.

Luca Boccassi

---
From fcfe871790d34c1a3b4eaa5d3d3eed732b79def0 Mon Sep 17 00:00:00 2001
From: Luca Boccassi <bluca@debian.org>
Date: Sun, 23 Jun 2024 13:30:23 +0100
Subject: [PATCH] build: use builtin helper for python dependencies

[ upstream commit 9ab7baa5c14b1ba928c09bda4734827d6d367d6b ]

We now require Meson 0.53 or later, so we can use this feature introduced
in 0.51.
This also fixes a build failure on SUSE Leap 15.6 where the manual check
fails to detect the pyelftools module.

Signed-off-by: Luca Boccassi <bluca@debian.org>
Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 buildtools/meson.build | 19 +++++--------------
 1 file changed, 5 insertions(+), 14 deletions(-)

diff --git a/buildtools/meson.build b/buildtools/meson.build
index e1c600e40f..c4f6fe9271 100644
--- a/buildtools/meson.build
+++ b/buildtools/meson.build
@@ -6,7 +6,11 @@ check_symbols = find_program('check-symbols.sh')
 ldflags_ibverbs_static = find_program('options-ibverbs-static.sh')
 objdump = find_program('objdump', 'llvm-objdump')
 
-python3 = import('python').find_installation(required: false)
+python3_required_modules = []
+if host_machine.system() != 'windows'
+    python3_required_modules = ['elftools']
+endif
+python3 = import('python').find_installation('python3', required: false, modules: python3_required_modules)
 if python3.found()
     py3 = [python3]
 else
@@ -39,16 +43,3 @@ else
     pmdinfogen += 'elf'
 endif
 
-# TODO: starting from Meson 0.51.0 use
-#     python3 = import('python').find_installation('python',
-#        modules : python3_required_modules)
-python3_required_modules = []
-if host_machine.system() != 'windows'
-    python3_required_modules = ['elftools']
-endif
-foreach module : python3_required_modules
-    script = 'import importlib.util; import sys; exit(importlib.util.find_spec("@0@") is None)'
-    if run_command(py3, '-c', script.format(module), check: false).returncode() != 0
-        error('missing python module: @0@'.format(module))
-    endif
-endforeach
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-15 16:19:34.877654052 +0100
+++ 0002-build-use-builtin-helper-for-python-dependencies.patch	2024-07-15 16:19:34.432203559 +0100
@@ -1 +1 @@
-From 9ab7baa5c14b1ba928c09bda4734827d6d367d6b Mon Sep 17 00:00:00 2001
+From fcfe871790d34c1a3b4eaa5d3d3eed732b79def0 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 9ab7baa5c14b1ba928c09bda4734827d6d367d6b ]
+
@@ -11,2 +12,0 @@
-Cc: stable@dpdk.org
-
@@ -21 +21 @@
-index 72447b60a0..3adf34e1a8 100644
+index e1c600e40f..c4f6fe9271 100644
@@ -24,2 +24 @@
-@@ -5,7 +5,11 @@ pkgconf = find_program('pkg-config', 'pkgconf', required: false)
- check_symbols = find_program('check-symbols.sh')
+@@ -6,7 +6,11 @@ check_symbols = find_program('check-symbols.sh')
@@ -26,0 +26 @@
+ objdump = find_program('objdump', 'llvm-objdump')
@@ -37 +37 @@
-@@ -45,16 +49,3 @@ else
+@@ -39,16 +43,3 @@ else

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'app/bbdev: fix interrupt tests' has been queued to stable release 22.11.6
  2024-07-15 15:25   ` patch 'config: fix warning for cross build with meson >= 1.3.0' " luca.boccassi
  2024-07-15 15:25     ` patch 'build: use builtin helper for python dependencies' " luca.boccassi
@ 2024-07-15 15:25     ` luca.boccassi
  2024-07-15 15:25     ` patch 'dmadev: fix structure alignment' " luca.boccassi
                       ` (82 subsequent siblings)
  84 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-07-15 15:25 UTC (permalink / raw)
  To: Hernan Vargas; +Cc: Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/cdb1114156bfa7a8893904ad0368a312591428f0

Thanks.

Luca Boccassi

---
From cdb1114156bfa7a8893904ad0368a312591428f0 Mon Sep 17 00:00:00 2001
From: Hernan Vargas <hernan.vargas@intel.com>
Date: Mon, 24 Jun 2024 08:02:31 -0700
Subject: [PATCH] app/bbdev: fix interrupt tests

[ upstream commit fdcee665c5066cd1300d08b85d159ccabf9f3657 ]

Fix possible error with regards to setting the burst size from the
enqueue thread.

Fixes: b2e2aec3239e ("app/bbdev: enhance interrupt test")

Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 app/test-bbdev/test_bbdev_perf.c | 90 ++++++++++++++++----------------
 1 file changed, 45 insertions(+), 45 deletions(-)

diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index f77ebc4b47..66d14ff502 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -3125,6 +3125,15 @@ throughput_intr_lcore_ldpc_dec(void *arg)
 			if (unlikely(num_to_process - enqueued < num_to_enq))
 				num_to_enq = num_to_process - enqueued;
 
+			/* Write to thread burst_sz current number of enqueued
+			 * descriptors. It ensures that proper number of
+			 * descriptors will be dequeued in callback
+			 * function - needed for last batch in case where
+			 * the number of operations is not a multiple of
+			 * burst size.
+			 */
+			__atomic_store_n(&tp->burst_sz, num_to_enq, __ATOMIC_RELAXED);
+
 			enq = 0;
 			do {
 				enq += rte_bbdev_enqueue_ldpc_dec_ops(
@@ -3134,15 +3143,6 @@ throughput_intr_lcore_ldpc_dec(void *arg)
 			} while (unlikely(num_to_enq != enq));
 			enqueued += enq;
 
-			/* Write to thread burst_sz current number of enqueued
-			 * descriptors. It ensures that proper number of
-			 * descriptors will be dequeued in callback
-			 * function - needed for last batch in case where
-			 * the number of operations is not a multiple of
-			 * burst size.
-			 */
-			__atomic_store_n(&tp->burst_sz, num_to_enq, __ATOMIC_RELAXED);
-
 			/* Wait until processing of previous batch is
 			 * completed
 			 */
@@ -3218,6 +3218,15 @@ throughput_intr_lcore_dec(void *arg)
 			if (unlikely(num_to_process - enqueued < num_to_enq))
 				num_to_enq = num_to_process - enqueued;
 
+			/* Write to thread burst_sz current number of enqueued
+			 * descriptors. It ensures that proper number of
+			 * descriptors will be dequeued in callback
+			 * function - needed for last batch in case where
+			 * the number of operations is not a multiple of
+			 * burst size.
+			 */
+			__atomic_store_n(&tp->burst_sz, num_to_enq, __ATOMIC_RELAXED);
+
 			enq = 0;
 			do {
 				enq += rte_bbdev_enqueue_dec_ops(tp->dev_id,
@@ -3226,15 +3235,6 @@ throughput_intr_lcore_dec(void *arg)
 			} while (unlikely(num_to_enq != enq));
 			enqueued += enq;
 
-			/* Write to thread burst_sz current number of enqueued
-			 * descriptors. It ensures that proper number of
-			 * descriptors will be dequeued in callback
-			 * function - needed for last batch in case where
-			 * the number of operations is not a multiple of
-			 * burst size.
-			 */
-			__atomic_store_n(&tp->burst_sz, num_to_enq, __ATOMIC_RELAXED);
-
 			/* Wait until processing of previous batch is
 			 * completed
 			 */
@@ -3304,6 +3304,15 @@ throughput_intr_lcore_enc(void *arg)
 			if (unlikely(num_to_process - enqueued < num_to_enq))
 				num_to_enq = num_to_process - enqueued;
 
+			/* Write to thread burst_sz current number of enqueued
+			 * descriptors. It ensures that proper number of
+			 * descriptors will be dequeued in callback
+			 * function - needed for last batch in case where
+			 * the number of operations is not a multiple of
+			 * burst size.
+			 */
+			__atomic_store_n(&tp->burst_sz, num_to_enq, __ATOMIC_RELAXED);
+
 			enq = 0;
 			do {
 				enq += rte_bbdev_enqueue_enc_ops(tp->dev_id,
@@ -3312,15 +3321,6 @@ throughput_intr_lcore_enc(void *arg)
 			} while (unlikely(enq != num_to_enq));
 			enqueued += enq;
 
-			/* Write to thread burst_sz current number of enqueued
-			 * descriptors. It ensures that proper number of
-			 * descriptors will be dequeued in callback
-			 * function - needed for last batch in case where
-			 * the number of operations is not a multiple of
-			 * burst size.
-			 */
-			__atomic_store_n(&tp->burst_sz, num_to_enq, __ATOMIC_RELAXED);
-
 			/* Wait until processing of previous batch is
 			 * completed
 			 */
@@ -3392,6 +3392,15 @@ throughput_intr_lcore_ldpc_enc(void *arg)
 			if (unlikely(num_to_process - enqueued < num_to_enq))
 				num_to_enq = num_to_process - enqueued;
 
+			/* Write to thread burst_sz current number of enqueued
+			 * descriptors. It ensures that proper number of
+			 * descriptors will be dequeued in callback
+			 * function - needed for last batch in case where
+			 * the number of operations is not a multiple of
+			 * burst size.
+			 */
+			__atomic_store_n(&tp->burst_sz, num_to_enq, __ATOMIC_RELAXED);
+
 			enq = 0;
 			do {
 				enq += rte_bbdev_enqueue_ldpc_enc_ops(
@@ -3401,15 +3410,6 @@ throughput_intr_lcore_ldpc_enc(void *arg)
 			} while (unlikely(enq != num_to_enq));
 			enqueued += enq;
 
-			/* Write to thread burst_sz current number of enqueued
-			 * descriptors. It ensures that proper number of
-			 * descriptors will be dequeued in callback
-			 * function - needed for last batch in case where
-			 * the number of operations is not a multiple of
-			 * burst size.
-			 */
-			__atomic_store_n(&tp->burst_sz, num_to_enq, __ATOMIC_RELAXED);
-
 			/* Wait until processing of previous batch is
 			 * completed
 			 */
@@ -3480,6 +3480,15 @@ throughput_intr_lcore_fft(void *arg)
 			if (unlikely(num_to_process - enqueued < num_to_enq))
 				num_to_enq = num_to_process - enqueued;
 
+			/* Write to thread burst_sz current number of enqueued
+			 * descriptors. It ensures that proper number of
+			 * descriptors will be dequeued in callback
+			 * function - needed for last batch in case where
+			 * the number of operations is not a multiple of
+			 * burst size.
+			 */
+			__atomic_store_n(&tp->burst_sz, num_to_enq, __ATOMIC_RELAXED);
+
 			enq = 0;
 			do {
 				enq += rte_bbdev_enqueue_fft_ops(tp->dev_id,
@@ -3488,15 +3497,6 @@ throughput_intr_lcore_fft(void *arg)
 			} while (unlikely(enq != num_to_enq));
 			enqueued += enq;
 
-			/* Write to thread burst_sz current number of enqueued
-			 * descriptors. It ensures that proper number of
-			 * descriptors will be dequeued in callback
-			 * function - needed for last batch in case where
-			 * the number of operations is not a multiple of
-			 * burst size.
-			 */
-			__atomic_store_n(&tp->burst_sz, num_to_enq, __ATOMIC_RELAXED);
-
 			/* Wait until processing of previous batch is
 			 * completed
 			 */
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-15 16:19:34.931310201 +0100
+++ 0003-app-bbdev-fix-interrupt-tests.patch	2024-07-15 16:19:34.440203731 +0100
@@ -1 +1 @@
-From fdcee665c5066cd1300d08b85d159ccabf9f3657 Mon Sep 17 00:00:00 2001
+From cdb1114156bfa7a8893904ad0368a312591428f0 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit fdcee665c5066cd1300d08b85d159ccabf9f3657 ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -15,2 +16,2 @@
- app/test-bbdev/test_bbdev_perf.c | 120 +++++++++++++++----------------
- 1 file changed, 60 insertions(+), 60 deletions(-)
+ app/test-bbdev/test_bbdev_perf.c | 90 ++++++++++++++++----------------
+ 1 file changed, 45 insertions(+), 45 deletions(-)
@@ -19 +20 @@
-index 9841464922..20cd8df19b 100644
+index f77ebc4b47..66d14ff502 100644
@@ -22 +23 @@
-@@ -3419,6 +3419,16 @@ throughput_intr_lcore_ldpc_dec(void *arg)
+@@ -3125,6 +3125,15 @@ throughput_intr_lcore_ldpc_dec(void *arg)
@@ -33,2 +34 @@
-+			rte_atomic_store_explicit(&tp->burst_sz, num_to_enq,
-+					rte_memory_order_relaxed);
++			__atomic_store_n(&tp->burst_sz, num_to_enq, __ATOMIC_RELAXED);
@@ -39 +39 @@
-@@ -3428,16 +3438,6 @@ throughput_intr_lcore_ldpc_dec(void *arg)
+@@ -3134,15 +3143,6 @@ throughput_intr_lcore_ldpc_dec(void *arg)
@@ -50,2 +50 @@
--			rte_atomic_store_explicit(&tp->burst_sz, num_to_enq,
--					rte_memory_order_relaxed);
+-			__atomic_store_n(&tp->burst_sz, num_to_enq, __ATOMIC_RELAXED);
@@ -56 +55 @@
-@@ -3514,6 +3514,16 @@ throughput_intr_lcore_dec(void *arg)
+@@ -3218,6 +3218,15 @@ throughput_intr_lcore_dec(void *arg)
@@ -67,2 +66 @@
-+			rte_atomic_store_explicit(&tp->burst_sz, num_to_enq,
-+					rte_memory_order_relaxed);
++			__atomic_store_n(&tp->burst_sz, num_to_enq, __ATOMIC_RELAXED);
@@ -73 +71 @@
-@@ -3522,16 +3532,6 @@ throughput_intr_lcore_dec(void *arg)
+@@ -3226,15 +3235,6 @@ throughput_intr_lcore_dec(void *arg)
@@ -84,2 +82 @@
--			rte_atomic_store_explicit(&tp->burst_sz, num_to_enq,
--					rte_memory_order_relaxed);
+-			__atomic_store_n(&tp->burst_sz, num_to_enq, __ATOMIC_RELAXED);
@@ -90 +87 @@
-@@ -3603,6 +3603,16 @@ throughput_intr_lcore_enc(void *arg)
+@@ -3304,6 +3304,15 @@ throughput_intr_lcore_enc(void *arg)
@@ -101,2 +98 @@
-+			rte_atomic_store_explicit(&tp->burst_sz, num_to_enq,
-+					rte_memory_order_relaxed);
++			__atomic_store_n(&tp->burst_sz, num_to_enq, __ATOMIC_RELAXED);
@@ -107 +103 @@
-@@ -3611,16 +3621,6 @@ throughput_intr_lcore_enc(void *arg)
+@@ -3312,15 +3321,6 @@ throughput_intr_lcore_enc(void *arg)
@@ -118,2 +114 @@
--			rte_atomic_store_explicit(&tp->burst_sz, num_to_enq,
--					rte_memory_order_relaxed);
+-			__atomic_store_n(&tp->burst_sz, num_to_enq, __ATOMIC_RELAXED);
@@ -124 +119 @@
-@@ -3694,6 +3694,16 @@ throughput_intr_lcore_ldpc_enc(void *arg)
+@@ -3392,6 +3392,15 @@ throughput_intr_lcore_ldpc_enc(void *arg)
@@ -135,2 +130 @@
-+			rte_atomic_store_explicit(&tp->burst_sz, num_to_enq,
-+					rte_memory_order_relaxed);
++			__atomic_store_n(&tp->burst_sz, num_to_enq, __ATOMIC_RELAXED);
@@ -141 +135 @@
-@@ -3703,16 +3713,6 @@ throughput_intr_lcore_ldpc_enc(void *arg)
+@@ -3401,15 +3410,6 @@ throughput_intr_lcore_ldpc_enc(void *arg)
@@ -152,2 +146 @@
--			rte_atomic_store_explicit(&tp->burst_sz, num_to_enq,
--					rte_memory_order_relaxed);
+-			__atomic_store_n(&tp->burst_sz, num_to_enq, __ATOMIC_RELAXED);
@@ -158 +151 @@
-@@ -3786,6 +3786,16 @@ throughput_intr_lcore_fft(void *arg)
+@@ -3480,6 +3480,15 @@ throughput_intr_lcore_fft(void *arg)
@@ -169,2 +162 @@
-+			rte_atomic_store_explicit(&tp->burst_sz, num_to_enq,
-+					rte_memory_order_relaxed);
++			__atomic_store_n(&tp->burst_sz, num_to_enq, __ATOMIC_RELAXED);
@@ -175,35 +167 @@
-@@ -3794,16 +3804,6 @@ throughput_intr_lcore_fft(void *arg)
- 			} while (unlikely(enq != num_to_enq));
- 			enqueued += enq;
- 
--			/* Write to thread burst_sz current number of enqueued
--			 * descriptors. It ensures that proper number of
--			 * descriptors will be dequeued in callback
--			 * function - needed for last batch in case where
--			 * the number of operations is not a multiple of
--			 * burst size.
--			 */
--			rte_atomic_store_explicit(&tp->burst_sz, num_to_enq,
--					rte_memory_order_relaxed);
--
- 			/* Wait until processing of previous batch is
- 			 * completed
- 			 */
-@@ -3872,6 +3872,16 @@ throughput_intr_lcore_mldts(void *arg)
- 			if (unlikely(num_to_process - enqueued < num_to_enq))
- 				num_to_enq = num_to_process - enqueued;
- 
-+			/* Write to thread burst_sz current number of enqueued
-+			 * descriptors. It ensures that proper number of
-+			 * descriptors will be dequeued in callback
-+			 * function - needed for last batch in case where
-+			 * the number of operations is not a multiple of
-+			 * burst size.
-+			 */
-+			rte_atomic_store_explicit(&tp->burst_sz, num_to_enq,
-+					rte_memory_order_relaxed);
-+
- 			enq = 0;
- 			do {
- 				enq += rte_bbdev_enqueue_mldts_ops(tp->dev_id,
-@@ -3879,16 +3889,6 @@ throughput_intr_lcore_mldts(void *arg)
+@@ -3488,15 +3497,6 @@ throughput_intr_lcore_fft(void *arg)
@@ -220,2 +178 @@
--			rte_atomic_store_explicit(&tp->burst_sz, num_to_enq,
--					rte_memory_order_relaxed);
+-			__atomic_store_n(&tp->burst_sz, num_to_enq, __ATOMIC_RELAXED);

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'dmadev: fix structure alignment' has been queued to stable release 22.11.6
  2024-07-15 15:25   ` patch 'config: fix warning for cross build with meson >= 1.3.0' " luca.boccassi
  2024-07-15 15:25     ` patch 'build: use builtin helper for python dependencies' " luca.boccassi
  2024-07-15 15:25     ` patch 'app/bbdev: fix interrupt tests' " luca.boccassi
@ 2024-07-15 15:25     ` luca.boccassi
  2024-07-15 15:25     ` patch 'vdpa/sfc: remove dead code' " luca.boccassi
                       ` (81 subsequent siblings)
  84 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-07-15 15:25 UTC (permalink / raw)
  To: Wenwu Ma; +Cc: Chengwen Feng, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/e35ccc8804b944595fa531f69b48c5f240dad59e

Thanks.

Luca Boccassi

---
From e35ccc8804b944595fa531f69b48c5f240dad59e Mon Sep 17 00:00:00 2001
From: Wenwu Ma <wenwux.ma@intel.com>
Date: Wed, 20 Mar 2024 15:23:32 +0800
Subject: [PATCH] dmadev: fix structure alignment

[ upstream commit c15902587b538ff02cfb0fbb4dd481f1503d936b ]

The structure rte_dma_dev needs to be aligned to the cache line, but
the return value of malloc may not be aligned to the cache line. When
we use memset to clear the rte_dma_dev object, it may cause a segmentation
fault in clang-x86-platform.

This is because clang uses the "vmovaps" assembly instruction for
memset, which requires that the operands (rte_dma_dev objects) must
aligned on a 16-byte boundary or a general-protection exception (#GP)
is generated.

Therefore, either additional memory is applied for re-alignment, or the
rte_dma_dev object does not require cache line alignment. The patch
chooses the former option to fix the issue.

Fixes: b36970f2e13e ("dmadev: introduce DMA device library")

Signed-off-by: Wenwu Ma <wenwux.ma@intel.com>
Reviewed-by: Chengwen Feng <fengchengwen@huawei.com>
---
 lib/dmadev/rte_dmadev.c | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/lib/dmadev/rte_dmadev.c b/lib/dmadev/rte_dmadev.c
index b48b915edc..d94f85ea9a 100644
--- a/lib/dmadev/rte_dmadev.c
+++ b/lib/dmadev/rte_dmadev.c
@@ -157,15 +157,24 @@ static int
 dma_dev_data_prepare(void)
 {
 	size_t size;
+	void *ptr;
 
 	if (rte_dma_devices != NULL)
 		return 0;
 
-	size = dma_devices_max * sizeof(struct rte_dma_dev);
-	rte_dma_devices = malloc(size);
-	if (rte_dma_devices == NULL)
+	/* The DMA device object is expected to align cacheline,
+	 * but the return value of malloc may not be aligned to the cache line.
+	 * Therefore, extra memory is applied for realignment.
+	 * Note: posix_memalign/aligned_alloc are not used
+	 * because not always available, depending on libc.
+	 */
+	size = dma_devices_max * sizeof(struct rte_dma_dev) + RTE_CACHE_LINE_SIZE;
+	ptr = malloc(size);
+	if (ptr == NULL)
 		return -ENOMEM;
-	memset(rte_dma_devices, 0, size);
+	memset(ptr, 0, size);
+
+	rte_dma_devices = RTE_PTR_ALIGN(ptr, RTE_CACHE_LINE_SIZE);
 
 	return 0;
 }
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-15 16:19:34.992740818 +0100
+++ 0004-dmadev-fix-structure-alignment.patch	2024-07-15 16:19:34.440203731 +0100
@@ -1 +1 @@
-From c15902587b538ff02cfb0fbb4dd481f1503d936b Mon Sep 17 00:00:00 2001
+From e35ccc8804b944595fa531f69b48c5f240dad59e Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit c15902587b538ff02cfb0fbb4dd481f1503d936b ]
+
@@ -21 +22,0 @@
-Cc: stable@dpdk.org
@@ -30 +31 @@
-index e64b279bac..845727210f 100644
+index b48b915edc..d94f85ea9a 100644
@@ -33 +34 @@
-@@ -159,15 +159,24 @@ static int
+@@ -157,15 +157,24 @@ static int

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'vdpa/sfc: remove dead code' has been queued to stable release 22.11.6
  2024-07-15 15:25   ` patch 'config: fix warning for cross build with meson >= 1.3.0' " luca.boccassi
                       ` (2 preceding siblings ...)
  2024-07-15 15:25     ` patch 'dmadev: fix structure alignment' " luca.boccassi
@ 2024-07-15 15:25     ` luca.boccassi
  2024-07-15 15:25     ` patch 'mbuf: fix dynamic fields copy' " luca.boccassi
                       ` (80 subsequent siblings)
  84 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-07-15 15:25 UTC (permalink / raw)
  To: David Marchand; +Cc: Andrew Rybchenko, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/2db5746bc8ff22b8c879e5516602cd82070f0681

Thanks.

Luca Boccassi

---
From 2db5746bc8ff22b8c879e5516602cd82070f0681 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Tue, 25 Jun 2024 14:24:09 +0200
Subject: [PATCH] vdpa/sfc: remove dead code

[ upstream commit 4ea22410ea9c0235db40313bb810582b25e845b3 ]

This is probably a copy/paste from the net/sfc driver.
sfc_logtype_driver is not a logtype variable from the sfc vDPA driver.
Remove it.

Fixes: 6dad9a7353d4 ("vdpa/sfc: support device initialization")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
 drivers/vdpa/sfc/sfc_vdpa_hw.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/vdpa/sfc/sfc_vdpa_hw.c b/drivers/vdpa/sfc/sfc_vdpa_hw.c
index edb7e35c2c..7e43719f53 100644
--- a/drivers/vdpa/sfc/sfc_vdpa_hw.c
+++ b/drivers/vdpa/sfc/sfc_vdpa_hw.c
@@ -13,8 +13,6 @@
 #include "sfc_vdpa.h"
 #include "sfc_vdpa_ops.h"
 
-extern uint32_t sfc_logtype_driver;
-
 #ifndef PAGE_SIZE
 #define PAGE_SIZE   (sysconf(_SC_PAGESIZE))
 #endif
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-15 16:19:35.044354925 +0100
+++ 0005-vdpa-sfc-remove-dead-code.patch	2024-07-15 16:19:34.440203731 +0100
@@ -1 +1 @@
-From 4ea22410ea9c0235db40313bb810582b25e845b3 Mon Sep 17 00:00:00 2001
+From 2db5746bc8ff22b8c879e5516602cd82070f0681 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 4ea22410ea9c0235db40313bb810582b25e845b3 ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'mbuf: fix dynamic fields copy' has been queued to stable release 22.11.6
  2024-07-15 15:25   ` patch 'config: fix warning for cross build with meson >= 1.3.0' " luca.boccassi
                       ` (3 preceding siblings ...)
  2024-07-15 15:25     ` patch 'vdpa/sfc: remove dead code' " luca.boccassi
@ 2024-07-15 15:25     ` luca.boccassi
  2024-07-15 15:25     ` patch 'bpf: fix MOV instruction evaluation' " luca.boccassi
                       ` (79 subsequent siblings)
  84 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-07-15 15:25 UTC (permalink / raw)
  To: Shijith Thotton; +Cc: Morten Brørup, Stephen Hemminger, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/f172fd7567fa2b1f7c4825ddc6cbc33403f1b74c

Thanks.

Luca Boccassi

---
From f172fd7567fa2b1f7c4825ddc6cbc33403f1b74c Mon Sep 17 00:00:00 2001
From: Shijith Thotton <sthotton@marvell.com>
Date: Thu, 27 Jun 2024 13:27:56 +0530
Subject: [PATCH] mbuf: fix dynamic fields copy
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit 95bea772528d316c969a170e6206f3b05ac39413 ]

Fixed rte_mbuf_dynfield_copy() API to copy dynamic fields from one mbuf
to another. When RTE_IOVA_AS_PA is not defined during the build, an
additional dynamic field (dynfield2) becomes available. This field
should be conditionally copied to ensure the complete duplication of
dynamic fields between mbufs. This patch fixes the same.

Bugzilla ID: 1472
Fixes: 03b57eb7ab9a ("mbuf: add second dynamic field member")

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
Reviewed-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/mbuf/rte_mbuf.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/mbuf/rte_mbuf.h b/lib/mbuf/rte_mbuf.h
index 3a82eb136d..a1b4c2b31d 100644
--- a/lib/mbuf/rte_mbuf.h
+++ b/lib/mbuf/rte_mbuf.h
@@ -1120,6 +1120,9 @@ rte_pktmbuf_attach_extbuf(struct rte_mbuf *m, void *buf_addr,
 static inline void
 rte_mbuf_dynfield_copy(struct rte_mbuf *mdst, const struct rte_mbuf *msrc)
 {
+#if !RTE_IOVA_AS_PA
+	mdst->dynfield2 = msrc->dynfield2;
+#endif
 	memcpy(&mdst->dynfield1, msrc->dynfield1, sizeof(mdst->dynfield1));
 }
 
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-15 16:19:35.093517065 +0100
+++ 0006-mbuf-fix-dynamic-fields-copy.patch	2024-07-15 16:19:34.444203816 +0100
@@ -1 +1 @@
-From 95bea772528d316c969a170e6206f3b05ac39413 Mon Sep 17 00:00:00 2001
+From f172fd7567fa2b1f7c4825ddc6cbc33403f1b74c Mon Sep 17 00:00:00 2001
@@ -8,0 +9,2 @@
+[ upstream commit 95bea772528d316c969a170e6206f3b05ac39413 ]
+
@@ -17 +18,0 @@
-Cc: stable@dpdk.org
@@ -27 +28 @@
-index 4c4722e002..babe16c72c 100644
+index 3a82eb136d..a1b4c2b31d 100644
@@ -30 +31 @@
-@@ -1119,6 +1119,9 @@ rte_pktmbuf_attach_extbuf(struct rte_mbuf *m, void *buf_addr,
+@@ -1120,6 +1120,9 @@ rte_pktmbuf_attach_extbuf(struct rte_mbuf *m, void *buf_addr,
@@ -34 +35 @@
-+#if !RTE_IOVA_IN_MBUF
++#if !RTE_IOVA_AS_PA

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'bpf: fix MOV instruction evaluation' has been queued to stable release 22.11.6
  2024-07-15 15:25   ` patch 'config: fix warning for cross build with meson >= 1.3.0' " luca.boccassi
                       ` (4 preceding siblings ...)
  2024-07-15 15:25     ` patch 'mbuf: fix dynamic fields copy' " luca.boccassi
@ 2024-07-15 15:25     ` luca.boccassi
  2024-07-15 15:25     ` patch 'bpf: fix load hangs with six IPv6 addresses' " luca.boccassi
                       ` (78 subsequent siblings)
  84 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-07-15 15:25 UTC (permalink / raw)
  To: Konstantin Ananyev; +Cc: Morten Brørup, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/d7a549306d92869a80230f51b51d1e7e36fccfad

Thanks.

Luca Boccassi

---
From d7a549306d92869a80230f51b51d1e7e36fccfad Mon Sep 17 00:00:00 2001
From: Konstantin Ananyev <konstantin.ananyev@huawei.com>
Date: Thu, 27 Jun 2024 19:04:40 +0100
Subject: [PATCH] bpf: fix MOV instruction evaluation
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit 3eef64655bfe3602f4e3235e2533932205f24569 ]

Verifier might left some register-state values uninitialized while
evaluating MOV instructions.
Add explicit initialization.

Fixes: 8021917293d0 ("bpf: add extra validation for input BPF program")

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@huawei.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
---
 lib/bpf/bpf_validate.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/lib/bpf/bpf_validate.c b/lib/bpf/bpf_validate.c
index 61cbb42216..1bf91fa05b 100644
--- a/lib/bpf/bpf_validate.c
+++ b/lib/bpf/bpf_validate.c
@@ -636,14 +636,14 @@ eval_alu(struct bpf_verifier *bvf, const struct ebpf_insn *ins)
 {
 	uint64_t msk;
 	uint32_t op;
-	size_t opsz;
+	size_t opsz, sz;
 	const char *err;
 	struct bpf_eval_state *st;
 	struct bpf_reg_val *rd, rs;
 
-	opsz = (BPF_CLASS(ins->code) == BPF_ALU) ?
+	sz = (BPF_CLASS(ins->code) == BPF_ALU) ?
 		sizeof(uint32_t) : sizeof(uint64_t);
-	opsz = opsz * CHAR_BIT;
+	opsz = sz * CHAR_BIT;
 	msk = RTE_LEN2MASK(opsz, uint64_t);
 
 	st = bvf->evst;
@@ -652,8 +652,10 @@ eval_alu(struct bpf_verifier *bvf, const struct ebpf_insn *ins)
 	if (BPF_SRC(ins->code) == BPF_X) {
 		rs = st->rv[ins->src_reg];
 		eval_apply_mask(&rs, msk);
-	} else
+	} else {
+		rs = (struct bpf_reg_val){.v = {.size = sz,},};
 		eval_fill_imm(&rs, msk, ins->imm);
+	}
 
 	eval_apply_mask(rd, msk);
 
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-15 16:19:35.145803899 +0100
+++ 0007-bpf-fix-MOV-instruction-evaluation.patch	2024-07-15 16:19:34.444203816 +0100
@@ -1 +1 @@
-From 3eef64655bfe3602f4e3235e2533932205f24569 Mon Sep 17 00:00:00 2001
+From d7a549306d92869a80230f51b51d1e7e36fccfad Mon Sep 17 00:00:00 2001
@@ -8,0 +9,2 @@
+[ upstream commit 3eef64655bfe3602f4e3235e2533932205f24569 ]
+
@@ -14 +15,0 @@
-Cc: stable@dpdk.org
@@ -23 +24 @@
-index 79be5e917d..11344fff4d 100644
+index 61cbb42216..1bf91fa05b 100644

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'bpf: fix load hangs with six IPv6 addresses' has been queued to stable release 22.11.6
  2024-07-15 15:25   ` patch 'config: fix warning for cross build with meson >= 1.3.0' " luca.boccassi
                       ` (5 preceding siblings ...)
  2024-07-15 15:25     ` patch 'bpf: fix MOV instruction evaluation' " luca.boccassi
@ 2024-07-15 15:25     ` luca.boccassi
  2024-07-15 15:25     ` patch 'telemetry: fix connection parameter parsing' " luca.boccassi
                       ` (77 subsequent siblings)
  84 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-07-15 15:25 UTC (permalink / raw)
  To: Konstantin Ananyev
  Cc: Isaac Boukris, Morten Brørup, Stephen Hemminger, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/e03493d52e9d59c40d1ccb31e27578be841d034e

Thanks.

Luca Boccassi

---
From e03493d52e9d59c40d1ccb31e27578be841d034e Mon Sep 17 00:00:00 2001
From: Konstantin Ananyev <konstantin.ananyev@huawei.com>
Date: Thu, 27 Jun 2024 19:04:41 +0100
Subject: [PATCH] bpf: fix load hangs with six IPv6 addresses
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit a258eebdfb22f95a8a44d31b0eab639aed0a0c4b ]

As described in https://bugs.dpdk.org/show_bug.cgi?id=1465, converting
from following cBPF filter:
"host 1::1 or host 1::1 or host 1::1 or host 1::1 or
 host 1::1 or host 1::1"
takes too long for BPF verifier to complete (up to 25 seconds).

Looking at it, I didn't find any actual functional bug.

In fact, it does what is expected: go through each possible path of
BPF program and evaluate register/stack state for each instruction.
The problem is that, for program with a lot of conditional branches,
number of possible paths starts to grow exponentially and such walk
becomes very excessive.

So to minimize number of evaluations, this patch implements heuristic
similar to what Linux kernel does: state pruning.
If from given instruction for given program state, we explore all possible
paths and for each of them reach bpf_exit() without any complaints and a
valid R0 value, then for that instruction this program state can be
marked as 'safe'.
When we later arrive at the same instruction with a state equivalent to
an earlier instruction 'safe' state, we can prune the search.

For now, only states for JCC targets are saved/examined.

Plus add few extra logging for DEBUG level.

Bugzilla ID: 1465
Fixes: 8021917293d0 ("bpf: add extra validation for input BPF program")

Reported-by: Isaac Boukris <iboukris@gmail.com>
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@huawei.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/bpf/bpf_validate.c | 305 ++++++++++++++++++++++++++++++++++-------
 1 file changed, 255 insertions(+), 50 deletions(-)

diff --git a/lib/bpf/bpf_validate.c b/lib/bpf/bpf_validate.c
index 1bf91fa05b..ae2dad46bb 100644
--- a/lib/bpf/bpf_validate.c
+++ b/lib/bpf/bpf_validate.c
@@ -29,10 +29,13 @@ struct bpf_reg_val {
 };
 
 struct bpf_eval_state {
+	SLIST_ENTRY(bpf_eval_state) next; /* for @safe list traversal */
 	struct bpf_reg_val rv[EBPF_REG_NUM];
 	struct bpf_reg_val sv[MAX_BPF_STACK_SIZE / sizeof(uint64_t)];
 };
 
+SLIST_HEAD(bpf_evst_head, bpf_eval_state);
+
 /* possible instruction node colour */
 enum {
 	WHITE,
@@ -52,6 +55,9 @@ enum {
 
 #define	MAX_EDGES	2
 
+/* max number of 'safe' evaluated states to track per node */
+#define NODE_EVST_MAX	32
+
 struct inst_node {
 	uint8_t colour;
 	uint8_t nb_edge:4;
@@ -59,7 +65,18 @@ struct inst_node {
 	uint8_t edge_type[MAX_EDGES];
 	uint32_t edge_dest[MAX_EDGES];
 	uint32_t prev_node;
-	struct bpf_eval_state *evst;
+	struct {
+		struct bpf_eval_state *cur;   /* save/restore for jcc targets */
+		struct bpf_eval_state *start;
+		struct bpf_evst_head safe;    /* safe states for track/prune */
+		uint32_t nb_safe;
+	} evst;
+};
+
+struct evst_pool {
+	uint32_t num;
+	uint32_t cur;
+	struct bpf_eval_state *ent;
 };
 
 struct bpf_verifier {
@@ -73,11 +90,8 @@ struct bpf_verifier {
 	uint32_t edge_type[MAX_EDGE_TYPE];
 	struct bpf_eval_state *evst;
 	struct inst_node *evin;
-	struct {
-		uint32_t num;
-		uint32_t cur;
-		struct bpf_eval_state *ent;
-	} evst_pool;
+	struct evst_pool evst_sr_pool; /* for evst save/restore */
+	struct evst_pool evst_tp_pool; /* for evst track/prune */
 };
 
 struct bpf_ins_check {
@@ -1085,7 +1099,7 @@ eval_jcc(struct bpf_verifier *bvf, const struct ebpf_insn *ins)
 	struct bpf_reg_val rvf, rvt;
 
 	tst = bvf->evst;
-	fst = bvf->evin->evst;
+	fst = bvf->evin->evst.cur;
 
 	frd = fst->rv + ins->dst_reg;
 	trd = tst->rv + ins->dst_reg;
@@ -1814,8 +1828,8 @@ add_edge(struct bpf_verifier *bvf, struct inst_node *node, uint32_t nidx)
 	uint32_t ne;
 
 	if (nidx > bvf->prm->nb_ins) {
-		RTE_BPF_LOG(ERR, "%s: program boundary violation at pc: %u, "
-			"next pc: %u\n",
+		RTE_BPF_LOG(ERR,
+			"%s: program boundary violation at pc: %u, next pc: %u\n",
 			__func__, get_node_idx(bvf, node), nidx);
 		return -EINVAL;
 	}
@@ -2091,60 +2105,114 @@ validate(struct bpf_verifier *bvf)
  * helper functions get/free eval states.
  */
 static struct bpf_eval_state *
-pull_eval_state(struct bpf_verifier *bvf)
+pull_eval_state(struct evst_pool *pool)
 {
 	uint32_t n;
 
-	n = bvf->evst_pool.cur;
-	if (n == bvf->evst_pool.num)
+	n = pool->cur;
+	if (n == pool->num)
 		return NULL;
 
-	bvf->evst_pool.cur = n + 1;
-	return bvf->evst_pool.ent + n;
+	pool->cur = n + 1;
+	return pool->ent + n;
 }
 
 static void
-push_eval_state(struct bpf_verifier *bvf)
+push_eval_state(struct evst_pool *pool)
 {
-	bvf->evst_pool.cur--;
+	RTE_ASSERT(pool->cur != 0);
+	pool->cur--;
 }
 
 static void
 evst_pool_fini(struct bpf_verifier *bvf)
 {
 	bvf->evst = NULL;
-	free(bvf->evst_pool.ent);
-	memset(&bvf->evst_pool, 0, sizeof(bvf->evst_pool));
+	free(bvf->evst_sr_pool.ent);
+	memset(&bvf->evst_sr_pool, 0, sizeof(bvf->evst_sr_pool));
+	memset(&bvf->evst_tp_pool, 0, sizeof(bvf->evst_tp_pool));
 }
 
 static int
 evst_pool_init(struct bpf_verifier *bvf)
 {
-	uint32_t n;
+	uint32_t k, n;
 
-	n = bvf->nb_jcc_nodes + 1;
+	/*
+	 * We need nb_jcc_nodes + 1 for save_cur/restore_cur
+	 * remaining ones will be used for state tracking/pruning.
+	 */
+	k = bvf->nb_jcc_nodes + 1;
+	n = k * 3;
 
-	bvf->evst_pool.ent = calloc(n, sizeof(bvf->evst_pool.ent[0]));
-	if (bvf->evst_pool.ent == NULL)
+	bvf->evst_sr_pool.ent = calloc(n, sizeof(bvf->evst_sr_pool.ent[0]));
+	if (bvf->evst_sr_pool.ent == NULL)
 		return -ENOMEM;
 
-	bvf->evst_pool.num = n;
-	bvf->evst_pool.cur = 0;
+	bvf->evst_sr_pool.num = k;
+	bvf->evst_sr_pool.cur = 0;
 
-	bvf->evst = pull_eval_state(bvf);
+	bvf->evst_tp_pool.ent = bvf->evst_sr_pool.ent + k;
+	bvf->evst_tp_pool.num = n - k;
+	bvf->evst_tp_pool.cur = 0;
+
+	bvf->evst = pull_eval_state(&bvf->evst_sr_pool);
 	return 0;
 }
 
+/*
+ * try to allocate and initialise new eval state for given node.
+ * later if no errors will be encountered, this state will be accepted as
+ * one of the possible 'safe' states for that node.
+ */
+static void
+save_start_eval_state(struct bpf_verifier *bvf, struct inst_node *node)
+{
+	RTE_ASSERT(node->evst.start == NULL);
+
+	/* limit number of states for one node with some reasonable value */
+	if (node->evst.nb_safe >= NODE_EVST_MAX)
+		return;
+
+	/* try to get new eval_state */
+	node->evst.start = pull_eval_state(&bvf->evst_tp_pool);
+
+	/* make a copy of current state */
+	if (node->evst.start != NULL) {
+		memcpy(node->evst.start, bvf->evst, sizeof(*node->evst.start));
+		SLIST_NEXT(node->evst.start, next) = NULL;
+	}
+}
+
+/*
+ * add @start state to the list of @safe states.
+ */
+static void
+save_safe_eval_state(struct bpf_verifier *bvf, struct inst_node *node)
+{
+	if (node->evst.start == NULL)
+		return;
+
+	SLIST_INSERT_HEAD(&node->evst.safe, node->evst.start, next);
+	node->evst.nb_safe++;
+
+	RTE_BPF_LOG(DEBUG, "%s(bvf=%p,node=%u,state=%p): nb_safe=%u;\n",
+		__func__, bvf, get_node_idx(bvf, node), node->evst.start,
+		node->evst.nb_safe);
+
+	node->evst.start = NULL;
+}
+
 /*
  * Save current eval state.
  */
 static int
-save_eval_state(struct bpf_verifier *bvf, struct inst_node *node)
+save_cur_eval_state(struct bpf_verifier *bvf, struct inst_node *node)
 {
 	struct bpf_eval_state *st;
 
 	/* get new eval_state for this node */
-	st = pull_eval_state(bvf);
+	st = pull_eval_state(&bvf->evst_sr_pool);
 	if (st == NULL) {
 		RTE_BPF_LOG(ERR,
 			"%s: internal error (out of space) at pc: %u\n",
@@ -2156,11 +2224,13 @@ save_eval_state(struct bpf_verifier *bvf, struct inst_node *node)
 	memcpy(st, bvf->evst, sizeof(*st));
 
 	/* swap current state with new one */
-	node->evst = bvf->evst;
+	RTE_ASSERT(node->evst.cur == NULL);
+	node->evst.cur = bvf->evst;
 	bvf->evst = st;
 
 	RTE_BPF_LOG(DEBUG, "%s(bvf=%p,node=%u) old/new states: %p/%p;\n",
-		__func__, bvf, get_node_idx(bvf, node), node->evst, bvf->evst);
+		__func__, bvf, get_node_idx(bvf, node), node->evst.cur,
+		bvf->evst);
 
 	return 0;
 }
@@ -2169,14 +2239,15 @@ save_eval_state(struct bpf_verifier *bvf, struct inst_node *node)
  * Restore previous eval state and mark current eval state as free.
  */
 static void
-restore_eval_state(struct bpf_verifier *bvf, struct inst_node *node)
+restore_cur_eval_state(struct bpf_verifier *bvf, struct inst_node *node)
 {
 	RTE_BPF_LOG(DEBUG, "%s(bvf=%p,node=%u) old/new states: %p/%p;\n",
-		__func__, bvf, get_node_idx(bvf, node), bvf->evst, node->evst);
+		__func__, bvf, get_node_idx(bvf, node), bvf->evst,
+		node->evst.cur);
 
-	bvf->evst = node->evst;
-	node->evst = NULL;
-	push_eval_state(bvf);
+	bvf->evst = node->evst.cur;
+	node->evst.cur = NULL;
+	push_eval_state(&bvf->evst_sr_pool);
 }
 
 static void
@@ -2193,26 +2264,124 @@ log_eval_state(const struct bpf_verifier *bvf, const struct ebpf_insn *ins,
 
 	rte_log(loglvl, rte_bpf_logtype,
 		"r%u={\n"
-		"\tv={type=%u, size=%zu},\n"
+		"\tv={type=%u, size=%zu, buf_size=%zu},\n"
 		"\tmask=0x%" PRIx64 ",\n"
 		"\tu={min=0x%" PRIx64 ", max=0x%" PRIx64 "},\n"
 		"\ts={min=%" PRId64 ", max=%" PRId64 "},\n"
 		"};\n",
 		ins->dst_reg,
-		rv->v.type, rv->v.size,
+		rv->v.type, rv->v.size, rv->v.buf_size,
 		rv->mask,
 		rv->u.min, rv->u.max,
 		rv->s.min, rv->s.max);
 }
 
 /*
- * Do second pass through CFG and try to evaluate instructions
- * via each possible path.
- * Right now evaluation functionality is quite limited.
- * Still need to add extra checks for:
- * - use/return uninitialized registers.
- * - use uninitialized data from the stack.
- * - memory boundaries violation.
+ * compare two evaluation states.
+ * returns zero if @lv is more conservative (safer) then @rv.
+ * returns non-zero value otherwise.
+ */
+static int
+cmp_reg_val_within(const struct bpf_reg_val *lv, const struct bpf_reg_val *rv)
+{
+	/* expect @v and @mask to be identical */
+	if (memcmp(&lv->v, &rv->v, sizeof(lv->v)) != 0 || lv->mask != rv->mask)
+		return -1;
+
+	/* exact match only for mbuf and stack pointers */
+	if (lv->v.type == RTE_BPF_ARG_PTR_MBUF ||
+			lv->v.type == BPF_ARG_PTR_STACK)
+		return -1;
+
+	if (lv->u.min <= rv->u.min && lv->u.max >= rv->u.max &&
+			lv->s.min <= rv->s.min && lv->s.max >= rv->s.max)
+		return 0;
+
+	return -1;
+}
+
+/*
+ * compare two evaluation states.
+ * returns zero if they are identical.
+ * returns positive value if @lv is more conservative (safer) then @rv.
+ * returns negative value otherwise.
+ */
+static int
+cmp_eval_state(const struct bpf_eval_state *lv, const struct bpf_eval_state *rv)
+{
+	int32_t rc;
+	uint32_t i, k;
+
+	/* for stack expect identical values */
+	rc = memcmp(lv->sv, rv->sv, sizeof(lv->sv));
+	if (rc != 0)
+		return -(2 * EBPF_REG_NUM);
+
+	k = 0;
+	/* check register values */
+	for (i = 0; i != RTE_DIM(lv->rv); i++) {
+		rc = memcmp(&lv->rv[i], &rv->rv[i], sizeof(lv->rv[i]));
+		if (rc != 0 && cmp_reg_val_within(&lv->rv[i], &rv->rv[i]) != 0)
+			return -(i + 1);
+		k += (rc != 0);
+	}
+
+	return k;
+}
+
+/*
+ * check did we already evaluated that path and can it be pruned that time.
+ */
+static int
+prune_eval_state(struct bpf_verifier *bvf, const struct inst_node *node,
+	struct inst_node *next)
+{
+	int32_t rc;
+	struct bpf_eval_state *safe;
+
+	rc = INT32_MIN;
+	SLIST_FOREACH(safe, &next->evst.safe, next) {
+		rc = cmp_eval_state(safe, bvf->evst);
+		if (rc >= 0)
+			break;
+	}
+
+	rc = (rc >= 0) ? 0 : -1;
+
+	/*
+	 * current state doesn't match any safe states,
+	 * so no prunning is possible right now,
+	 * track current state for future references.
+	 */
+	if (rc != 0)
+		save_start_eval_state(bvf, next);
+
+	RTE_BPF_LOG(DEBUG, "%s(bvf=%p,node=%u,next=%u) returns %d, "
+		"next->evst.start=%p, next->evst.nb_safe=%u\n",
+		__func__, bvf, get_node_idx(bvf, node),
+		get_node_idx(bvf, next), rc,
+		next->evst.start, next->evst.nb_safe);
+	return rc;
+}
+
+/* Do second pass through CFG and try to evaluate instructions
+ * via each possible path. The verifier will try all paths, tracking types of
+ * registers used as input to instructions, and updating resulting type via
+ * register state values. Plus for each register and possible stack value it
+ * tries to estimate possible max/min value.
+ * For conditional jumps, a stack is used to save evaluation state, so one
+ * path is explored while the state for the other path is pushed onto the stack.
+ * Then later, we backtrack to the first pushed instruction and repeat the cycle
+ * until the stack is empty and we're done.
+ * For program with many conditional branches walking through all possible path
+ * could be very excessive. So to minimize number of evaluations we use
+ * heuristic similar to what Linux kernel does - state pruning:
+ * If from given instruction for given program state we explore all possible
+ * paths and for each of them reach _exit() without any complaints and a valid
+ * R0 value, then for that instruction, that program state can be marked as
+ * 'safe'. When we later arrive at the same instruction with a state
+ * equivalent to an earlier instruction's 'safe' state, we can prune the search.
+ * For now, only states for JCC  targets are saved/examined.
  */
 static int
 evaluate(struct bpf_verifier *bvf)
@@ -2223,6 +2392,13 @@ evaluate(struct bpf_verifier *bvf)
 	const struct ebpf_insn *ins;
 	struct inst_node *next, *node;
 
+	struct {
+		uint32_t nb_eval;
+		uint32_t nb_prune;
+		uint32_t nb_save;
+		uint32_t nb_restore;
+	} stats;
+
 	/* initial state of frame pointer */
 	static const struct bpf_reg_val rvfp = {
 		.v = {
@@ -2246,6 +2422,8 @@ evaluate(struct bpf_verifier *bvf)
 	next = node;
 	rc = 0;
 
+	memset(&stats, 0, sizeof(stats));
+
 	while (node != NULL && rc == 0) {
 
 		/*
@@ -2259,11 +2437,14 @@ evaluate(struct bpf_verifier *bvf)
 			op = ins[idx].code;
 
 			/* for jcc node make a copy of evaluation state */
-			if (node->nb_edge > 1)
-				rc |= save_eval_state(bvf, node);
+			if (node->nb_edge > 1) {
+				rc |= save_cur_eval_state(bvf, node);
+				stats.nb_save++;
+			}
 
 			if (ins_chk[op].eval != NULL && rc == 0) {
 				err = ins_chk[op].eval(bvf, ins + idx);
+				stats.nb_eval++;
 				if (err != NULL) {
 					RTE_BPF_LOG(ERR, "%s: %s at pc: %u\n",
 						__func__, err, idx);
@@ -2277,21 +2458,37 @@ evaluate(struct bpf_verifier *bvf)
 
 		/* proceed through CFG */
 		next = get_next_node(bvf, node);
+
 		if (next != NULL) {
 
 			/* proceed with next child */
 			if (node->cur_edge == node->nb_edge &&
-					node->evst != NULL)
-				restore_eval_state(bvf, node);
+					node->evst.cur != NULL) {
+				restore_cur_eval_state(bvf, node);
+				stats.nb_restore++;
+			}
 
-			next->prev_node = get_node_idx(bvf, node);
-			node = next;
+			/*
+			 * for jcc targets: check did we already evaluated
+			 * that path and can it's evaluation be skipped that
+			 * time.
+			 */
+			if (node->nb_edge > 1 && prune_eval_state(bvf, node,
+					next) == 0) {
+				next = NULL;
+				stats.nb_prune++;
+			} else {
+				next->prev_node = get_node_idx(bvf, node);
+				node = next;
+			}
 		} else {
 			/*
 			 * finished with current node and all it's kids,
-			 * proceed with parent
+			 * mark it's @start state as safe for future references,
+			 * and proceed with parent.
 			 */
 			node->cur_edge = 0;
+			save_safe_eval_state(bvf, node);
 			node = get_prev_node(bvf, node);
 
 			/* finished */
@@ -2300,6 +2497,14 @@ evaluate(struct bpf_verifier *bvf)
 		}
 	}
 
+	RTE_BPF_LOG(DEBUG, "%s(%p) returns %d, stats:\n"
+		"node evaluations=%u;\n"
+		"state pruned=%u;\n"
+		"state saves=%u;\n"
+		"state restores=%u;\n",
+		__func__, bvf, rc,
+		stats.nb_eval, stats.nb_prune, stats.nb_save, stats.nb_restore);
+
 	return rc;
 }
 
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-15 16:19:35.197489954 +0100
+++ 0008-bpf-fix-load-hangs-with-six-IPv6-addresses.patch	2024-07-15 16:19:34.448203901 +0100
@@ -1 +1 @@
-From a258eebdfb22f95a8a44d31b0eab639aed0a0c4b Mon Sep 17 00:00:00 2001
+From e03493d52e9d59c40d1ccb31e27578be841d034e Mon Sep 17 00:00:00 2001
@@ -8,0 +9,2 @@
+[ upstream commit a258eebdfb22f95a8a44d31b0eab639aed0a0c4b ]
+
@@ -38 +39,0 @@
-Cc: stable@dpdk.org
@@ -49 +50 @@
-index 11344fff4d..4f47d6dc7b 100644
+index 1bf91fa05b..ae2dad46bb 100644
@@ -123,4 +124,4 @@
--		RTE_BPF_LOG_LINE(ERR, "%s: program boundary violation at pc: %u, "
--			"next pc: %u",
-+		RTE_BPF_LOG_LINE(ERR,
-+			"%s: program boundary violation at pc: %u, next pc: %u",
+-		RTE_BPF_LOG(ERR, "%s: program boundary violation at pc: %u, "
+-			"next pc: %u\n",
++		RTE_BPF_LOG(ERR,
++			"%s: program boundary violation at pc: %u, next pc: %u\n",
@@ -241 +242 @@
-+	RTE_BPF_LOG_LINE(DEBUG, "%s(bvf=%p,node=%u,state=%p): nb_safe=%u;",
++	RTE_BPF_LOG(DEBUG, "%s(bvf=%p,node=%u,state=%p): nb_safe=%u;\n",
@@ -261,2 +262,2 @@
- 		RTE_BPF_LOG_LINE(ERR,
- 			"%s: internal error (out of space) at pc: %u",
+ 		RTE_BPF_LOG(ERR,
+ 			"%s: internal error (out of space) at pc: %u\n",
@@ -272 +273 @@
- 	RTE_BPF_LOG_LINE(DEBUG, "%s(bvf=%p,node=%u) old/new states: %p/%p;",
+ 	RTE_BPF_LOG(DEBUG, "%s(bvf=%p,node=%u) old/new states: %p/%p;\n",
@@ -286 +287 @@
- 	RTE_BPF_LOG_LINE(DEBUG, "%s(bvf=%p,node=%u) old/new states: %p/%p;",
+ 	RTE_BPF_LOG(DEBUG, "%s(bvf=%p,node=%u) old/new states: %p/%p;\n",
@@ -300 +301 @@
-@@ -2193,26 +2264,124 @@ log_dbg_eval_state(const struct bpf_verifier *bvf, const struct ebpf_insn *ins,
+@@ -2193,26 +2264,124 @@ log_eval_state(const struct bpf_verifier *bvf, const struct ebpf_insn *ins,
@@ -302 +303 @@
- 	RTE_LOG(DEBUG, BPF,
+ 	rte_log(loglvl, rte_bpf_logtype,
@@ -405,2 +406,2 @@
-+	RTE_BPF_LOG_LINE(DEBUG, "%s(bvf=%p,node=%u,next=%u) returns %d, "
-+		"next->evst.start=%p, next->evst.nb_safe=%u",
++	RTE_BPF_LOG(DEBUG, "%s(bvf=%p,node=%u,next=%u) returns %d, "
++		"next->evst.start=%p, next->evst.nb_safe=%u\n",
@@ -472 +473 @@
- 					RTE_BPF_LOG_LINE(ERR, "%s: %s at pc: %u",
+ 					RTE_BPF_LOG(ERR, "%s: %s at pc: %u\n",
@@ -521 +522 @@
-+	RTE_LOG(DEBUG, BPF, "%s(%p) returns %d, stats:\n"
++	RTE_BPF_LOG(DEBUG, "%s(%p) returns %d, stats:\n"

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'telemetry: fix connection parameter parsing' has been queued to stable release 22.11.6
  2024-07-15 15:25   ` patch 'config: fix warning for cross build with meson >= 1.3.0' " luca.boccassi
                       ` (6 preceding siblings ...)
  2024-07-15 15:25     ` patch 'bpf: fix load hangs with six IPv6 addresses' " luca.boccassi
@ 2024-07-15 15:25     ` luca.boccassi
  2024-07-15 15:25     ` patch 'baseband/la12xx: forbid secondary process' " luca.boccassi
                       ` (76 subsequent siblings)
  84 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-07-15 15:25 UTC (permalink / raw)
  To: Zhichao Zeng; +Cc: Song Jiale, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/63cc1ddb1b3feea8a9c7b7a76a0e562f32fe99e2

Thanks.

Luca Boccassi

---
From 63cc1ddb1b3feea8a9c7b7a76a0e562f32fe99e2 Mon Sep 17 00:00:00 2001
From: Zhichao Zeng <zhichaox.zeng@intel.com>
Date: Fri, 21 Jun 2024 10:40:37 +0800
Subject: [PATCH] telemetry: fix connection parameter parsing

[ upstream commit efdf81829076198189ba6ccbb2e5c50270f56992 ]

For calling memcpy when the source and destination addresses are the same,
there is a small probability that there will be a copy error issue in some
environments, resulting in a failure to connect.

This patch uses memmove instead of memcpy to avoid this issue.

Fixes: b80fe1805eee ("telemetry: introduce backward compatibility")

Signed-off-by: Zhichao Zeng <zhichaox.zeng@intel.com>
Tested-by: Song Jiale <songx.jiale@intel.com>
---
 lib/telemetry/telemetry_legacy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/telemetry/telemetry_legacy.c b/lib/telemetry/telemetry_legacy.c
index 4c1d1c353a..578230732c 100644
--- a/lib/telemetry/telemetry_legacy.c
+++ b/lib/telemetry/telemetry_legacy.c
@@ -94,7 +94,7 @@ register_client(const char *cmd __rte_unused, const char *params,
 	}
 #ifndef RTE_EXEC_ENV_WINDOWS
 	strlcpy(data, strchr(params, ':'), sizeof(data));
-	memcpy(data, &data[strlen(":\"")], strlen(data));
+	memmove(data, &data[strlen(":\"")], strlen(data));
 	if (!strchr(data, '\"')) {
 		fprintf(stderr, "Invalid client data\n");
 		return -1;
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-15 16:19:35.250141450 +0100
+++ 0009-telemetry-fix-connection-parameter-parsing.patch	2024-07-15 16:19:34.448203901 +0100
@@ -1 +1 @@
-From efdf81829076198189ba6ccbb2e5c50270f56992 Mon Sep 17 00:00:00 2001
+From 63cc1ddb1b3feea8a9c7b7a76a0e562f32fe99e2 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit efdf81829076198189ba6ccbb2e5c50270f56992 ]
+
@@ -13 +14,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'baseband/la12xx: forbid secondary process' has been queued to stable release 22.11.6
  2024-07-15 15:25   ` patch 'config: fix warning for cross build with meson >= 1.3.0' " luca.boccassi
                       ` (7 preceding siblings ...)
  2024-07-15 15:25     ` patch 'telemetry: fix connection parameter parsing' " luca.boccassi
@ 2024-07-15 15:25     ` luca.boccassi
  2024-07-15 15:25     ` patch 'app/crypto-perf: remove redundant local variable' " luca.boccassi
                       ` (75 subsequent siblings)
  84 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-07-15 15:25 UTC (permalink / raw)
  To: Hemant Agrawal; +Cc: Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/cbe35e02f95454b3f698af10e41ee6d1fb95b903

Thanks.

Luca Boccassi

---
From cbe35e02f95454b3f698af10e41ee6d1fb95b903 Mon Sep 17 00:00:00 2001
From: Hemant Agrawal <hemant.agrawal@nxp.com>
Date: Tue, 2 Jul 2024 11:39:21 +0530
Subject: [PATCH] baseband/la12xx: forbid secondary process

[ upstream commit 95547dc69119154c85abfa7e8523e83a7ac05c9e ]

The la12xx driver do not have any checks for secondary process
and it causes the system to try to initialize the driver, causing
segmentation faults.
LA12xx driver do not support multi-processing.
Return when not called from Primary process.

Fixes: f218a1f92017 ("baseband/la12xx: introduce NXP LA12xx driver")

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 drivers/baseband/la12xx/bbdev_la12xx.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/baseband/la12xx/bbdev_la12xx.c b/drivers/baseband/la12xx/bbdev_la12xx.c
index bb754a5395..1a56e73abd 100644
--- a/drivers/baseband/la12xx/bbdev_la12xx.c
+++ b/drivers/baseband/la12xx/bbdev_la12xx.c
@@ -1084,6 +1084,9 @@ la12xx_bbdev_remove(struct rte_vdev_device *vdev)
 
 	PMD_INIT_FUNC_TRACE();
 
+	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+		return 0;
+
 	if (vdev == NULL)
 		return -EINVAL;
 
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-15 16:19:35.311188712 +0100
+++ 0010-baseband-la12xx-forbid-secondary-process.patch	2024-07-15 16:19:34.448203901 +0100
@@ -1 +1 @@
-From 95547dc69119154c85abfa7e8523e83a7ac05c9e Mon Sep 17 00:00:00 2001
+From cbe35e02f95454b3f698af10e41ee6d1fb95b903 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 95547dc69119154c85abfa7e8523e83a7ac05c9e ]
+
@@ -13 +14,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'app/crypto-perf: remove redundant local variable' has been queued to stable release 22.11.6
  2024-07-15 15:25   ` patch 'config: fix warning for cross build with meson >= 1.3.0' " luca.boccassi
                       ` (8 preceding siblings ...)
  2024-07-15 15:25     ` patch 'baseband/la12xx: forbid secondary process' " luca.boccassi
@ 2024-07-15 15:25     ` luca.boccassi
  2024-07-15 15:25     ` patch 'app/crypto-perf: fix result for asymmetric' " luca.boccassi
                       ` (74 subsequent siblings)
  84 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-07-15 15:25 UTC (permalink / raw)
  To: Gowrishankar Muthukrishnan; +Cc: Akhil Goyal, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/d581598df3592eedba82152da56b365b91713a71

Thanks.

Luca Boccassi

---
From d581598df3592eedba82152da56b365b91713a71 Mon Sep 17 00:00:00 2001
From: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Date: Wed, 26 Jun 2024 14:17:41 +0530
Subject: [PATCH] app/crypto-perf: remove redundant local variable

[ upstream commit 766cac609427cc8ef0f6680a73c4dcd3ac4e2a0d ]

Remove redundant local variable used for asym session.

Fixes: a29bb2489886 ("cryptodev: hide asymmetric session structure")
Fixes: 2973dbf93b44 ("security: hide session structure")

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
---
 app/test-crypto-perf/cperf_ops.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/app/test-crypto-perf/cperf_ops.c b/app/test-crypto-perf/cperf_ops.c
index 93b9bfb240..6bbab3289e 100644
--- a/app/test-crypto-perf/cperf_ops.c
+++ b/app/test-crypto-perf/cperf_ops.c
@@ -21,7 +21,6 @@ cperf_set_ops_asym(struct rte_crypto_op **ops,
 		   uint64_t *tsc_start __rte_unused)
 {
 	uint16_t i;
-	void *asym_sess = (void *)sess;
 
 	for (i = 0; i < nb_ops; i++) {
 		struct rte_crypto_asym_op *asym_op = ops[i]->asym;
@@ -31,7 +30,7 @@ cperf_set_ops_asym(struct rte_crypto_op **ops,
 		asym_op->modex.base.length = options->modex_data->base.len;
 		asym_op->modex.result.data = options->modex_data->result.data;
 		asym_op->modex.result.length = options->modex_data->result.len;
-		rte_crypto_op_attach_asym_session(ops[i], asym_sess);
+		rte_crypto_op_attach_asym_session(ops[i], sess);
 	}
 }
 
@@ -64,7 +63,6 @@ cperf_set_ops_security(struct rte_crypto_op **ops,
 
 	for (i = 0; i < nb_ops; i++) {
 		struct rte_crypto_sym_op *sym_op = ops[i]->sym;
-		void *sec_sess = (void *)sess;
 		uint32_t buf_sz;
 
 		uint32_t *per_pkt_hfn = rte_crypto_op_ctod_offset(ops[i],
@@ -72,7 +70,7 @@ cperf_set_ops_security(struct rte_crypto_op **ops,
 		*per_pkt_hfn = options->pdcp_ses_hfn_en ? 0 : PDCP_DEFAULT_HFN;
 
 		ops[i]->status = RTE_CRYPTO_OP_STATUS_NOT_PROCESSED;
-		rte_security_attach_session(ops[i], sec_sess);
+		rte_security_attach_session(ops[i], sess);
 		sym_op->m_src = (struct rte_mbuf *)((uint8_t *)ops[i] +
 							src_buf_offset);
 
@@ -129,7 +127,6 @@ cperf_set_ops_security_ipsec(struct rte_crypto_op **ops,
 		uint16_t iv_offset __rte_unused, uint32_t *imix_idx,
 		uint64_t *tsc_start)
 {
-	void *sec_sess = sess;
 	const uint32_t test_buffer_size = options->test_buffer_size;
 	const uint32_t headroom_sz = options->headroom_sz;
 	const uint32_t segment_sz = options->segment_sz;
@@ -143,7 +140,7 @@ cperf_set_ops_security_ipsec(struct rte_crypto_op **ops,
 		struct rte_mbuf *m = sym_op->m_src;
 
 		ops[i]->status = RTE_CRYPTO_OP_STATUS_NOT_PROCESSED;
-		rte_security_attach_session(ops[i], sec_sess);
+		rte_security_attach_session(ops[i], sess);
 		sym_op->m_src = (struct rte_mbuf *)((uint8_t *)ops[i] +
 							src_buf_offset);
 
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-15 16:19:35.362937866 +0100
+++ 0011-app-crypto-perf-remove-redundant-local-variable.patch	2024-07-15 16:19:34.448203901 +0100
@@ -1 +1 @@
-From 766cac609427cc8ef0f6680a73c4dcd3ac4e2a0d Mon Sep 17 00:00:00 2001
+From d581598df3592eedba82152da56b365b91713a71 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 766cac609427cc8ef0f6680a73c4dcd3ac4e2a0d ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -19 +20 @@
-index 4ca001b721..a802281a71 100644
+index 93b9bfb240..6bbab3289e 100644
@@ -39 +40 @@
-@@ -62,7 +61,6 @@ cperf_set_ops_security(struct rte_crypto_op **ops,
+@@ -64,7 +63,6 @@ cperf_set_ops_security(struct rte_crypto_op **ops,
@@ -47 +48 @@
-@@ -70,7 +68,7 @@ cperf_set_ops_security(struct rte_crypto_op **ops,
+@@ -72,7 +70,7 @@ cperf_set_ops_security(struct rte_crypto_op **ops,
@@ -56 +57 @@
-@@ -127,7 +125,6 @@ cperf_set_ops_security_ipsec(struct rte_crypto_op **ops,
+@@ -129,7 +127,6 @@ cperf_set_ops_security_ipsec(struct rte_crypto_op **ops,
@@ -62,4 +63,4 @@
- 	uint64_t tsc_start_temp, tsc_end_temp;
- 	uint16_t i = 0;
-@@ -140,7 +137,7 @@ cperf_set_ops_security_ipsec(struct rte_crypto_op **ops,
- 		uint32_t offset = test_buffer_size;
+ 	const uint32_t headroom_sz = options->headroom_sz;
+ 	const uint32_t segment_sz = options->segment_sz;
+@@ -143,7 +140,7 @@ cperf_set_ops_security_ipsec(struct rte_crypto_op **ops,
+ 		struct rte_mbuf *m = sym_op->m_src;
@@ -70,2 +71,2 @@
- 		sym_op->m_src = (struct rte_mbuf *)((uint8_t *)ops[i] + src_buf_offset);
- 		sym_op->m_src->pkt_len = test_buffer_size;
+ 		sym_op->m_src = (struct rte_mbuf *)((uint8_t *)ops[i] +
+ 							src_buf_offset);

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'app/crypto-perf: fix result for asymmetric' has been queued to stable release 22.11.6
  2024-07-15 15:25   ` patch 'config: fix warning for cross build with meson >= 1.3.0' " luca.boccassi
                       ` (9 preceding siblings ...)
  2024-07-15 15:25     ` patch 'app/crypto-perf: remove redundant local variable' " luca.boccassi
@ 2024-07-15 15:25     ` luca.boccassi
  2024-07-15 15:25     ` patch 'crypto/cnxk: fix minimal input normalization' " luca.boccassi
                       ` (73 subsequent siblings)
  84 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-07-15 15:25 UTC (permalink / raw)
  To: Gowrishankar Muthukrishnan; +Cc: Akhil Goyal, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/528f8f36a88277ecdaee24c26447de59def3841d

Thanks.

Luca Boccassi

---
From 528f8f36a88277ecdaee24c26447de59def3841d Mon Sep 17 00:00:00 2001
From: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Date: Wed, 26 Jun 2024 14:17:42 +0530
Subject: [PATCH] app/crypto-perf: fix result for asymmetric

[ upstream commit 022f9bf9d4571092be6bb98cea12efb1aa8fe0af ]

For asymmetric op, private test data should be stored after
rte_crypto_asym_op struct.

Fixes: a538d1d2d01e ("test/crypto-perf: extend asymmetric crypto throughput test")

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
---
 app/test-crypto-perf/cperf_test_common.c  |  6 ++++--
 app/test-crypto-perf/cperf_test_latency.c | 14 +++++++++++---
 2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/app/test-crypto-perf/cperf_test_common.c b/app/test-crypto-perf/cperf_test_common.c
index 94d39fb177..6b8ab65731 100644
--- a/app/test-crypto-perf/cperf_test_common.c
+++ b/app/test-crypto-perf/cperf_test_common.c
@@ -149,11 +149,11 @@ cperf_alloc_common_memory(const struct cperf_options *options,
 	int ret;
 
 	/* Calculate the object size */
-	uint16_t crypto_op_size = sizeof(struct rte_crypto_op) +
-		sizeof(struct rte_crypto_sym_op);
+	uint16_t crypto_op_size = sizeof(struct rte_crypto_op);
 	uint16_t crypto_op_private_size;
 
 	if (options->op_type == CPERF_ASYM_MODEX) {
+		crypto_op_size += sizeof(struct rte_crypto_asym_op);
 		snprintf(pool_name, RTE_MEMPOOL_NAMESIZE, "perf_asym_op_pool%u",
 			 rte_socket_id());
 		*pool = rte_crypto_op_pool_create(
@@ -170,6 +170,8 @@ cperf_alloc_common_memory(const struct cperf_options *options,
 		return 0;
 	}
 
+	crypto_op_size += sizeof(struct rte_crypto_sym_op);
+
 	/*
 	 * If doing AES-CCM, IV field needs to be 16 bytes long,
 	 * and AAD field needs to be long enough to have 18 bytes,
diff --git a/app/test-crypto-perf/cperf_test_latency.c b/app/test-crypto-perf/cperf_test_latency.c
index 406e082e4e..1c5fca0a55 100644
--- a/app/test-crypto-perf/cperf_test_latency.c
+++ b/app/test-crypto-perf/cperf_test_latency.c
@@ -122,7 +122,11 @@ store_timestamp(struct rte_crypto_op *op, uint64_t timestamp)
 {
 	struct priv_op_data *priv_data;
 
-	priv_data = (struct priv_op_data *) (op->sym + 1);
+	if (op->type == RTE_CRYPTO_OP_TYPE_SYMMETRIC)
+		priv_data = (struct priv_op_data *) (op->sym + 1);
+	else
+		priv_data = (struct priv_op_data *) (op->asym + 1);
+
 	priv_data->result->status = op->status;
 	priv_data->result->tsc_end = timestamp;
 }
@@ -250,9 +254,13 @@ cperf_latency_test_runner(void *arg)
 				ctx->res[tsc_idx].tsc_start = tsc_start;
 				/*
 				 * Private data structure starts after the end of the
-				 * rte_crypto_sym_op structure.
+				 * rte_crypto_sym_op (or rte_crypto_asym_op) structure.
 				 */
-				priv_data = (struct priv_op_data *) (ops[i]->sym + 1);
+				if (ops[i]->type == RTE_CRYPTO_OP_TYPE_SYMMETRIC)
+					priv_data = (struct priv_op_data *) (ops[i]->sym + 1);
+				else
+					priv_data = (struct priv_op_data *) (ops[i]->asym + 1);
+
 				priv_data->result = (void *)&ctx->res[tsc_idx];
 				tsc_idx++;
 			}
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-15 16:19:35.413000464 +0100
+++ 0012-app-crypto-perf-fix-result-for-asymmetric.patch	2024-07-15 16:19:34.452203987 +0100
@@ -1 +1 @@
-From 022f9bf9d4571092be6bb98cea12efb1aa8fe0af Mon Sep 17 00:00:00 2001
+From 528f8f36a88277ecdaee24c26447de59def3841d Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 022f9bf9d4571092be6bb98cea12efb1aa8fe0af ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -47 +48 @@
-index b8ad6bf4d4..376847e761 100644
+index 406e082e4e..1c5fca0a55 100644
@@ -63 +64 @@
-@@ -251,9 +255,13 @@ cperf_latency_test_runner(void *arg)
+@@ -250,9 +254,13 @@ cperf_latency_test_runner(void *arg)

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'crypto/cnxk: fix minimal input normalization' has been queued to stable release 22.11.6
  2024-07-15 15:25   ` patch 'config: fix warning for cross build with meson >= 1.3.0' " luca.boccassi
                       ` (10 preceding siblings ...)
  2024-07-15 15:25     ` patch 'app/crypto-perf: fix result for asymmetric' " luca.boccassi
@ 2024-07-15 15:25     ` luca.boccassi
  2024-07-15 15:25     ` patch 'cryptodev: fix build without crypto callbacks' " luca.boccassi
                       ` (72 subsequent siblings)
  84 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-07-15 15:25 UTC (permalink / raw)
  To: Gowrishankar Muthukrishnan; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/734137651508036d90198aa057d06b20186391f7

Thanks.

Luca Boccassi

---
From 734137651508036d90198aa057d06b20186391f7 Mon Sep 17 00:00:00 2001
From: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Date: Wed, 26 Jun 2024 15:48:18 +0530
Subject: [PATCH] crypto/cnxk: fix minimal input normalization

[ upstream commit 42ebfb0380cfc5e7c82555648b2ce064a9f4a3ad ]

Fix modex to nomalize input only when MSW is zero.

Fixes: 5a3513caeb45 ("crypto/cnxk: add asymmetric session")

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
---
 drivers/crypto/cnxk/cnxk_ae.h | 30 +++++++++++++++++++++---------
 1 file changed, 21 insertions(+), 9 deletions(-)

diff --git a/drivers/crypto/cnxk/cnxk_ae.h b/drivers/crypto/cnxk/cnxk_ae.h
index adf719da73..156bd2e94f 100644
--- a/drivers/crypto/cnxk/cnxk_ae.h
+++ b/drivers/crypto/cnxk/cnxk_ae.h
@@ -27,13 +27,22 @@ struct cnxk_ae_sess {
 };
 
 static __rte_always_inline void
-cnxk_ae_modex_param_normalize(uint8_t **data, size_t *len)
+cnxk_ae_modex_param_normalize(uint8_t **data, size_t *len, size_t max)
 {
+	uint8_t msw_len = *len % 8;
+	uint64_t msw_val = 0;
 	size_t i;
 
-	/* Strip leading NUL bytes */
-	for (i = 0; i < *len; i++) {
-		if ((*data)[i] != 0)
+	if (*len <= 8)
+		return;
+
+	memcpy(&msw_val, *data, msw_len);
+	if (msw_val != 0)
+		return;
+
+	for (i = msw_len; i < *len && (*len - i) < max; i += 8) {
+		memcpy(&msw_val, &(*data)[i], 8);
+		if (msw_val != 0)
 			break;
 	}
 	*data += i;
@@ -50,8 +59,8 @@ cnxk_ae_fill_modex_params(struct cnxk_ae_sess *sess,
 	uint8_t *exp = xform->modex.exponent.data;
 	uint8_t *mod = xform->modex.modulus.data;
 
-	cnxk_ae_modex_param_normalize(&mod, &mod_len);
-	cnxk_ae_modex_param_normalize(&exp, &exp_len);
+	cnxk_ae_modex_param_normalize(&mod, &mod_len, SIZE_MAX);
+	cnxk_ae_modex_param_normalize(&exp, &exp_len, mod_len);
 
 	if (unlikely(exp_len == 0 || mod_len == 0))
 		return -EINVAL;
@@ -240,7 +249,7 @@ cnxk_ae_modex_prep(struct rte_crypto_op *op, struct roc_ae_buf_ptr *meta_buf,
 	struct rte_crypto_mod_op_param mod_op;
 	uint64_t total_key_len;
 	union cpt_inst_w4 w4;
-	uint32_t base_len;
+	size_t base_len;
 	uint32_t dlen;
 	uint8_t *dptr;
 
@@ -248,8 +257,11 @@ cnxk_ae_modex_prep(struct rte_crypto_op *op, struct roc_ae_buf_ptr *meta_buf,
 
 	base_len = mod_op.base.length;
 	if (unlikely(base_len > mod_len)) {
-		op->status = RTE_CRYPTO_OP_STATUS_INVALID_ARGS;
-		return -ENOTSUP;
+		cnxk_ae_modex_param_normalize(&mod_op.base.data, &base_len, mod_len);
+		if (base_len > mod_len) {
+			op->status = RTE_CRYPTO_OP_STATUS_INVALID_ARGS;
+			return -ENOTSUP;
+		}
 	}
 
 	total_key_len = mod_len + exp_len;
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-15 16:19:35.462262863 +0100
+++ 0013-crypto-cnxk-fix-minimal-input-normalization.patch	2024-07-15 16:19:34.452203987 +0100
@@ -1 +1 @@
-From 42ebfb0380cfc5e7c82555648b2ce064a9f4a3ad Mon Sep 17 00:00:00 2001
+From 734137651508036d90198aa057d06b20186391f7 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 42ebfb0380cfc5e7c82555648b2ce064a9f4a3ad ]
+
@@ -9 +10,0 @@
-Cc: stable@dpdk.org
@@ -17 +18 @@
-index a843d6b5ef..ef9cb5eb91 100644
+index adf719da73..156bd2e94f 100644
@@ -20 +21 @@
-@@ -49,13 +49,22 @@ struct cnxk_ae_sess {
+@@ -27,13 +27,22 @@ struct cnxk_ae_sess {
@@ -47 +48 @@
-@@ -72,8 +81,8 @@ cnxk_ae_fill_modex_params(struct cnxk_ae_sess *sess,
+@@ -50,8 +59,8 @@ cnxk_ae_fill_modex_params(struct cnxk_ae_sess *sess,
@@ -58 +59 @@
-@@ -288,7 +297,7 @@ cnxk_ae_modex_prep(struct rte_crypto_op *op, struct roc_ae_buf_ptr *meta_buf,
+@@ -240,7 +249,7 @@ cnxk_ae_modex_prep(struct rte_crypto_op *op, struct roc_ae_buf_ptr *meta_buf,
@@ -67 +68 @@
-@@ -296,8 +305,11 @@ cnxk_ae_modex_prep(struct rte_crypto_op *op, struct roc_ae_buf_ptr *meta_buf,
+@@ -248,8 +257,11 @@ cnxk_ae_modex_prep(struct rte_crypto_op *op, struct roc_ae_buf_ptr *meta_buf,

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'cryptodev: fix build without crypto callbacks' has been queued to stable release 22.11.6
  2024-07-15 15:25   ` patch 'config: fix warning for cross build with meson >= 1.3.0' " luca.boccassi
                       ` (11 preceding siblings ...)
  2024-07-15 15:25     ` patch 'crypto/cnxk: fix minimal input normalization' " luca.boccassi
@ 2024-07-15 15:25     ` luca.boccassi
  2024-07-15 15:25     ` patch 'cryptodev: validate crypto callbacks from next node' " luca.boccassi
                       ` (71 subsequent siblings)
  84 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-07-15 15:25 UTC (permalink / raw)
  To: Ganapati Kundapura; +Cc: Akhil Goyal, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/ff0ffd5338b388ba7f4a362a16872a6ec2c1c2e7

Thanks.

Luca Boccassi

---
From ff0ffd5338b388ba7f4a362a16872a6ec2c1c2e7 Mon Sep 17 00:00:00 2001
From: Ganapati Kundapura <ganapati.kundapura@intel.com>
Date: Thu, 27 Jun 2024 05:06:25 -0500
Subject: [PATCH] cryptodev: fix build without crypto callbacks

[ upstream commit cfa443351ef581b7189467842ca102ab710cb7d2 ]

Crypto callbacks APIs are available in header files but when
the macro RTE_CRYPTO_CALLBACKS unset, test application need to
put #ifdef in its code.

The test application should be able to build and run, regardless
DPDK library is built with RTE_CRYPTO_CALLBACKS defined or not.

Added ENOTSUP from the beginning of the APIs implementation
if RTE_CRYPTO_CALLBACKS macro is unset/undefined.

Fixes: 1c3ffb95595e ("cryptodev: add enqueue and dequeue callbacks")
Fixes: 5523a75af539 ("test/crypto: add case for enqueue/dequeue callbacks")

Signed-off-by: Ganapati Kundapura <ganapati.kundapura@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
---
 app/test/test_cryptodev.c     | 12 ++++++++++++
 lib/cryptodev/rte_cryptodev.c | 14 ++++++++++++++
 2 files changed, 26 insertions(+)

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 96cd9ef7dc..68c82771a1 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -12730,6 +12730,12 @@ test_enq_callback_setup(void)
 	/* Test with invalid crypto device */
 	cb = rte_cryptodev_add_enq_callback(RTE_CRYPTO_MAX_DEVS,
 			qp_id, test_enq_callback, NULL);
+	if (rte_errno == ENOTSUP) {
+		RTE_LOG(ERR, USER1, "%s line %d: "
+			"rte_cryptodev_add_enq_callback() "
+			"Not supported, skipped\n", __func__, __LINE__);
+		return TEST_SKIPPED;
+	}
 	TEST_ASSERT_NULL(cb, "Add callback on qp %u on "
 			"cryptodev %u did not fail",
 			qp_id, RTE_CRYPTO_MAX_DEVS);
@@ -12845,6 +12851,12 @@ test_deq_callback_setup(void)
 	/* Test with invalid crypto device */
 	cb = rte_cryptodev_add_deq_callback(RTE_CRYPTO_MAX_DEVS,
 			qp_id, test_deq_callback, NULL);
+	if (rte_errno == ENOTSUP) {
+		RTE_LOG(ERR, USER1, "%s line %d: "
+			"rte_cryptodev_add_deq_callback() "
+			"Not supported, skipped\n", __func__, __LINE__);
+		return TEST_SKIPPED;
+	}
 	TEST_ASSERT_NULL(cb, "Add callback on qp %u on "
 			"cryptodev %u did not fail",
 			qp_id, RTE_CRYPTO_MAX_DEVS);
diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c
index d2b7e1c4cb..6c11881ab8 100644
--- a/lib/cryptodev/rte_cryptodev.c
+++ b/lib/cryptodev/rte_cryptodev.c
@@ -1407,6 +1407,10 @@ rte_cryptodev_add_enq_callback(uint8_t dev_id,
 			       rte_cryptodev_callback_fn cb_fn,
 			       void *cb_arg)
 {
+#ifndef RTE_CRYPTO_CALLBACKS
+	rte_errno = ENOTSUP;
+	return NULL;
+#endif
 	struct rte_cryptodev *dev;
 	struct rte_cryptodev_cb_rcu *list;
 	struct rte_cryptodev_cb *cb, *tail;
@@ -1472,6 +1476,9 @@ rte_cryptodev_remove_enq_callback(uint8_t dev_id,
 				  uint16_t qp_id,
 				  struct rte_cryptodev_cb *cb)
 {
+#ifndef RTE_CRYPTO_CALLBACKS
+	return -ENOTSUP;
+#endif
 	struct rte_cryptodev *dev;
 	struct rte_cryptodev_cb **prev_cb, *curr_cb;
 	struct rte_cryptodev_cb_rcu *list;
@@ -1545,6 +1552,10 @@ rte_cryptodev_add_deq_callback(uint8_t dev_id,
 			       rte_cryptodev_callback_fn cb_fn,
 			       void *cb_arg)
 {
+#ifndef RTE_CRYPTO_CALLBACKS
+	rte_errno = ENOTSUP;
+	return NULL;
+#endif
 	struct rte_cryptodev *dev;
 	struct rte_cryptodev_cb_rcu *list;
 	struct rte_cryptodev_cb *cb, *tail;
@@ -1611,6 +1622,9 @@ rte_cryptodev_remove_deq_callback(uint8_t dev_id,
 				  uint16_t qp_id,
 				  struct rte_cryptodev_cb *cb)
 {
+#ifndef RTE_CRYPTO_CALLBACKS
+	return -ENOTSUP;
+#endif
 	struct rte_cryptodev *dev;
 	struct rte_cryptodev_cb **prev_cb, *curr_cb;
 	struct rte_cryptodev_cb_rcu *list;
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-15 16:19:35.512563961 +0100
+++ 0014-cryptodev-fix-build-without-crypto-callbacks.patch	2024-07-15 16:19:34.472204413 +0100
@@ -1 +1 @@
-From cfa443351ef581b7189467842ca102ab710cb7d2 Mon Sep 17 00:00:00 2001
+From ff0ffd5338b388ba7f4a362a16872a6ec2c1c2e7 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit cfa443351ef581b7189467842ca102ab710cb7d2 ]
+
@@ -18 +19,0 @@
-Cc: stable@dpdk.org
@@ -28 +29 @@
-index 75f98b6744..6042db36a4 100644
+index 96cd9ef7dc..68c82771a1 100644
@@ -31 +32 @@
-@@ -14920,6 +14920,12 @@ test_enq_callback_setup(void)
+@@ -12730,6 +12730,12 @@ test_enq_callback_setup(void)
@@ -44 +45 @@
-@@ -15035,6 +15041,12 @@ test_deq_callback_setup(void)
+@@ -12845,6 +12851,12 @@ test_deq_callback_setup(void)
@@ -58 +59 @@
-index 886eb7adc4..682c9f49d0 100644
+index d2b7e1c4cb..6c11881ab8 100644
@@ -61 +62 @@
-@@ -1491,6 +1491,10 @@ rte_cryptodev_add_enq_callback(uint8_t dev_id,
+@@ -1407,6 +1407,10 @@ rte_cryptodev_add_enq_callback(uint8_t dev_id,
@@ -72 +73 @@
-@@ -1556,6 +1560,9 @@ rte_cryptodev_remove_enq_callback(uint8_t dev_id,
+@@ -1472,6 +1476,9 @@ rte_cryptodev_remove_enq_callback(uint8_t dev_id,
@@ -80,3 +81,3 @@
- 	RTE_ATOMIC(struct rte_cryptodev_cb *) *prev_cb;
- 	struct rte_cryptodev_cb *curr_cb;
-@@ -1630,6 +1637,10 @@ rte_cryptodev_add_deq_callback(uint8_t dev_id,
+ 	struct rte_cryptodev_cb **prev_cb, *curr_cb;
+ 	struct rte_cryptodev_cb_rcu *list;
+@@ -1545,6 +1552,10 @@ rte_cryptodev_add_deq_callback(uint8_t dev_id,
@@ -93 +94 @@
-@@ -1696,6 +1707,9 @@ rte_cryptodev_remove_deq_callback(uint8_t dev_id,
+@@ -1611,6 +1622,9 @@ rte_cryptodev_remove_deq_callback(uint8_t dev_id,
@@ -101,2 +102,2 @@
- 	RTE_ATOMIC(struct rte_cryptodev_cb *) *prev_cb;
- 	struct rte_cryptodev_cb *curr_cb;
+ 	struct rte_cryptodev_cb **prev_cb, *curr_cb;
+ 	struct rte_cryptodev_cb_rcu *list;

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'cryptodev: validate crypto callbacks from next node' has been queued to stable release 22.11.6
  2024-07-15 15:25   ` patch 'config: fix warning for cross build with meson >= 1.3.0' " luca.boccassi
                       ` (12 preceding siblings ...)
  2024-07-15 15:25     ` patch 'cryptodev: fix build without crypto callbacks' " luca.boccassi
@ 2024-07-15 15:25     ` luca.boccassi
  2024-07-15 15:25     ` patch 'examples/fips_validation: fix dereference and out-of-bound' " luca.boccassi
                       ` (70 subsequent siblings)
  84 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-07-15 15:25 UTC (permalink / raw)
  To: Ganapati Kundapura; +Cc: Akhil Goyal, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/3d19e7d9eb6ee856cbd2f1e362056d80ef6151b5

Thanks.

Luca Boccassi

---
From 3d19e7d9eb6ee856cbd2f1e362056d80ef6151b5 Mon Sep 17 00:00:00 2001
From: Ganapati Kundapura <ganapati.kundapura@intel.com>
Date: Thu, 27 Jun 2024 05:06:26 -0500
Subject: [PATCH] cryptodev: validate crypto callbacks from next node

[ upstream commit e858d0c9612211ba43d6703cb7834697214a3fe1 ]

Crypto callbacks are invoked on checking from head node
which is always valid pointer.

This patch checks next node from the head node if callbacks
registered before invoking callbacks.

Fixes: 1c3ffb95595e ("cryptodev: add enqueue and dequeue callbacks")

Signed-off-by: Ganapati Kundapura <ganapati.kundapura@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
---
 lib/cryptodev/rte_cryptodev.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.h
index f955d96e23..cef9f2b3cb 100644
--- a/lib/cryptodev/rte_cryptodev.h
+++ b/lib/cryptodev/rte_cryptodev.h
@@ -1851,7 +1851,7 @@ rte_cryptodev_dequeue_burst(uint8_t dev_id, uint16_t qp_id,
 	nb_ops = fp_ops->dequeue_burst(qp, ops, nb_ops);
 
 #ifdef RTE_CRYPTO_CALLBACKS
-	if (unlikely(fp_ops->qp.deq_cb != NULL)) {
+	if (unlikely(fp_ops->qp.deq_cb[qp_id].next != NULL)) {
 		struct rte_cryptodev_cb_rcu *list;
 		struct rte_cryptodev_cb *cb;
 
@@ -1918,7 +1918,7 @@ rte_cryptodev_enqueue_burst(uint8_t dev_id, uint16_t qp_id,
 	fp_ops = &rte_crypto_fp_ops[dev_id];
 	qp = fp_ops->qp.data[qp_id];
 #ifdef RTE_CRYPTO_CALLBACKS
-	if (unlikely(fp_ops->qp.enq_cb != NULL)) {
+	if (unlikely(fp_ops->qp.enq_cb[qp_id].next != NULL)) {
 		struct rte_cryptodev_cb_rcu *list;
 		struct rte_cryptodev_cb *cb;
 
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-15 16:19:35.572331136 +0100
+++ 0015-cryptodev-validate-crypto-callbacks-from-next-node.patch	2024-07-15 16:19:34.472204413 +0100
@@ -1 +1 @@
-From e858d0c9612211ba43d6703cb7834697214a3fe1 Mon Sep 17 00:00:00 2001
+From 3d19e7d9eb6ee856cbd2f1e362056d80ef6151b5 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit e858d0c9612211ba43d6703cb7834697214a3fe1 ]
+
@@ -13 +14,0 @@
-Cc: stable@dpdk.org
@@ -22 +23 @@
-index c946f747fc..bec947f6d5 100644
+index f955d96e23..cef9f2b3cb 100644
@@ -25 +26 @@
-@@ -1910,7 +1910,7 @@ rte_cryptodev_dequeue_burst(uint8_t dev_id, uint16_t qp_id,
+@@ -1851,7 +1851,7 @@ rte_cryptodev_dequeue_burst(uint8_t dev_id, uint16_t qp_id,
@@ -34 +35 @@
-@@ -1977,7 +1977,7 @@ rte_cryptodev_enqueue_burst(uint8_t dev_id, uint16_t qp_id,
+@@ -1918,7 +1918,7 @@ rte_cryptodev_enqueue_burst(uint8_t dev_id, uint16_t qp_id,

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'examples/fips_validation: fix dereference and out-of-bound' has been queued to stable release 22.11.6
  2024-07-15 15:25   ` patch 'config: fix warning for cross build with meson >= 1.3.0' " luca.boccassi
                       ` (13 preceding siblings ...)
  2024-07-15 15:25     ` patch 'cryptodev: validate crypto callbacks from next node' " luca.boccassi
@ 2024-07-15 15:25     ` luca.boccassi
  2024-07-15 15:25     ` patch 'crypto/openssl: fix GCM and CCM thread unsafe contexts' " luca.boccassi
                       ` (69 subsequent siblings)
  84 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-07-15 15:25 UTC (permalink / raw)
  To: Gowrishankar Muthukrishnan; +Cc: Brian Dooley, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/7e6b9c068617106e9e0896894ba5b70356976ca9

Thanks.

Luca Boccassi

---
From 7e6b9c068617106e9e0896894ba5b70356976ca9 Mon Sep 17 00:00:00 2001
From: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Date: Wed, 26 Jun 2024 15:56:23 +0530
Subject: [PATCH] examples/fips_validation: fix dereference and out-of-bound

[ upstream commit 57c10aaf3880fac5b2d0e1ddcfd8645e22b9f83c ]

Fix NULL dereference, out-of-bound, bad bit shift issues
reported by coverity scan.

Coverity issue: 384440, 384435, 384433, 384429
Fixes: 36128a67c27e ("examples/fips_validation: add asymmetric validation")

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Acked-by: Brian Dooley <brian.dooley@intel.com>
---
 examples/fips_validation/fips_validation_rsa.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/examples/fips_validation/fips_validation_rsa.c b/examples/fips_validation/fips_validation_rsa.c
index f675b51051..55f81860a0 100644
--- a/examples/fips_validation/fips_validation_rsa.c
+++ b/examples/fips_validation/fips_validation_rsa.c
@@ -328,6 +328,9 @@ parse_test_rsa_json_interim_writeback(struct fips_val *val)
 		if (prepare_vec_rsa() < 0)
 			return -1;
 
+		if (!vec.rsa.e.val)
+			return -1;
+
 		writeback_hex_str("", info.one_line_text, &vec.rsa.n);
 		obj = json_string(info.one_line_text);
 		json_object_set_new(json_info.json_write_group, "n", obj);
@@ -474,7 +477,7 @@ fips_test_randomize_message(struct fips_val *msg, struct fips_val *rand)
 	uint16_t rv_len;
 
 	if (!msg->val || !rand->val || rand->len > RV_BUF_LEN
-		|| msg->len > FIPS_TEST_JSON_BUF_LEN)
+		|| msg->len > (FIPS_TEST_JSON_BUF_LEN - 1))
 		return -EINVAL;
 
 	memset(rv, 0, sizeof(rv));
@@ -503,7 +506,7 @@ fips_test_randomize_message(struct fips_val *msg, struct fips_val *rand)
 		m[i + j] ^= rv[j];
 
 	m[i + j] = ((uint8_t *)&rv_bitlen)[0];
-	m[i + j + 1] = (((uint8_t *)&rv_bitlen)[1] >> 8) & 0xFF;
+	m[i + j + 1] = ((uint8_t *)&rv_bitlen)[1];
 
 	rte_free(msg->val);
 	msg->len = (rv_bitlen + m_bitlen + 16) / 8;
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-15 16:19:35.615184763 +0100
+++ 0016-examples-fips_validation-fix-dereference-and-out-of-.patch	2024-07-15 16:19:34.476204499 +0100
@@ -1 +1 @@
-From 57c10aaf3880fac5b2d0e1ddcfd8645e22b9f83c Mon Sep 17 00:00:00 2001
+From 7e6b9c068617106e9e0896894ba5b70356976ca9 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 57c10aaf3880fac5b2d0e1ddcfd8645e22b9f83c ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'crypto/openssl: fix GCM and CCM thread unsafe contexts' has been queued to stable release 22.11.6
  2024-07-15 15:25   ` patch 'config: fix warning for cross build with meson >= 1.3.0' " luca.boccassi
                       ` (14 preceding siblings ...)
  2024-07-15 15:25     ` patch 'examples/fips_validation: fix dereference and out-of-bound' " luca.boccassi
@ 2024-07-15 15:25     ` luca.boccassi
  2024-07-15 15:25     ` patch 'crypto/openssl: optimize 3DES-CTR context init' " luca.boccassi
                       ` (68 subsequent siblings)
  84 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-07-15 15:25 UTC (permalink / raw)
  To: Jack Bond-Preston; +Cc: Kai Ji, Wathsala Vithanage, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/5154afdce867b5eca45e9239581dc2eca7b07777

Thanks.

Luca Boccassi

---
From 5154afdce867b5eca45e9239581dc2eca7b07777 Mon Sep 17 00:00:00 2001
From: Jack Bond-Preston <jack.bond-preston@foss.arm.com>
Date: Wed, 3 Jul 2024 13:45:47 +0000
Subject: [PATCH] crypto/openssl: fix GCM and CCM thread unsafe contexts

[ upstream commit 78d7765f0acbb23168b7b25e25d775bea22c48ab ]

Commit 67ab783b5d70 ("crypto/openssl: use local copy for session
contexts") introduced a fix for concurrency bugs which could occur when
using one OpenSSL PMD session across multiple cores simultaneously. The
solution was to clone the EVP contexts per-buffer to avoid them being
used concurrently.

However, part of commit 75adf1eae44f ("crypto/openssl: update HMAC
routine with 3.0 EVP API") reverted this fix, only for combined ops
(AES-GCM and AES-CCM).

Fix the concurrency issue by cloning EVP contexts per-buffer. An extra
workaround is required for OpenSSL versions which are >= 3.0.0, and
<= 3.2.0. This is because, prior to OpenSSL 3.2.0, EVP_CIPHER_CTX_copy()
is not implemented for AES-GCM or AES-CCM. When using these OpenSSL
versions, create and initialise the context from scratch, per-buffer.

Throughput performance uplift measurements for AES-GCM-128 encrypt on
Ampere Altra Max platform:
1 worker lcore
|   buffer sz (B) |   prev (Gbps) |   optimised (Gbps) |   uplift |
|-----------------+---------------+--------------------+----------|
|              64 |          2.60 |               1.31 |   -49.5% |
|             256 |          7.69 |               4.45 |   -42.1% |
|            1024 |         15.33 |              11.30 |   -26.3% |
|            2048 |         18.74 |              15.37 |   -18.0% |
|            4096 |         21.11 |              18.80 |   -10.9% |

8 worker lcores
|   buffer sz (B) |   prev (Gbps) |   optimised (Gbps) |   uplift |
|-----------------+---------------+--------------------+----------|
|              64 |         19.94 |               2.83 |   -85.8% |
|             256 |         58.84 |              11.00 |   -81.3% |
|            1024 |        119.71 |              42.46 |   -64.5% |
|            2048 |        147.69 |              80.91 |   -45.2% |
|            4096 |        167.39 |             121.25 |   -27.6% |

Fixes: 75adf1eae44f ("crypto/openssl: update HMAC routine with 3.0 EVP API")

Signed-off-by: Jack Bond-Preston <jack.bond-preston@foss.arm.com>
Acked-by: Kai Ji <kai.ji@intel.com>
Reviewed-by: Wathsala Vithanage <wathsala.vithanage@arm.com>
---
 drivers/crypto/openssl/rte_openssl_pmd.c | 84 ++++++++++++++++++------
 1 file changed, 64 insertions(+), 20 deletions(-)

diff --git a/drivers/crypto/openssl/rte_openssl_pmd.c b/drivers/crypto/openssl/rte_openssl_pmd.c
index 6ae31cb5cd..bf9a546f48 100644
--- a/drivers/crypto/openssl/rte_openssl_pmd.c
+++ b/drivers/crypto/openssl/rte_openssl_pmd.c
@@ -349,7 +349,8 @@ get_aead_algo(enum rte_crypto_aead_algorithm sess_algo, size_t keylen,
 static int
 openssl_set_sess_aead_enc_param(struct openssl_session *sess,
 		enum rte_crypto_aead_algorithm algo,
-		uint8_t tag_len, const uint8_t *key)
+		uint8_t tag_len, const uint8_t *key,
+		EVP_CIPHER_CTX **ctx)
 {
 	int iv_type = 0;
 	unsigned int do_ccm;
@@ -377,7 +378,7 @@ openssl_set_sess_aead_enc_param(struct openssl_session *sess,
 	}
 
 	sess->cipher.mode = OPENSSL_CIPHER_LIB;
-	sess->cipher.ctx = EVP_CIPHER_CTX_new();
+	*ctx = EVP_CIPHER_CTX_new();
 
 	if (get_aead_algo(algo, sess->cipher.key.length,
 			&sess->cipher.evp_algo) != 0)
@@ -387,19 +388,19 @@ openssl_set_sess_aead_enc_param(struct openssl_session *sess,
 
 	sess->chain_order = OPENSSL_CHAIN_COMBINED;
 
-	if (EVP_EncryptInit_ex(sess->cipher.ctx, sess->cipher.evp_algo,
+	if (EVP_EncryptInit_ex(*ctx, sess->cipher.evp_algo,
 			NULL, NULL, NULL) <= 0)
 		return -EINVAL;
 
-	if (EVP_CIPHER_CTX_ctrl(sess->cipher.ctx, iv_type, sess->iv.length,
+	if (EVP_CIPHER_CTX_ctrl(*ctx, iv_type, sess->iv.length,
 			NULL) <= 0)
 		return -EINVAL;
 
 	if (do_ccm)
-		EVP_CIPHER_CTX_ctrl(sess->cipher.ctx, EVP_CTRL_CCM_SET_TAG,
+		EVP_CIPHER_CTX_ctrl(*ctx, EVP_CTRL_CCM_SET_TAG,
 				tag_len, NULL);
 
-	if (EVP_EncryptInit_ex(sess->cipher.ctx, NULL, NULL, key, NULL) <= 0)
+	if (EVP_EncryptInit_ex(*ctx, NULL, NULL, key, NULL) <= 0)
 		return -EINVAL;
 
 	return 0;
@@ -409,7 +410,8 @@ openssl_set_sess_aead_enc_param(struct openssl_session *sess,
 static int
 openssl_set_sess_aead_dec_param(struct openssl_session *sess,
 		enum rte_crypto_aead_algorithm algo,
-		uint8_t tag_len, const uint8_t *key)
+		uint8_t tag_len, const uint8_t *key,
+		EVP_CIPHER_CTX **ctx)
 {
 	int iv_type = 0;
 	unsigned int do_ccm = 0;
@@ -436,7 +438,7 @@ openssl_set_sess_aead_dec_param(struct openssl_session *sess,
 	}
 
 	sess->cipher.mode = OPENSSL_CIPHER_LIB;
-	sess->cipher.ctx = EVP_CIPHER_CTX_new();
+	*ctx = EVP_CIPHER_CTX_new();
 
 	if (get_aead_algo(algo, sess->cipher.key.length,
 			&sess->cipher.evp_algo) != 0)
@@ -446,24 +448,54 @@ openssl_set_sess_aead_dec_param(struct openssl_session *sess,
 
 	sess->chain_order = OPENSSL_CHAIN_COMBINED;
 
-	if (EVP_DecryptInit_ex(sess->cipher.ctx, sess->cipher.evp_algo,
+	if (EVP_DecryptInit_ex(*ctx, sess->cipher.evp_algo,
 			NULL, NULL, NULL) <= 0)
 		return -EINVAL;
 
-	if (EVP_CIPHER_CTX_ctrl(sess->cipher.ctx, iv_type,
+	if (EVP_CIPHER_CTX_ctrl(*ctx, iv_type,
 			sess->iv.length, NULL) <= 0)
 		return -EINVAL;
 
 	if (do_ccm)
-		EVP_CIPHER_CTX_ctrl(sess->cipher.ctx, EVP_CTRL_CCM_SET_TAG,
+		EVP_CIPHER_CTX_ctrl(*ctx, EVP_CTRL_CCM_SET_TAG,
 				tag_len, NULL);
 
-	if (EVP_DecryptInit_ex(sess->cipher.ctx, NULL, NULL, key, NULL) <= 0)
+	if (EVP_DecryptInit_ex(*ctx, NULL, NULL, key, NULL) <= 0)
 		return -EINVAL;
 
 	return 0;
 }
 
+static int openssl_aesni_ctx_clone(EVP_CIPHER_CTX **dest,
+		struct openssl_session *sess)
+{
+#if (OPENSSL_VERSION_NUMBER >= 0x30200000L)
+	*dest = EVP_CIPHER_CTX_dup(sess->ctx);
+	return 0;
+#elif (OPENSSL_VERSION_NUMBER >= 0x30000000L)
+	/* OpenSSL versions 3.0.0 <= V < 3.2.0 have no dupctx() implementation
+	 * for AES-GCM and AES-CCM. In this case, we have to create new empty
+	 * contexts and initialise, as we did the original context.
+	 */
+	if (sess->auth.algo == RTE_CRYPTO_AUTH_AES_GMAC)
+		sess->aead_algo = RTE_CRYPTO_AEAD_AES_GCM;
+
+	if (sess->cipher.direction == RTE_CRYPTO_CIPHER_OP_ENCRYPT)
+		return openssl_set_sess_aead_enc_param(sess, sess->aead_algo,
+				sess->auth.digest_length, sess->cipher.key.data,
+				dest);
+	else
+		return openssl_set_sess_aead_dec_param(sess, sess->aead_algo,
+				sess->auth.digest_length, sess->cipher.key.data,
+				dest);
+#else
+	*dest = EVP_CIPHER_CTX_new();
+	if (EVP_CIPHER_CTX_copy(*dest, sess->cipher.ctx) != 1)
+		return -EINVAL;
+	return 0;
+#endif
+}
+
 /** Set session cipher parameters */
 static int
 openssl_set_session_cipher_parameters(struct openssl_session *sess,
@@ -622,12 +654,14 @@ openssl_set_session_auth_parameters(struct openssl_session *sess,
 			return openssl_set_sess_aead_enc_param(sess,
 						RTE_CRYPTO_AEAD_AES_GCM,
 						xform->auth.digest_length,
-						xform->auth.key.data);
+						xform->auth.key.data,
+						&sess->cipher.ctx);
 		else
 			return openssl_set_sess_aead_dec_param(sess,
 						RTE_CRYPTO_AEAD_AES_GCM,
 						xform->auth.digest_length,
-						xform->auth.key.data);
+						xform->auth.key.data,
+						&sess->cipher.ctx);
 		break;
 
 	case RTE_CRYPTO_AUTH_MD5:
@@ -769,10 +803,12 @@ openssl_set_session_aead_parameters(struct openssl_session *sess,
 	/* Select cipher direction */
 	if (xform->aead.op == RTE_CRYPTO_AEAD_OP_ENCRYPT)
 		return openssl_set_sess_aead_enc_param(sess, xform->aead.algo,
-				xform->aead.digest_length, xform->aead.key.data);
+				xform->aead.digest_length, xform->aead.key.data,
+				&sess->cipher.ctx);
 	else
 		return openssl_set_sess_aead_dec_param(sess, xform->aead.algo,
-				xform->aead.digest_length, xform->aead.key.data);
+				xform->aead.digest_length, xform->aead.key.data,
+				&sess->cipher.ctx);
 }
 
 /** Parse crypto xform chain and set private session parameters */
@@ -1589,6 +1625,12 @@ process_openssl_combined_op
 		return;
 	}
 
+	EVP_CIPHER_CTX *ctx;
+	if (openssl_aesni_ctx_clone(&ctx, sess) != 0) {
+		op->status = RTE_CRYPTO_OP_STATUS_ERROR;
+		return;
+	}
+
 	iv = rte_crypto_op_ctod_offset(op, uint8_t *,
 			sess->iv.offset);
 	if (sess->auth.algo == RTE_CRYPTO_AUTH_AES_GMAC) {
@@ -1622,12 +1664,12 @@ process_openssl_combined_op
 			status = process_openssl_auth_encryption_gcm(
 					mbuf_src, offset, srclen,
 					aad, aadlen, iv,
-					dst, tag, sess->cipher.ctx);
+					dst, tag, ctx);
 		else
 			status = process_openssl_auth_encryption_ccm(
 					mbuf_src, offset, srclen,
 					aad, aadlen, iv,
-					dst, tag, taglen, sess->cipher.ctx);
+					dst, tag, taglen, ctx);
 
 	} else {
 		if (sess->auth.algo == RTE_CRYPTO_AUTH_AES_GMAC ||
@@ -1635,14 +1677,16 @@ process_openssl_combined_op
 			status = process_openssl_auth_decryption_gcm(
 					mbuf_src, offset, srclen,
 					aad, aadlen, iv,
-					dst, tag, sess->cipher.ctx);
+					dst, tag, ctx);
 		else
 			status = process_openssl_auth_decryption_ccm(
 					mbuf_src, offset, srclen,
 					aad, aadlen, iv,
-					dst, tag, taglen, sess->cipher.ctx);
+					dst, tag, taglen, ctx);
 	}
 
+	EVP_CIPHER_CTX_free(ctx);
+
 	if (status != 0) {
 		if (status == (-EFAULT) &&
 				sess->auth.operation ==
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-15 16:19:35.657083047 +0100
+++ 0017-crypto-openssl-fix-GCM-and-CCM-thread-unsafe-context.patch	2024-07-15 16:19:34.476204499 +0100
@@ -1 +1 @@
-From 78d7765f0acbb23168b7b25e25d775bea22c48ab Mon Sep 17 00:00:00 2001
+From 5154afdce867b5eca45e9239581dc2eca7b07777 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 78d7765f0acbb23168b7b25e25d775bea22c48ab ]
+
@@ -43 +44,0 @@
-Cc: stable@dpdk.org
@@ -53 +54 @@
-index e8cb09defc..3e547c2039 100644
+index 6ae31cb5cd..bf9a546f48 100644
@@ -56 +57 @@
-@@ -350,7 +350,8 @@ get_aead_algo(enum rte_crypto_aead_algorithm sess_algo, size_t keylen,
+@@ -349,7 +349,8 @@ get_aead_algo(enum rte_crypto_aead_algorithm sess_algo, size_t keylen,
@@ -66 +67 @@
-@@ -378,7 +379,7 @@ openssl_set_sess_aead_enc_param(struct openssl_session *sess,
+@@ -377,7 +378,7 @@ openssl_set_sess_aead_enc_param(struct openssl_session *sess,
@@ -75 +76 @@
-@@ -388,19 +389,19 @@ openssl_set_sess_aead_enc_param(struct openssl_session *sess,
+@@ -387,19 +388,19 @@ openssl_set_sess_aead_enc_param(struct openssl_session *sess,
@@ -99 +100 @@
-@@ -410,7 +411,8 @@ openssl_set_sess_aead_enc_param(struct openssl_session *sess,
+@@ -409,7 +410,8 @@ openssl_set_sess_aead_enc_param(struct openssl_session *sess,
@@ -109 +110 @@
-@@ -437,7 +439,7 @@ openssl_set_sess_aead_dec_param(struct openssl_session *sess,
+@@ -436,7 +438,7 @@ openssl_set_sess_aead_dec_param(struct openssl_session *sess,
@@ -118 +119 @@
-@@ -447,24 +449,54 @@ openssl_set_sess_aead_dec_param(struct openssl_session *sess,
+@@ -446,24 +448,54 @@ openssl_set_sess_aead_dec_param(struct openssl_session *sess,
@@ -177 +178 @@
-@@ -623,12 +655,14 @@ openssl_set_session_auth_parameters(struct openssl_session *sess,
+@@ -622,12 +654,14 @@ openssl_set_session_auth_parameters(struct openssl_session *sess,
@@ -194 +195 @@
-@@ -770,10 +804,12 @@ openssl_set_session_aead_parameters(struct openssl_session *sess,
+@@ -769,10 +803,12 @@ openssl_set_session_aead_parameters(struct openssl_session *sess,
@@ -209 +210 @@
-@@ -1590,6 +1626,12 @@ process_openssl_combined_op
+@@ -1589,6 +1625,12 @@ process_openssl_combined_op
@@ -222 +223 @@
-@@ -1623,12 +1665,12 @@ process_openssl_combined_op
+@@ -1622,12 +1664,12 @@ process_openssl_combined_op
@@ -237 +238 @@
-@@ -1636,14 +1678,16 @@ process_openssl_combined_op
+@@ -1635,14 +1677,16 @@ process_openssl_combined_op

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'crypto/openssl: optimize 3DES-CTR context init' has been queued to stable release 22.11.6
  2024-07-15 15:25   ` patch 'config: fix warning for cross build with meson >= 1.3.0' " luca.boccassi
                       ` (15 preceding siblings ...)
  2024-07-15 15:25     ` patch 'crypto/openssl: fix GCM and CCM thread unsafe contexts' " luca.boccassi
@ 2024-07-15 15:25     ` luca.boccassi
  2024-07-15 15:25     ` patch 'crypto/openssl: make per-QP cipher context clones' " luca.boccassi
                       ` (67 subsequent siblings)
  84 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-07-15 15:25 UTC (permalink / raw)
  To: Jack Bond-Preston; +Cc: Kai Ji, Wathsala Vithanage, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/8e32c3a94a8b8d312acb1170ee601cafc7475f4f

Thanks.

Luca Boccassi

---
From 8e32c3a94a8b8d312acb1170ee601cafc7475f4f Mon Sep 17 00:00:00 2001
From: Jack Bond-Preston <jack.bond-preston@foss.arm.com>
Date: Wed, 3 Jul 2024 13:45:48 +0000
Subject: [PATCH] crypto/openssl: optimize 3DES-CTR context init

[ upstream commit 08917edd8b110f9819301ee4f9b152de7c79ddd4 ]

Currently the 3DES-CTR cipher context is initialised for every buffer,
setting the cipher implementation and key - even though for every
buffer in the session these values will be the same.

Change to initialising the cipher context once, before any buffers are
processed, instead.

Throughput performance uplift measurements for 3DES-CTR encrypt on
Ampere Altra Max platform:
1 worker lcore
|   buffer sz (B) |   prev (Gbps) |   optimised (Gbps) |   uplift |
|-----------------+---------------+--------------------+----------|
|              64 |          0.16 |               0.21 |    35.3% |
|             256 |          0.20 |               0.22 |     9.4% |
|            1024 |          0.22 |               0.23 |     2.3% |
|            2048 |          0.22 |               0.23 |     0.9% |
|            4096 |          0.22 |               0.23 |     0.9% |

8 worker lcores
|   buffer sz (B) |   prev (Gbps) |   optimised (Gbps) |   uplift |
|-----------------+---------------+--------------------+----------|
|              64 |          1.01 |               1.34 |    32.9% |
|             256 |          1.51 |               1.66 |     9.9% |
|            1024 |          1.72 |               1.77 |     2.6% |
|            2048 |          1.76 |               1.78 |     1.1% |
|            4096 |          1.79 |               1.80 |     0.6% |

Signed-off-by: Jack Bond-Preston <jack.bond-preston@foss.arm.com>
Acked-by: Kai Ji <kai.ji@intel.com>
Reviewed-by: Wathsala Vithanage <wathsala.vithanage@arm.com>
---
 drivers/crypto/openssl/rte_openssl_pmd.c | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/drivers/crypto/openssl/rte_openssl_pmd.c b/drivers/crypto/openssl/rte_openssl_pmd.c
index bf9a546f48..bfdcda8841 100644
--- a/drivers/crypto/openssl/rte_openssl_pmd.c
+++ b/drivers/crypto/openssl/rte_openssl_pmd.c
@@ -552,6 +552,15 @@ openssl_set_session_cipher_parameters(struct openssl_session *sess,
 				sess->cipher.key.length,
 				sess->cipher.key.data) != 0)
 			return -EINVAL;
+
+
+		/* We use 3DES encryption also for decryption.
+		 * IV is not important for 3DES ECB.
+		 */
+		if (EVP_EncryptInit_ex(sess->cipher.ctx, EVP_des_ede3_ecb(),
+				NULL, sess->cipher.key.data,  NULL) != 1)
+			return -EINVAL;
+
 		break;
 
 	case RTE_CRYPTO_CIPHER_DES_CBC:
@@ -1171,8 +1180,7 @@ process_cipher_decrypt_err:
 /** Process cipher des 3 ctr encryption, decryption algorithm */
 static int
 process_openssl_cipher_des3ctr(struct rte_mbuf *mbuf_src, uint8_t *dst,
-		int offset, uint8_t *iv, uint8_t *key, int srclen,
-		EVP_CIPHER_CTX *ctx)
+		int offset, uint8_t *iv, int srclen, EVP_CIPHER_CTX *ctx)
 {
 	uint8_t ebuf[8], ctr[8];
 	int unused, n;
@@ -1190,12 +1198,6 @@ process_openssl_cipher_des3ctr(struct rte_mbuf *mbuf_src, uint8_t *dst,
 	src = rte_pktmbuf_mtod_offset(m, uint8_t *, offset);
 	l = rte_pktmbuf_data_len(m) - offset;
 
-	/* We use 3DES encryption also for decryption.
-	 * IV is not important for 3DES ecb
-	 */
-	if (EVP_EncryptInit_ex(ctx, EVP_des_ede3_ecb(), NULL, key, NULL) <= 0)
-		goto process_cipher_des3ctr_err;
-
 	memcpy(ctr, iv, 8);
 
 	for (n = 0; n < srclen; n++) {
@@ -1739,8 +1741,7 @@ process_openssl_cipher_op
 					srclen, ctx_copy, inplace);
 	else
 		status = process_openssl_cipher_des3ctr(mbuf_src, dst,
-				op->sym->cipher.data.offset, iv,
-				sess->cipher.key.data, srclen,
+				op->sym->cipher.data.offset, iv, srclen,
 				ctx_copy);
 
 	EVP_CIPHER_CTX_free(ctx_copy);
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-15 16:19:35.700839877 +0100
+++ 0018-crypto-openssl-optimize-3DES-CTR-context-init.patch	2024-07-15 16:19:34.480204585 +0100
@@ -1 +1 @@
-From 08917edd8b110f9819301ee4f9b152de7c79ddd4 Mon Sep 17 00:00:00 2001
+From 8e32c3a94a8b8d312acb1170ee601cafc7475f4f Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 08917edd8b110f9819301ee4f9b152de7c79ddd4 ]
+
@@ -33,2 +34,0 @@
-Cc: stable@dpdk.org
-
@@ -43 +43 @@
-index 3e547c2039..bd09d58d88 100644
+index bf9a546f48..bfdcda8841 100644
@@ -46 +46 @@
-@@ -553,6 +553,15 @@ openssl_set_session_cipher_parameters(struct openssl_session *sess,
+@@ -552,6 +552,15 @@ openssl_set_session_cipher_parameters(struct openssl_session *sess,
@@ -62 +62 @@
-@@ -1172,8 +1181,7 @@ process_cipher_decrypt_err:
+@@ -1171,8 +1180,7 @@ process_cipher_decrypt_err:
@@ -72 +72 @@
-@@ -1191,12 +1199,6 @@ process_openssl_cipher_des3ctr(struct rte_mbuf *mbuf_src, uint8_t *dst,
+@@ -1190,12 +1198,6 @@ process_openssl_cipher_des3ctr(struct rte_mbuf *mbuf_src, uint8_t *dst,
@@ -85 +85 @@
-@@ -1740,8 +1742,7 @@ process_openssl_cipher_op
+@@ -1739,8 +1741,7 @@ process_openssl_cipher_op

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'crypto/openssl: make per-QP cipher context clones' has been queued to stable release 22.11.6
  2024-07-15 15:25   ` patch 'config: fix warning for cross build with meson >= 1.3.0' " luca.boccassi
                       ` (16 preceding siblings ...)
  2024-07-15 15:25     ` patch 'crypto/openssl: optimize 3DES-CTR context init' " luca.boccassi
@ 2024-07-15 15:25     ` luca.boccassi
  2024-07-15 15:25     ` patch 'crypto/openssl: make per-QP auth " luca.boccassi
                       ` (66 subsequent siblings)
  84 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-07-15 15:25 UTC (permalink / raw)
  To: Jack Bond-Preston; +Cc: Kai Ji, Wathsala Vithanage, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/26e1e90724f9ab34120d25bba9a3cc47c9234540

Thanks.

Luca Boccassi

---
From 26e1e90724f9ab34120d25bba9a3cc47c9234540 Mon Sep 17 00:00:00 2001
From: Jack Bond-Preston <jack.bond-preston@foss.arm.com>
Date: Wed, 3 Jul 2024 13:45:49 +0000
Subject: [PATCH] crypto/openssl: make per-QP cipher context clones

[ upstream commit b1d71126023521fe740ec473abfe5b295035b859 ]

Currently EVP_CIPHER_CTXs are allocated, copied to (from
openssl_session), and then freed for every cipher operation (ie. per
packet). This is very inefficient, and avoidable.

Make each openssl_session hold an array of pointers to per-queue-pair
cipher context copies. These are populated on first use by allocating a
new context and copying from the main context. These copies can then be
used in a thread-safe manner by different worker lcores simultaneously.
Consequently the cipher context allocation and copy only has to happen
once - the first time a given qp uses an openssl_session. This brings
about a large performance boost.

Throughput performance uplift measurements for AES-CBC-128 encrypt on
Ampere Altra Max platform:
1 worker lcore
|   buffer sz (B) |   prev (Gbps) |   optimised (Gbps) |   uplift |
|-----------------+---------------+--------------------+----------|
|              64 |          1.51 |               2.94 |    94.4% |
|             256 |          4.90 |               8.05 |    64.3% |
|            1024 |         11.07 |              14.21 |    28.3% |
|            2048 |         14.03 |              16.28 |    16.0% |
|            4096 |         16.20 |              17.59 |     8.6% |

8 worker lcores
|   buffer sz (B) |   prev (Gbps) |   optimised (Gbps) |   uplift |
|-----------------+---------------+--------------------+----------|
|              64 |          3.05 |              23.74 |   678.8% |
|             256 |         10.46 |              64.86 |   520.3% |
|            1024 |         40.97 |             113.80 |   177.7% |
|            2048 |         73.25 |             130.21 |    77.8% |
|            4096 |        103.89 |             140.62 |    35.4% |

Signed-off-by: Jack Bond-Preston <jack.bond-preston@foss.arm.com>
Acked-by: Kai Ji <kai.ji@intel.com>
Reviewed-by: Wathsala Vithanage <wathsala.vithanage@arm.com>
---
 drivers/crypto/openssl/openssl_pmd_private.h |  11 +-
 drivers/crypto/openssl/rte_openssl_pmd.c     | 105 ++++++++++++-------
 drivers/crypto/openssl/rte_openssl_pmd_ops.c |  34 +++++-
 3 files changed, 108 insertions(+), 42 deletions(-)

diff --git a/drivers/crypto/openssl/openssl_pmd_private.h b/drivers/crypto/openssl/openssl_pmd_private.h
index 4e224b040b..810b539f10 100644
--- a/drivers/crypto/openssl/openssl_pmd_private.h
+++ b/drivers/crypto/openssl/openssl_pmd_private.h
@@ -165,6 +165,14 @@ struct openssl_session {
 		/**< digest length */
 	} auth;
 
+	uint16_t ctx_copies_len;
+	/* < number of entries in ctx_copies */
+	EVP_CIPHER_CTX *qp_ctx[];
+	/**< Flexible array member of per-queue-pair pointers to copies of EVP
+	 * context structure. Cipher contexts are not safe to use from multiple
+	 * cores simultaneously, so maintaining these copies allows avoiding
+	 * per-buffer copying into a temporary context.
+	 */
 } __rte_cache_aligned;
 
 /** OPENSSL crypto private asymmetric session structure */
@@ -211,7 +219,8 @@ struct openssl_asym_session {
 /** Set and validate OPENSSL crypto session parameters */
 extern int
 openssl_set_session_parameters(struct openssl_session *sess,
-		const struct rte_crypto_sym_xform *xform);
+		const struct rte_crypto_sym_xform *xform,
+		uint16_t nb_queue_pairs);
 
 /** Reset OPENSSL crypto session parameters */
 extern void
diff --git a/drivers/crypto/openssl/rte_openssl_pmd.c b/drivers/crypto/openssl/rte_openssl_pmd.c
index bfdcda8841..62a179b6b6 100644
--- a/drivers/crypto/openssl/rte_openssl_pmd.c
+++ b/drivers/crypto/openssl/rte_openssl_pmd.c
@@ -466,13 +466,10 @@ openssl_set_sess_aead_dec_param(struct openssl_session *sess,
 	return 0;
 }
 
+#if (OPENSSL_VERSION_NUMBER >= 0x30000000L && OPENSSL_VERSION_NUMBER < 0x30200000L)
 static int openssl_aesni_ctx_clone(EVP_CIPHER_CTX **dest,
 		struct openssl_session *sess)
 {
-#if (OPENSSL_VERSION_NUMBER >= 0x30200000L)
-	*dest = EVP_CIPHER_CTX_dup(sess->ctx);
-	return 0;
-#elif (OPENSSL_VERSION_NUMBER >= 0x30000000L)
 	/* OpenSSL versions 3.0.0 <= V < 3.2.0 have no dupctx() implementation
 	 * for AES-GCM and AES-CCM. In this case, we have to create new empty
 	 * contexts and initialise, as we did the original context.
@@ -488,13 +485,8 @@ static int openssl_aesni_ctx_clone(EVP_CIPHER_CTX **dest,
 		return openssl_set_sess_aead_dec_param(sess, sess->aead_algo,
 				sess->auth.digest_length, sess->cipher.key.data,
 				dest);
-#else
-	*dest = EVP_CIPHER_CTX_new();
-	if (EVP_CIPHER_CTX_copy(*dest, sess->cipher.ctx) != 1)
-		return -EINVAL;
-	return 0;
-#endif
 }
+#endif
 
 /** Set session cipher parameters */
 static int
@@ -823,7 +815,8 @@ openssl_set_session_aead_parameters(struct openssl_session *sess,
 /** Parse crypto xform chain and set private session parameters */
 int
 openssl_set_session_parameters(struct openssl_session *sess,
-		const struct rte_crypto_sym_xform *xform)
+		const struct rte_crypto_sym_xform *xform,
+		uint16_t nb_queue_pairs)
 {
 	const struct rte_crypto_sym_xform *cipher_xform = NULL;
 	const struct rte_crypto_sym_xform *auth_xform = NULL;
@@ -885,6 +878,12 @@ openssl_set_session_parameters(struct openssl_session *sess,
 		}
 	}
 
+	/*
+	 * With only one queue pair, the array of copies is not needed.
+	 * Otherwise, one entry per queue pair is required.
+	 */
+	sess->ctx_copies_len = nb_queue_pairs > 1 ? nb_queue_pairs : 0;
+
 	return 0;
 }
 
@@ -892,6 +891,13 @@ openssl_set_session_parameters(struct openssl_session *sess,
 void
 openssl_reset_session(struct openssl_session *sess)
 {
+	for (uint16_t i = 0; i < sess->ctx_copies_len; i++) {
+		if (sess->qp_ctx[i] != NULL) {
+			EVP_CIPHER_CTX_free(sess->qp_ctx[i]);
+			sess->qp_ctx[i] = NULL;
+		}
+	}
+
 	EVP_CIPHER_CTX_free(sess->cipher.ctx);
 
 	if (sess->chain_order == OPENSSL_CHAIN_CIPHER_BPI)
@@ -958,7 +964,7 @@ get_session(struct openssl_qp *qp, struct rte_crypto_op *op)
 		sess = (struct openssl_session *)_sess->driver_priv_data;
 
 		if (unlikely(openssl_set_session_parameters(sess,
-				op->sym->xform) != 0)) {
+				op->sym->xform, 1) != 0)) {
 			rte_mempool_put(qp->sess_mp, _sess);
 			sess = NULL;
 		}
@@ -1606,11 +1612,45 @@ process_auth_err:
 # endif
 /*----------------------------------------------------------------------------*/
 
+static inline EVP_CIPHER_CTX *
+get_local_cipher_ctx(struct openssl_session *sess, struct openssl_qp *qp)
+{
+	/* If the array is not being used, just return the main context. */
+	if (sess->ctx_copies_len == 0)
+		return sess->cipher.ctx;
+
+	EVP_CIPHER_CTX **lctx = &sess->qp_ctx[qp->id];
+
+	if (unlikely(*lctx == NULL)) {
+#if OPENSSL_VERSION_NUMBER >= 0x30200000L
+		/* EVP_CIPHER_CTX_dup() added in OSSL 3.2 */
+		*lctx = EVP_CIPHER_CTX_dup(sess->cipher.ctx);
+		return *lctx;
+#elif OPENSSL_VERSION_NUMBER >= 0x30000000L
+		if (sess->chain_order == OPENSSL_CHAIN_COMBINED) {
+			/* AESNI special-cased to use openssl_aesni_ctx_clone()
+			 * to allow for working around lack of
+			 * EVP_CIPHER_CTX_copy support for 3.0.0 <= OSSL Version
+			 * < 3.2.0.
+			 */
+			if (openssl_aesni_ctx_clone(lctx, sess) != 0)
+				*lctx = NULL;
+			return *lctx;
+		}
+#endif
+
+		*lctx = EVP_CIPHER_CTX_new();
+		EVP_CIPHER_CTX_copy(*lctx, sess->cipher.ctx);
+	}
+
+	return *lctx;
+}
+
 /** Process auth/cipher combined operation */
 static void
-process_openssl_combined_op
-		(struct rte_crypto_op *op, struct openssl_session *sess,
-		struct rte_mbuf *mbuf_src, struct rte_mbuf *mbuf_dst)
+process_openssl_combined_op(struct openssl_qp *qp, struct rte_crypto_op *op,
+		struct openssl_session *sess, struct rte_mbuf *mbuf_src,
+		struct rte_mbuf *mbuf_dst)
 {
 	/* cipher */
 	uint8_t *dst = NULL, *iv, *tag, *aad;
@@ -1627,11 +1667,7 @@ process_openssl_combined_op
 		return;
 	}
 
-	EVP_CIPHER_CTX *ctx;
-	if (openssl_aesni_ctx_clone(&ctx, sess) != 0) {
-		op->status = RTE_CRYPTO_OP_STATUS_ERROR;
-		return;
-	}
+	EVP_CIPHER_CTX *ctx = get_local_cipher_ctx(sess, qp);
 
 	iv = rte_crypto_op_ctod_offset(op, uint8_t *,
 			sess->iv.offset);
@@ -1687,8 +1723,6 @@ process_openssl_combined_op
 					dst, tag, taglen, ctx);
 	}
 
-	EVP_CIPHER_CTX_free(ctx);
-
 	if (status != 0) {
 		if (status == (-EFAULT) &&
 				sess->auth.operation ==
@@ -1701,14 +1735,13 @@ process_openssl_combined_op
 
 /** Process cipher operation */
 static void
-process_openssl_cipher_op
-		(struct rte_crypto_op *op, struct openssl_session *sess,
-		struct rte_mbuf *mbuf_src, struct rte_mbuf *mbuf_dst)
+process_openssl_cipher_op(struct openssl_qp *qp, struct rte_crypto_op *op,
+		struct openssl_session *sess, struct rte_mbuf *mbuf_src,
+		struct rte_mbuf *mbuf_dst)
 {
 	uint8_t *dst, *iv;
 	int srclen, status;
 	uint8_t inplace = (mbuf_src == mbuf_dst) ? 1 : 0;
-	EVP_CIPHER_CTX *ctx_copy;
 
 	/*
 	 * Segmented OOP destination buffer is not supported for encryption/
@@ -1727,24 +1760,22 @@ process_openssl_cipher_op
 
 	iv = rte_crypto_op_ctod_offset(op, uint8_t *,
 			sess->iv.offset);
-	ctx_copy = EVP_CIPHER_CTX_new();
-	EVP_CIPHER_CTX_copy(ctx_copy, sess->cipher.ctx);
+
+	EVP_CIPHER_CTX *ctx = get_local_cipher_ctx(sess, qp);
 
 	if (sess->cipher.mode == OPENSSL_CIPHER_LIB)
 		if (sess->cipher.direction == RTE_CRYPTO_CIPHER_OP_ENCRYPT)
 			status = process_openssl_cipher_encrypt(mbuf_src, dst,
 					op->sym->cipher.data.offset, iv,
-					srclen, ctx_copy, inplace);
+					srclen, ctx, inplace);
 		else
 			status = process_openssl_cipher_decrypt(mbuf_src, dst,
 					op->sym->cipher.data.offset, iv,
-					srclen, ctx_copy, inplace);
+					srclen, ctx, inplace);
 	else
 		status = process_openssl_cipher_des3ctr(mbuf_src, dst,
-				op->sym->cipher.data.offset, iv, srclen,
-				ctx_copy);
+				op->sym->cipher.data.offset, iv, srclen, ctx);
 
-	EVP_CIPHER_CTX_free(ctx_copy);
 	if (status != 0)
 		op->status = RTE_CRYPTO_OP_STATUS_ERROR;
 }
@@ -2910,13 +2941,13 @@ process_op(struct openssl_qp *qp, struct rte_crypto_op *op,
 
 	switch (sess->chain_order) {
 	case OPENSSL_CHAIN_ONLY_CIPHER:
-		process_openssl_cipher_op(op, sess, msrc, mdst);
+		process_openssl_cipher_op(qp, op, sess, msrc, mdst);
 		break;
 	case OPENSSL_CHAIN_ONLY_AUTH:
 		process_openssl_auth_op(qp, op, sess, msrc, mdst);
 		break;
 	case OPENSSL_CHAIN_CIPHER_AUTH:
-		process_openssl_cipher_op(op, sess, msrc, mdst);
+		process_openssl_cipher_op(qp, op, sess, msrc, mdst);
 		/* OOP */
 		if (msrc != mdst)
 			copy_plaintext(msrc, mdst, op);
@@ -2924,10 +2955,10 @@ process_op(struct openssl_qp *qp, struct rte_crypto_op *op,
 		break;
 	case OPENSSL_CHAIN_AUTH_CIPHER:
 		process_openssl_auth_op(qp, op, sess, msrc, mdst);
-		process_openssl_cipher_op(op, sess, msrc, mdst);
+		process_openssl_cipher_op(qp, op, sess, msrc, mdst);
 		break;
 	case OPENSSL_CHAIN_COMBINED:
-		process_openssl_combined_op(op, sess, msrc, mdst);
+		process_openssl_combined_op(qp, op, sess, msrc, mdst);
 		break;
 	case OPENSSL_CHAIN_CIPHER_BPI:
 		process_openssl_docsis_bpi_op(op, sess, msrc, mdst);
diff --git a/drivers/crypto/openssl/rte_openssl_pmd_ops.c b/drivers/crypto/openssl/rte_openssl_pmd_ops.c
index 24d6d48262..a448279029 100644
--- a/drivers/crypto/openssl/rte_openssl_pmd_ops.c
+++ b/drivers/crypto/openssl/rte_openssl_pmd_ops.c
@@ -777,9 +777,34 @@ qp_setup_cleanup:
 
 /** Returns the size of the symmetric session structure */
 static unsigned
-openssl_pmd_sym_session_get_size(struct rte_cryptodev *dev __rte_unused)
+openssl_pmd_sym_session_get_size(struct rte_cryptodev *dev)
 {
-	return sizeof(struct openssl_session);
+	/*
+	 * For 0 qps, return the max size of the session - this is necessary if
+	 * the user calls into this function to create the session mempool,
+	 * without first configuring the number of qps for the cryptodev.
+	 */
+	if (dev->data->nb_queue_pairs == 0) {
+		unsigned int max_nb_qps = ((struct openssl_private *)
+				dev->data->dev_private)->max_nb_qpairs;
+		return sizeof(struct openssl_session) +
+				(sizeof(void *) * max_nb_qps);
+	}
+
+	/*
+	 * With only one queue pair, the thread safety of multiple context
+	 * copies is not necessary, so don't allocate extra memory for the
+	 * array.
+	 */
+	if (dev->data->nb_queue_pairs == 1)
+		return sizeof(struct openssl_session);
+
+	/*
+	 * Otherwise, the size of the flexible array member should be enough to
+	 * fit pointers to per-qp contexts.
+	 */
+	return sizeof(struct openssl_session) +
+		(sizeof(void *) * dev->data->nb_queue_pairs);
 }
 
 /** Returns the size of the asymmetric session structure */
@@ -791,7 +816,7 @@ openssl_pmd_asym_session_get_size(struct rte_cryptodev *dev __rte_unused)
 
 /** Configure the session from a crypto xform chain */
 static int
-openssl_pmd_sym_session_configure(struct rte_cryptodev *dev __rte_unused,
+openssl_pmd_sym_session_configure(struct rte_cryptodev *dev,
 		struct rte_crypto_sym_xform *xform,
 		struct rte_cryptodev_sym_session *sess)
 {
@@ -803,7 +828,8 @@ openssl_pmd_sym_session_configure(struct rte_cryptodev *dev __rte_unused,
 		return -EINVAL;
 	}
 
-	ret = openssl_set_session_parameters(sess_private_data, xform);
+	ret = openssl_set_session_parameters(sess_private_data, xform,
+			dev->data->nb_queue_pairs);
 	if (ret != 0) {
 		OPENSSL_LOG(ERR, "failed configure session parameters");
 
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-15 16:19:35.745313284 +0100
+++ 0019-crypto-openssl-make-per-QP-cipher-context-clones.patch	2024-07-15 16:19:34.488204755 +0100
@@ -1 +1 @@
-From b1d71126023521fe740ec473abfe5b295035b859 Mon Sep 17 00:00:00 2001
+From 26e1e90724f9ab34120d25bba9a3cc47c9234540 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit b1d71126023521fe740ec473abfe5b295035b859 ]
+
@@ -38,2 +39,0 @@
-Cc: stable@dpdk.org
-
@@ -50 +50 @@
-index 0f038b218c..bad7dcf2f5 100644
+index 4e224b040b..810b539f10 100644
@@ -53 +53 @@
-@@ -166,6 +166,14 @@ struct __rte_cache_aligned openssl_session {
+@@ -165,6 +165,14 @@ struct openssl_session {
@@ -65 +65 @@
- };
+ } __rte_cache_aligned;
@@ -68 +68 @@
-@@ -217,7 +225,8 @@ struct __rte_cache_aligned openssl_asym_session {
+@@ -211,7 +219,8 @@ struct openssl_asym_session {
@@ -79 +79 @@
-index bd09d58d88..df44cc097e 100644
+index bfdcda8841..62a179b6b6 100644
@@ -82 +82 @@
-@@ -467,13 +467,10 @@ openssl_set_sess_aead_dec_param(struct openssl_session *sess,
+@@ -466,13 +466,10 @@ openssl_set_sess_aead_dec_param(struct openssl_session *sess,
@@ -97 +97 @@
-@@ -489,13 +486,8 @@ static int openssl_aesni_ctx_clone(EVP_CIPHER_CTX **dest,
+@@ -488,13 +485,8 @@ static int openssl_aesni_ctx_clone(EVP_CIPHER_CTX **dest,
@@ -112 +112 @@
-@@ -824,7 +816,8 @@ openssl_set_session_aead_parameters(struct openssl_session *sess,
+@@ -823,7 +815,8 @@ openssl_set_session_aead_parameters(struct openssl_session *sess,
@@ -122 +122 @@
-@@ -886,6 +879,12 @@ openssl_set_session_parameters(struct openssl_session *sess,
+@@ -885,6 +878,12 @@ openssl_set_session_parameters(struct openssl_session *sess,
@@ -135 +135 @@
-@@ -893,6 +892,13 @@ openssl_set_session_parameters(struct openssl_session *sess,
+@@ -892,6 +891,13 @@ openssl_set_session_parameters(struct openssl_session *sess,
@@ -149 +149 @@
-@@ -959,7 +965,7 @@ get_session(struct openssl_qp *qp, struct rte_crypto_op *op)
+@@ -958,7 +964,7 @@ get_session(struct openssl_qp *qp, struct rte_crypto_op *op)
@@ -158 +158 @@
-@@ -1607,11 +1613,45 @@ process_auth_err:
+@@ -1606,11 +1612,45 @@ process_auth_err:
@@ -207 +207 @@
-@@ -1628,11 +1668,7 @@ process_openssl_combined_op
+@@ -1627,11 +1667,7 @@ process_openssl_combined_op
@@ -220 +220 @@
-@@ -1688,8 +1724,6 @@ process_openssl_combined_op
+@@ -1687,8 +1723,6 @@ process_openssl_combined_op
@@ -229 +229 @@
-@@ -1702,14 +1736,13 @@ process_openssl_combined_op
+@@ -1701,14 +1735,13 @@ process_openssl_combined_op
@@ -247 +247 @@
-@@ -1728,24 +1761,22 @@ process_openssl_cipher_op
+@@ -1727,24 +1760,22 @@ process_openssl_cipher_op
@@ -277 +277 @@
-@@ -3150,13 +3181,13 @@ process_op(struct openssl_qp *qp, struct rte_crypto_op *op,
+@@ -2910,13 +2941,13 @@ process_op(struct openssl_qp *qp, struct rte_crypto_op *op,
@@ -293 +293 @@
-@@ -3164,10 +3195,10 @@ process_op(struct openssl_qp *qp, struct rte_crypto_op *op,
+@@ -2924,10 +2955,10 @@ process_op(struct openssl_qp *qp, struct rte_crypto_op *op,
@@ -307 +307 @@
-index b16baaa08f..4209c6ab6f 100644
+index 24d6d48262..a448279029 100644
@@ -310 +310 @@
-@@ -794,9 +794,34 @@ qp_setup_cleanup:
+@@ -777,9 +777,34 @@ qp_setup_cleanup:
@@ -347 +347 @@
-@@ -808,7 +833,7 @@ openssl_pmd_asym_session_get_size(struct rte_cryptodev *dev __rte_unused)
+@@ -791,7 +816,7 @@ openssl_pmd_asym_session_get_size(struct rte_cryptodev *dev __rte_unused)
@@ -356 +356 @@
-@@ -820,7 +845,8 @@ openssl_pmd_sym_session_configure(struct rte_cryptodev *dev __rte_unused,
+@@ -803,7 +828,8 @@ openssl_pmd_sym_session_configure(struct rte_cryptodev *dev __rte_unused,

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'crypto/openssl: make per-QP auth context clones' has been queued to stable release 22.11.6
  2024-07-15 15:25   ` patch 'config: fix warning for cross build with meson >= 1.3.0' " luca.boccassi
                       ` (17 preceding siblings ...)
  2024-07-15 15:25     ` patch 'crypto/openssl: make per-QP cipher context clones' " luca.boccassi
@ 2024-07-15 15:25     ` luca.boccassi
  2024-07-15 15:25     ` patch 'crypto/openssl: set cipher padding once' " luca.boccassi
                       ` (65 subsequent siblings)
  84 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-07-15 15:25 UTC (permalink / raw)
  To: Jack Bond-Preston; +Cc: Kai Ji, Wathsala Vithanage, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/ccb65683980ca885fa3b85420fee2d2434a96834

Thanks.

Luca Boccassi

---
From ccb65683980ca885fa3b85420fee2d2434a96834 Mon Sep 17 00:00:00 2001
From: Jack Bond-Preston <jack.bond-preston@foss.arm.com>
Date: Wed, 3 Jul 2024 13:45:50 +0000
Subject: [PATCH] crypto/openssl: make per-QP auth context clones

[ upstream commit 17d5bc6135afdb38ddf02595bfa15aa5142d80b1 ]

Currently EVP auth ctxs (e.g. EVP_MD_CTX, EVP_MAC_CTX) are allocated,
copied to (from openssl_session), and then freed for every auth
operation (ie. per packet). This is very inefficient, and avoidable.

Make each openssl_session hold an array of structures, containing
pointers to per-queue-pair cipher and auth context copies. These are
populated on first use by allocating a new context and copying from the
main context. These copies can then be used in a thread-safe manner by
different worker lcores simultaneously. Consequently the auth context
allocation and copy only has to happen once - the first time a given qp
uses an openssl_session. This brings about a large performance boost.

Throughput performance uplift measurements for HMAC-SHA1 generate on
Ampere Altra Max platform:
1 worker lcore
|   buffer sz (B) |   prev (Gbps) |   optimised (Gbps) |   uplift |
|-----------------+---------------+--------------------+----------|
|              64 |          0.63 |               1.42 |   123.5% |
|             256 |          2.24 |               4.40 |    96.4% |
|            1024 |          6.15 |               9.26 |    50.6% |
|            2048 |          8.68 |              11.38 |    31.1% |
|            4096 |         10.92 |              12.84 |    17.6% |

8 worker lcores
|   buffer sz (B) |   prev (Gbps) |   optimised (Gbps) |   uplift |
|-----------------+---------------+--------------------+----------|
|              64 |          0.93 |              11.35 |  1122.5% |
|             256 |          3.70 |              35.30 |   853.7% |
|            1024 |         15.22 |              74.27 |   387.8% |
|            2048 |         30.20 |              91.08 |   201.6% |
|            4096 |         56.92 |             102.76 |    80.5% |

Signed-off-by: Jack Bond-Preston <jack.bond-preston@foss.arm.com>
Acked-by: Kai Ji <kai.ji@intel.com>
Reviewed-by: Wathsala Vithanage <wathsala.vithanage@arm.com>
---
 drivers/crypto/openssl/compat.h              |  26 +++
 drivers/crypto/openssl/openssl_pmd_private.h |  25 ++-
 drivers/crypto/openssl/rte_openssl_pmd.c     | 190 +++++++++++++++----
 drivers/crypto/openssl/rte_openssl_pmd_ops.c |   7 +-
 4 files changed, 200 insertions(+), 48 deletions(-)

diff --git a/drivers/crypto/openssl/compat.h b/drivers/crypto/openssl/compat.h
index 9f9167c4f1..e1814fea8c 100644
--- a/drivers/crypto/openssl/compat.h
+++ b/drivers/crypto/openssl/compat.h
@@ -5,6 +5,32 @@
 #ifndef __RTA_COMPAT_H__
 #define __RTA_COMPAT_H__
 
+#if OPENSSL_VERSION_NUMBER >= 0x30000000L
+static __rte_always_inline void
+free_hmac_ctx(EVP_MAC_CTX *ctx)
+{
+	EVP_MAC_CTX_free(ctx);
+}
+
+static __rte_always_inline void
+free_cmac_ctx(EVP_MAC_CTX *ctx)
+{
+	EVP_MAC_CTX_free(ctx);
+}
+#else
+static __rte_always_inline void
+free_hmac_ctx(HMAC_CTX *ctx)
+{
+	HMAC_CTX_free(ctx);
+}
+
+static __rte_always_inline void
+free_cmac_ctx(CMAC_CTX *ctx)
+{
+	CMAC_CTX_free(ctx);
+}
+#endif
+
 #if (OPENSSL_VERSION_NUMBER < 0x10100000L)
 
 static __rte_always_inline int
diff --git a/drivers/crypto/openssl/openssl_pmd_private.h b/drivers/crypto/openssl/openssl_pmd_private.h
index 810b539f10..d67e39cddb 100644
--- a/drivers/crypto/openssl/openssl_pmd_private.h
+++ b/drivers/crypto/openssl/openssl_pmd_private.h
@@ -79,6 +79,20 @@ struct openssl_qp {
 	 */
 } __rte_cache_aligned;
 
+struct evp_ctx_pair {
+	EVP_CIPHER_CTX *cipher;
+	union {
+		EVP_MD_CTX *auth;
+#if OPENSSL_VERSION_NUMBER >= 0x30000000L
+		EVP_MAC_CTX *hmac;
+		EVP_MAC_CTX *cmac;
+#else
+		HMAC_CTX *hmac;
+		CMAC_CTX *cmac;
+#endif
+	};
+};
+
 /** OPENSSL crypto private session structure */
 struct openssl_session {
 	enum openssl_chain_order chain_order;
@@ -167,11 +181,12 @@ struct openssl_session {
 
 	uint16_t ctx_copies_len;
 	/* < number of entries in ctx_copies */
-	EVP_CIPHER_CTX *qp_ctx[];
-	/**< Flexible array member of per-queue-pair pointers to copies of EVP
-	 * context structure. Cipher contexts are not safe to use from multiple
-	 * cores simultaneously, so maintaining these copies allows avoiding
-	 * per-buffer copying into a temporary context.
+	struct evp_ctx_pair qp_ctx[];
+	/**< Flexible array member of per-queue-pair structures, each containing
+	 * pointers to copies of the cipher and auth EVP contexts. Cipher
+	 * contexts are not safe to use from multiple cores simultaneously, so
+	 * maintaining these copies allows avoiding per-buffer copying into a
+	 * temporary context.
 	 */
 } __rte_cache_aligned;
 
diff --git a/drivers/crypto/openssl/rte_openssl_pmd.c b/drivers/crypto/openssl/rte_openssl_pmd.c
index 62a179b6b6..72db0fd40f 100644
--- a/drivers/crypto/openssl/rte_openssl_pmd.c
+++ b/drivers/crypto/openssl/rte_openssl_pmd.c
@@ -891,40 +891,45 @@ openssl_set_session_parameters(struct openssl_session *sess,
 void
 openssl_reset_session(struct openssl_session *sess)
 {
+	/* Free all the qp_ctx entries. */
 	for (uint16_t i = 0; i < sess->ctx_copies_len; i++) {
-		if (sess->qp_ctx[i] != NULL) {
-			EVP_CIPHER_CTX_free(sess->qp_ctx[i]);
-			sess->qp_ctx[i] = NULL;
+		if (sess->qp_ctx[i].cipher != NULL) {
+			EVP_CIPHER_CTX_free(sess->qp_ctx[i].cipher);
+			sess->qp_ctx[i].cipher = NULL;
+		}
+
+		switch (sess->auth.mode) {
+		case OPENSSL_AUTH_AS_AUTH:
+			EVP_MD_CTX_destroy(sess->qp_ctx[i].auth);
+			sess->qp_ctx[i].auth = NULL;
+			break;
+		case OPENSSL_AUTH_AS_HMAC:
+			free_hmac_ctx(sess->qp_ctx[i].hmac);
+			sess->qp_ctx[i].hmac = NULL;
+			break;
+		case OPENSSL_AUTH_AS_CMAC:
+			free_cmac_ctx(sess->qp_ctx[i].cmac);
+			sess->qp_ctx[i].cmac = NULL;
+			break;
 		}
 	}
 
 	EVP_CIPHER_CTX_free(sess->cipher.ctx);
 
+	switch (sess->auth.mode) {
+	case OPENSSL_AUTH_AS_AUTH:
+		EVP_MD_CTX_destroy(sess->auth.auth.ctx);
+		break;
+	case OPENSSL_AUTH_AS_HMAC:
+		free_hmac_ctx(sess->auth.hmac.ctx);
+		break;
+	case OPENSSL_AUTH_AS_CMAC:
+		free_cmac_ctx(sess->auth.cmac.ctx);
+		break;
+	}
+
 	if (sess->chain_order == OPENSSL_CHAIN_CIPHER_BPI)
 		EVP_CIPHER_CTX_free(sess->cipher.bpi_ctx);
-
-	switch (sess->auth.mode) {
-	case OPENSSL_AUTH_AS_AUTH:
-		EVP_MD_CTX_destroy(sess->auth.auth.ctx);
-		break;
-	case OPENSSL_AUTH_AS_HMAC:
-		EVP_PKEY_free(sess->auth.hmac.pkey);
-# if OPENSSL_VERSION_NUMBER >= 0x30000000L
-		EVP_MAC_CTX_free(sess->auth.hmac.ctx);
-# else
-		HMAC_CTX_free(sess->auth.hmac.ctx);
-# endif
-		break;
-	case OPENSSL_AUTH_AS_CMAC:
-# if OPENSSL_VERSION_NUMBER >= 0x30000000L
-		EVP_MAC_CTX_free(sess->auth.cmac.ctx);
-# else
-		CMAC_CTX_free(sess->auth.cmac.ctx);
-# endif
-		break;
-	default:
-		break;
-	}
 }
 
 /** Provide session for operation */
@@ -1470,6 +1475,9 @@ process_openssl_auth_mac(struct rte_mbuf *mbuf_src, uint8_t *dst, int offset,
 	if (m == 0)
 		goto process_auth_err;
 
+	if (EVP_MAC_init(ctx, NULL, 0, NULL) <= 0)
+		goto process_auth_err;
+
 	src = rte_pktmbuf_mtod_offset(m, uint8_t *, offset);
 
 	l = rte_pktmbuf_data_len(m) - offset;
@@ -1496,11 +1504,9 @@ process_auth_final:
 	if (EVP_MAC_final(ctx, dst, &dstlen, DIGEST_LENGTH_MAX) != 1)
 		goto process_auth_err;
 
-	EVP_MAC_CTX_free(ctx);
 	return 0;
 
 process_auth_err:
-	EVP_MAC_CTX_free(ctx);
 	OPENSSL_LOG(ERR, "Process openssl auth failed");
 	return -EINVAL;
 }
@@ -1619,7 +1625,7 @@ get_local_cipher_ctx(struct openssl_session *sess, struct openssl_qp *qp)
 	if (sess->ctx_copies_len == 0)
 		return sess->cipher.ctx;
 
-	EVP_CIPHER_CTX **lctx = &sess->qp_ctx[qp->id];
+	EVP_CIPHER_CTX **lctx = &sess->qp_ctx[qp->id].cipher;
 
 	if (unlikely(*lctx == NULL)) {
 #if OPENSSL_VERSION_NUMBER >= 0x30200000L
@@ -1646,6 +1652,112 @@ get_local_cipher_ctx(struct openssl_session *sess, struct openssl_qp *qp)
 	return *lctx;
 }
 
+static inline EVP_MD_CTX *
+get_local_auth_ctx(struct openssl_session *sess, struct openssl_qp *qp)
+{
+	/* If the array is not being used, just return the main context. */
+	if (sess->ctx_copies_len == 0)
+		return sess->auth.auth.ctx;
+
+	EVP_MD_CTX **lctx = &sess->qp_ctx[qp->id].auth;
+
+	if (unlikely(*lctx == NULL)) {
+#if OPENSSL_VERSION_NUMBER >= 0x30100000L
+		/* EVP_MD_CTX_dup() added in OSSL 3.1 */
+		*lctx = EVP_MD_CTX_dup(sess->auth.auth.ctx);
+#else
+		*lctx = EVP_MD_CTX_new();
+		EVP_MD_CTX_copy(*lctx, sess->auth.auth.ctx);
+#endif
+	}
+
+	return *lctx;
+}
+
+#if OPENSSL_VERSION_NUMBER >= 0x30000000L
+static inline EVP_MAC_CTX *
+#else
+static inline HMAC_CTX *
+#endif
+get_local_hmac_ctx(struct openssl_session *sess, struct openssl_qp *qp)
+{
+#if (OPENSSL_VERSION_NUMBER >= 0x30000000L && OPENSSL_VERSION_NUMBER < 0x30003000L)
+	/* For OpenSSL versions 3.0.0 <= v < 3.0.3, re-initing of
+	 * EVP_MAC_CTXs is broken, and doesn't actually reset their
+	 * state. This was fixed in OSSL commit c9ddc5af5199 ("Avoid
+	 * undefined behavior of provided macs on EVP_MAC
+	 * reinitialization"). In cases where the fix is not present,
+	 * fall back to duplicating the context every buffer as a
+	 * workaround, at the cost of performance.
+	 */
+	RTE_SET_USED(qp);
+	return EVP_MAC_CTX_dup(sess->auth.hmac.ctx);
+#else
+	if (sess->ctx_copies_len == 0)
+		return sess->auth.hmac.ctx;
+
+#if OPENSSL_VERSION_NUMBER >= 0x30000000L
+	EVP_MAC_CTX **lctx =
+#else
+	HMAC_CTX **lctx =
+#endif
+		&sess->qp_ctx[qp->id].hmac;
+
+	if (unlikely(*lctx == NULL)) {
+#if OPENSSL_VERSION_NUMBER >= 0x30000000L
+		*lctx = EVP_MAC_CTX_dup(sess->auth.hmac.ctx);
+#else
+		*lctx = HMAC_CTX_new();
+		HMAC_CTX_copy(*lctx, sess->auth.hmac.ctx);
+#endif
+	}
+
+	return *lctx;
+#endif
+}
+
+#if OPENSSL_VERSION_NUMBER >= 0x30000000L
+static inline EVP_MAC_CTX *
+#else
+static inline CMAC_CTX *
+#endif
+get_local_cmac_ctx(struct openssl_session *sess, struct openssl_qp *qp)
+{
+#if (OPENSSL_VERSION_NUMBER >= 0x30000000L && OPENSSL_VERSION_NUMBER < 0x30003000L)
+	/* For OpenSSL versions 3.0.0 <= v < 3.0.3, re-initing of
+	 * EVP_MAC_CTXs is broken, and doesn't actually reset their
+	 * state. This was fixed in OSSL commit c9ddc5af5199 ("Avoid
+	 * undefined behavior of provided macs on EVP_MAC
+	 * reinitialization"). In cases where the fix is not present,
+	 * fall back to duplicating the context every buffer as a
+	 * workaround, at the cost of performance.
+	 */
+	RTE_SET_USED(qp);
+	return EVP_MAC_CTX_dup(sess->auth.cmac.ctx);
+#else
+	if (sess->ctx_copies_len == 0)
+		return sess->auth.cmac.ctx;
+
+#if OPENSSL_VERSION_NUMBER >= 0x30000000L
+	EVP_MAC_CTX **lctx =
+#else
+	CMAC_CTX **lctx =
+#endif
+		&sess->qp_ctx[qp->id].cmac;
+
+	if (unlikely(*lctx == NULL)) {
+#if OPENSSL_VERSION_NUMBER >= 0x30000000L
+		*lctx = EVP_MAC_CTX_dup(sess->auth.cmac.ctx);
+#else
+		*lctx = CMAC_CTX_new();
+		CMAC_CTX_copy(*lctx, sess->auth.cmac.ctx);
+#endif
+	}
+
+	return *lctx;
+#endif
+}
+
 /** Process auth/cipher combined operation */
 static void
 process_openssl_combined_op(struct openssl_qp *qp, struct rte_crypto_op *op,
@@ -1894,42 +2006,40 @@ process_openssl_auth_op(struct openssl_qp *qp, struct rte_crypto_op *op,
 
 	switch (sess->auth.mode) {
 	case OPENSSL_AUTH_AS_AUTH:
-		ctx_a = EVP_MD_CTX_create();
-		EVP_MD_CTX_copy_ex(ctx_a, sess->auth.auth.ctx);
+		ctx_a = get_local_auth_ctx(sess, qp);
 		status = process_openssl_auth(mbuf_src, dst,
 				op->sym->auth.data.offset, NULL, NULL, srclen,
 				ctx_a, sess->auth.auth.evp_algo);
-		EVP_MD_CTX_destroy(ctx_a);
 		break;
 	case OPENSSL_AUTH_AS_HMAC:
+		ctx_h = get_local_hmac_ctx(sess, qp);
 # if OPENSSL_VERSION_NUMBER >= 0x30000000L
-		ctx_h = EVP_MAC_CTX_dup(sess->auth.hmac.ctx);
 		status = process_openssl_auth_mac(mbuf_src, dst,
 				op->sym->auth.data.offset, srclen,
 				ctx_h);
 # else
-		ctx_h = HMAC_CTX_new();
-		HMAC_CTX_copy(ctx_h, sess->auth.hmac.ctx);
 		status = process_openssl_auth_hmac(mbuf_src, dst,
 				op->sym->auth.data.offset, srclen,
 				ctx_h);
-		HMAC_CTX_free(ctx_h);
 # endif
+#if (OPENSSL_VERSION_NUMBER >= 0x30000000L && OPENSSL_VERSION_NUMBER < 0x30003000L)
+		EVP_MAC_CTX_free(ctx_h);
+#endif
 		break;
 	case OPENSSL_AUTH_AS_CMAC:
+		ctx_c = get_local_cmac_ctx(sess, qp);
 # if OPENSSL_VERSION_NUMBER >= 0x30000000L
-		ctx_c = EVP_MAC_CTX_dup(sess->auth.cmac.ctx);
 		status = process_openssl_auth_mac(mbuf_src, dst,
 				op->sym->auth.data.offset, srclen,
 				ctx_c);
 # else
-		ctx_c = CMAC_CTX_new();
-		CMAC_CTX_copy(ctx_c, sess->auth.cmac.ctx);
 		status = process_openssl_auth_cmac(mbuf_src, dst,
 				op->sym->auth.data.offset, srclen,
 				ctx_c);
-		CMAC_CTX_free(ctx_c);
 # endif
+#if (OPENSSL_VERSION_NUMBER >= 0x30000000L && OPENSSL_VERSION_NUMBER < 0x30003000L)
+		EVP_MAC_CTX_free(ctx_c);
+#endif
 		break;
 	default:
 		status = -1;
diff --git a/drivers/crypto/openssl/rte_openssl_pmd_ops.c b/drivers/crypto/openssl/rte_openssl_pmd_ops.c
index a448279029..18a8095ba2 100644
--- a/drivers/crypto/openssl/rte_openssl_pmd_ops.c
+++ b/drivers/crypto/openssl/rte_openssl_pmd_ops.c
@@ -788,7 +788,7 @@ openssl_pmd_sym_session_get_size(struct rte_cryptodev *dev)
 		unsigned int max_nb_qps = ((struct openssl_private *)
 				dev->data->dev_private)->max_nb_qpairs;
 		return sizeof(struct openssl_session) +
-				(sizeof(void *) * max_nb_qps);
+				(sizeof(struct evp_ctx_pair) * max_nb_qps);
 	}
 
 	/*
@@ -801,10 +801,11 @@ openssl_pmd_sym_session_get_size(struct rte_cryptodev *dev)
 
 	/*
 	 * Otherwise, the size of the flexible array member should be enough to
-	 * fit pointers to per-qp contexts.
+	 * fit pointers to per-qp contexts. This is twice the number of queue
+	 * pairs, to allow for auth and cipher contexts.
 	 */
 	return sizeof(struct openssl_session) +
-		(sizeof(void *) * dev->data->nb_queue_pairs);
+		(sizeof(struct evp_ctx_pair) * dev->data->nb_queue_pairs);
 }
 
 /** Returns the size of the asymmetric session structure */
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-15 16:19:35.790373889 +0100
+++ 0020-crypto-openssl-make-per-QP-auth-context-clones.patch	2024-07-15 16:19:34.492204841 +0100
@@ -1 +1 @@
-From 17d5bc6135afdb38ddf02595bfa15aa5142d80b1 Mon Sep 17 00:00:00 2001
+From ccb65683980ca885fa3b85420fee2d2434a96834 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 17d5bc6135afdb38ddf02595bfa15aa5142d80b1 ]
+
@@ -38,2 +39,0 @@
-Cc: stable@dpdk.org
-
@@ -88 +88 @@
-index bad7dcf2f5..a50e4d4918 100644
+index 810b539f10..d67e39cddb 100644
@@ -91 +91 @@
-@@ -80,6 +80,20 @@ struct __rte_cache_aligned openssl_qp {
+@@ -79,6 +79,20 @@ struct openssl_qp {
@@ -93 +93 @@
- };
+ } __rte_cache_aligned;
@@ -110 +110 @@
- struct __rte_cache_aligned openssl_session {
+ struct openssl_session {
@@ -112 +112 @@
-@@ -168,11 +182,12 @@ struct __rte_cache_aligned openssl_session {
+@@ -167,11 +181,12 @@ struct openssl_session {
@@ -128 +128 @@
- };
+ } __rte_cache_aligned;
@@ -131 +131 @@
-index df44cc097e..7e2e505222 100644
+index 62a179b6b6..72db0fd40f 100644
@@ -134 +134 @@
-@@ -892,40 +892,45 @@ openssl_set_session_parameters(struct openssl_session *sess,
+@@ -891,40 +891,45 @@ openssl_set_session_parameters(struct openssl_session *sess,
@@ -206 +206 @@
-@@ -1471,6 +1476,9 @@ process_openssl_auth_mac(struct rte_mbuf *mbuf_src, uint8_t *dst, int offset,
+@@ -1470,6 +1475,9 @@ process_openssl_auth_mac(struct rte_mbuf *mbuf_src, uint8_t *dst, int offset,
@@ -216 +216 @@
-@@ -1497,11 +1505,9 @@ process_auth_final:
+@@ -1496,11 +1504,9 @@ process_auth_final:
@@ -228 +228 @@
-@@ -1620,7 +1626,7 @@ get_local_cipher_ctx(struct openssl_session *sess, struct openssl_qp *qp)
+@@ -1619,7 +1625,7 @@ get_local_cipher_ctx(struct openssl_session *sess, struct openssl_qp *qp)
@@ -237 +237 @@
-@@ -1647,6 +1653,112 @@ get_local_cipher_ctx(struct openssl_session *sess, struct openssl_qp *qp)
+@@ -1646,6 +1652,112 @@ get_local_cipher_ctx(struct openssl_session *sess, struct openssl_qp *qp)
@@ -350 +350 @@
-@@ -1895,42 +2007,40 @@ process_openssl_auth_op(struct openssl_qp *qp, struct rte_crypto_op *op,
+@@ -1894,42 +2006,40 @@ process_openssl_auth_op(struct openssl_qp *qp, struct rte_crypto_op *op,
@@ -403 +403 @@
-index 4209c6ab6f..1bbb855a59 100644
+index a448279029..18a8095ba2 100644
@@ -406 +406 @@
-@@ -805,7 +805,7 @@ openssl_pmd_sym_session_get_size(struct rte_cryptodev *dev)
+@@ -788,7 +788,7 @@ openssl_pmd_sym_session_get_size(struct rte_cryptodev *dev)
@@ -415 +415 @@
-@@ -818,10 +818,11 @@ openssl_pmd_sym_session_get_size(struct rte_cryptodev *dev)
+@@ -801,10 +801,11 @@ openssl_pmd_sym_session_get_size(struct rte_cryptodev *dev)

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'crypto/openssl: set cipher padding once' has been queued to stable release 22.11.6
  2024-07-15 15:25   ` patch 'config: fix warning for cross build with meson >= 1.3.0' " luca.boccassi
                       ` (18 preceding siblings ...)
  2024-07-15 15:25     ` patch 'crypto/openssl: make per-QP auth " luca.boccassi
@ 2024-07-15 15:25     ` luca.boccassi
  2024-07-15 15:26     ` patch 'common/dpaax/caamflib: fix PDCP-SDAP watchdog error' " luca.boccassi
                       ` (64 subsequent siblings)
  84 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-07-15 15:25 UTC (permalink / raw)
  To: Jack Bond-Preston; +Cc: Kai Ji, Wathsala Vithanage, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/d0aee3876f98d0da3fb7f35eea208fc91c7a5cf2

Thanks.

Luca Boccassi

---
From d0aee3876f98d0da3fb7f35eea208fc91c7a5cf2 Mon Sep 17 00:00:00 2001
From: Jack Bond-Preston <jack.bond-preston@foss.arm.com>
Date: Wed, 3 Jul 2024 13:45:51 +0000
Subject: [PATCH] crypto/openssl: set cipher padding once

[ upstream commit d2bf59017315dc18eb6c9f2d7acd10dfb8d7758e ]

Setting the cipher padding has a noticeable performance footprint,
and it doesn't need to be done for every call to
process_openssl_cipher_{en,de}crypt(). Setting it causes OpenSSL to set
it on every future context re-init. Thus, for every buffer after the
first one, the padding is being set twice.

Instead, just set the cipher padding once - when configuring the session
parameters - avoiding the unnecessary double setting behaviour. This is
skipped for AEAD ciphers, where disabling padding is not necessary.

Throughput performance uplift measurements for AES-CBC-128 encrypt on
Ampere Altra Max platform:
1 worker lcore
|   buffer sz (B) |   prev (Gbps) |   optimised (Gbps) |   uplift |
|-----------------+---------------+--------------------+----------|
|              64 |          2.97 |               3.72 |    25.2% |
|             256 |          8.10 |               9.42 |    16.3% |
|            1024 |         14.22 |              15.18 |     6.8% |
|            2048 |         16.28 |              16.93 |     4.0% |
|            4096 |         17.58 |              17.97 |     2.2% |

8 worker lcores
|   buffer sz (B) |   prev (Gbps) |   optimised (Gbps) |   uplift |
|-----------------+---------------+--------------------+----------|
|              64 |         21.27 |              29.85 |    40.3% |
|             256 |         60.05 |              75.53 |    25.8% |
|            1024 |        110.11 |             121.56 |    10.4% |
|            2048 |        128.05 |             135.40 |     5.7% |
|            4096 |        139.45 |             143.76 |     3.1% |

Signed-off-by: Jack Bond-Preston <jack.bond-preston@foss.arm.com>
Acked-by: Kai Ji <kai.ji@intel.com>
Reviewed-by: Wathsala Vithanage <wathsala.vithanage@arm.com>
---
 drivers/crypto/openssl/rte_openssl_pmd.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/crypto/openssl/rte_openssl_pmd.c b/drivers/crypto/openssl/rte_openssl_pmd.c
index 72db0fd40f..9fc8194366 100644
--- a/drivers/crypto/openssl/rte_openssl_pmd.c
+++ b/drivers/crypto/openssl/rte_openssl_pmd.c
@@ -618,6 +618,8 @@ openssl_set_session_cipher_parameters(struct openssl_session *sess,
 		return -ENOTSUP;
 	}
 
+	EVP_CIPHER_CTX_set_padding(sess->cipher.ctx, 0);
+
 	return 0;
 }
 
@@ -1123,8 +1125,6 @@ process_openssl_cipher_encrypt(struct rte_mbuf *mbuf_src, uint8_t *dst,
 	if (EVP_EncryptInit_ex(ctx, NULL, NULL, NULL, iv) <= 0)
 		goto process_cipher_encrypt_err;
 
-	EVP_CIPHER_CTX_set_padding(ctx, 0);
-
 	if (process_openssl_encryption_update(mbuf_src, offset, &dst,
 			srclen, ctx, inplace))
 		goto process_cipher_encrypt_err;
@@ -1173,8 +1173,6 @@ process_openssl_cipher_decrypt(struct rte_mbuf *mbuf_src, uint8_t *dst,
 	if (EVP_DecryptInit_ex(ctx, NULL, NULL, NULL, iv) <= 0)
 		goto process_cipher_decrypt_err;
 
-	EVP_CIPHER_CTX_set_padding(ctx, 0);
-
 	if (process_openssl_decryption_update(mbuf_src, offset, &dst,
 			srclen, ctx, inplace))
 		goto process_cipher_decrypt_err;
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-15 16:19:35.836107340 +0100
+++ 0021-crypto-openssl-set-cipher-padding-once.patch	2024-07-15 16:19:34.492204841 +0100
@@ -1 +1 @@
-From d2bf59017315dc18eb6c9f2d7acd10dfb8d7758e Mon Sep 17 00:00:00 2001
+From d0aee3876f98d0da3fb7f35eea208fc91c7a5cf2 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit d2bf59017315dc18eb6c9f2d7acd10dfb8d7758e ]
+
@@ -36,2 +37,0 @@
-Cc: stable@dpdk.org
-
@@ -46 +46 @@
-index 7e2e505222..101111e85b 100644
+index 72db0fd40f..9fc8194366 100644
@@ -49 +49 @@
-@@ -619,6 +619,8 @@ openssl_set_session_cipher_parameters(struct openssl_session *sess,
+@@ -618,6 +618,8 @@ openssl_set_session_cipher_parameters(struct openssl_session *sess,
@@ -58 +58 @@
-@@ -1124,8 +1126,6 @@ process_openssl_cipher_encrypt(struct rte_mbuf *mbuf_src, uint8_t *dst,
+@@ -1123,8 +1125,6 @@ process_openssl_cipher_encrypt(struct rte_mbuf *mbuf_src, uint8_t *dst,
@@ -67 +67 @@
-@@ -1174,8 +1174,6 @@ process_openssl_cipher_decrypt(struct rte_mbuf *mbuf_src, uint8_t *dst,
+@@ -1173,8 +1173,6 @@ process_openssl_cipher_decrypt(struct rte_mbuf *mbuf_src, uint8_t *dst,

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'common/dpaax/caamflib: fix PDCP-SDAP watchdog error' has been queued to stable release 22.11.6
  2024-07-15 15:25   ` patch 'config: fix warning for cross build with meson >= 1.3.0' " luca.boccassi
                       ` (19 preceding siblings ...)
  2024-07-15 15:25     ` patch 'crypto/openssl: set cipher padding once' " luca.boccassi
@ 2024-07-15 15:26     ` luca.boccassi
  2024-07-15 15:26     ` patch 'common/dpaax/caamflib: fix PDCP AES-AES " luca.boccassi
                       ` (63 subsequent siblings)
  84 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-07-15 15:26 UTC (permalink / raw)
  To: Gagandeep Singh; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/09ca25c2931d2860c9533d298230768dfee2a03a

Thanks.

Luca Boccassi

---
From 09ca25c2931d2860c9533d298230768dfee2a03a Mon Sep 17 00:00:00 2001
From: Gagandeep Singh <g.singh@nxp.com>
Date: Wed, 3 Jul 2024 15:56:39 +0530
Subject: [PATCH] common/dpaax/caamflib: fix PDCP-SDAP watchdog error

[ upstream commit 6671e82e5c6b4858573f4dae665e7f2442913d93 ]

Adding a Jump instruction with CALM flag to ensure
previous processing has been completed.

Fixes: 3ba2e519eafa ("common/dpaax/caamflib: support PDCP-SDAP")

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
---
 drivers/common/dpaax/caamflib/desc/sdap.h | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/common/dpaax/caamflib/desc/sdap.h b/drivers/common/dpaax/caamflib/desc/sdap.h
index b38c15a24f..d41bacf8f9 100644
--- a/drivers/common/dpaax/caamflib/desc/sdap.h
+++ b/drivers/common/dpaax/caamflib/desc/sdap.h
@@ -1,5 +1,5 @@
 /* SPDX-License-Identifier: BSD-3-Clause
- * Copyright 2020-2022 NXP
+ * Copyright 2020-2023 NXP
  */
 
 #ifndef __DESC_SDAP_H__
@@ -628,6 +628,10 @@ static inline int pdcp_sdap_insert_no_snoop_op(
 		/* Save the ICV generated */
 		MOVEB(p, CONTEXT1, 0, MATH3, 0, 4, WAITCOMP | IMMED);
 
+		/* conditional jump with calm added to ensure that the
+		 * previous processing has been completed
+		 */
+		JUMP(p, 1, LOCAL_JUMP, ALL_TRUE, CALM);
 		/* The CHA will be reused so we need to clear it */
 		LOAD(p, CLRW_RESET_CLS1_CHA |
 		     CLRW_CLR_C1KEY |
@@ -718,6 +722,10 @@ static inline int pdcp_sdap_insert_no_snoop_op(
 		/* Save the ICV which is stalling in output FIFO to MATH3 */
 		MOVEB(p, OFIFO, 0, MATH3, 0, 4, IMMED);
 
+		/* conditional jump with calm added to ensure that the
+		 * previous processing has been completed
+		 */
+		JUMP(p, 1, LOCAL_JUMP, ALL_TRUE, CALM);
 		/* Reset class 1 CHA */
 		LOAD(p, CLRW_RESET_CLS1_CHA |
 		     CLRW_CLR_C1KEY |
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-15 16:19:35.880050277 +0100
+++ 0022-common-dpaax-caamflib-fix-PDCP-SDAP-watchdog-error.patch	2024-07-15 16:19:34.496204926 +0100
@@ -1 +1 @@
-From 6671e82e5c6b4858573f4dae665e7f2442913d93 Mon Sep 17 00:00:00 2001
+From 09ca25c2931d2860c9533d298230768dfee2a03a Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 6671e82e5c6b4858573f4dae665e7f2442913d93 ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'common/dpaax/caamflib: fix PDCP AES-AES watchdog error' has been queued to stable release 22.11.6
  2024-07-15 15:25   ` patch 'config: fix warning for cross build with meson >= 1.3.0' " luca.boccassi
                       ` (20 preceding siblings ...)
  2024-07-15 15:26     ` patch 'common/dpaax/caamflib: fix PDCP-SDAP watchdog error' " luca.boccassi
@ 2024-07-15 15:26     ` luca.boccassi
  2024-07-15 15:26     ` patch 'crypto/dpaa_sec: fix IPsec descriptor' " luca.boccassi
                       ` (62 subsequent siblings)
  84 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-07-15 15:26 UTC (permalink / raw)
  To: Varun Sethi; +Cc: Gagandeep Singh, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/6182babbe7ba38a0da6482c5573a69513771faba

Thanks.

Luca Boccassi

---
From 6182babbe7ba38a0da6482c5573a69513771faba Mon Sep 17 00:00:00 2001
From: Varun Sethi <v.sethi@nxp.com>
Date: Wed, 3 Jul 2024 15:56:40 +0530
Subject: [PATCH] common/dpaax/caamflib: fix PDCP AES-AES watchdog error

[ upstream commit ed5ea9e3e7f30cb8d7b45035a40ab75efaa38584 ]

Adding a Jump instruction with CALM flag to ensure
previous processing has been completed.

Fixes: 8827d94398f1 ("crypto/dpaa2_sec/hw: support AES-AES 18-bit PDCP")

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Signed-off-by: Varun Sethi <v.sethi@nxp.com>
---
 .mailmap                                  |  1 +
 drivers/common/dpaax/caamflib/desc/pdcp.h | 10 ++++++++++
 2 files changed, 11 insertions(+)

diff --git a/.mailmap b/.mailmap
index 5941400f42..0798312a63 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1418,6 +1418,7 @@ Vadim Suraev <vadim.suraev@gmail.com>
 Vakul Garg <vakul.garg@nxp.com>
 Vamsi Attunuru <vattunuru@marvell.com>
 Vanshika Shukla <vanshika.shukla@nxp.com>
+Varun Sethi <v.sethi@nxp.com>
 Vasily Philipov <vasilyf@mellanox.com>
 Veerasenareddy Burru <vburru@marvell.com>
 Venkata Suresh Kumar P <venkata.suresh.kumar.p@intel.com>
diff --git a/drivers/common/dpaax/caamflib/desc/pdcp.h b/drivers/common/dpaax/caamflib/desc/pdcp.h
index 289ee2a7d5..070cad0147 100644
--- a/drivers/common/dpaax/caamflib/desc/pdcp.h
+++ b/drivers/common/dpaax/caamflib/desc/pdcp.h
@@ -1023,6 +1023,11 @@ pdcp_insert_uplane_aes_aes_op(struct program *p,
 		SEQFIFOLOAD(p, MSG1, 0, VLF | LAST1 | FLUSH1);
 		MOVEB(p, CONTEXT1, 0, MATH3, 0, 4, WAITCOMP | IMMED);
 
+		/* conditional jump with calm added to ensure that the
+		 * previous processing has been completed
+		 */
+		JUMP(p, 1, LOCAL_JUMP, ALL_TRUE, CALM);
+
 		LOAD(p, CLRW_RESET_CLS1_CHA |
 		     CLRW_CLR_C1KEY |
 		     CLRW_CLR_C1CTX |
@@ -1070,6 +1075,11 @@ pdcp_insert_uplane_aes_aes_op(struct program *p,
 
 		MOVEB(p, OFIFO, 0, MATH3, 0, 4, IMMED);
 
+		/* conditional jump with calm added to ensure that the
+		 * previous processing has been completed
+		 */
+		JUMP(p, 1, LOCAL_JUMP, ALL_TRUE, CALM);
+
 		LOAD(p, CLRW_RESET_CLS1_CHA |
 		     CLRW_CLR_C1KEY |
 		     CLRW_CLR_C1CTX |
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-15 16:19:35.923678443 +0100
+++ 0023-common-dpaax-caamflib-fix-PDCP-AES-AES-watchdog-erro.patch	2024-07-15 16:19:34.500205011 +0100
@@ -1 +1 @@
-From ed5ea9e3e7f30cb8d7b45035a40ab75efaa38584 Mon Sep 17 00:00:00 2001
+From 6182babbe7ba38a0da6482c5573a69513771faba Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit ed5ea9e3e7f30cb8d7b45035a40ab75efaa38584 ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -20 +21 @@
-index 502791e0bc..74739ec9be 100644
+index 5941400f42..0798312a63 100644
@@ -23 +24,2 @@
-@@ -1503,6 +1503,7 @@ Vakul Garg <vakul.garg@nxp.com>
+@@ -1418,6 +1418,7 @@ Vadim Suraev <vadim.suraev@gmail.com>
+ Vakul Garg <vakul.garg@nxp.com>
@@ -25 +26,0 @@
- Vamsi Krishna Atluri <vamsi.atluri@amd.com>
@@ -32 +33 @@
-index 7d16c66d79..0ed9eec816 100644
+index 289ee2a7d5..070cad0147 100644

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'crypto/dpaa_sec: fix IPsec descriptor' has been queued to stable release 22.11.6
  2024-07-15 15:25   ` patch 'config: fix warning for cross build with meson >= 1.3.0' " luca.boccassi
                       ` (21 preceding siblings ...)
  2024-07-15 15:26     ` patch 'common/dpaax/caamflib: fix PDCP AES-AES " luca.boccassi
@ 2024-07-15 15:26     ` luca.boccassi
  2024-07-15 15:26     ` patch 'crypto/dpaa2_sec: fix event queue user context' " luca.boccassi
                       ` (61 subsequent siblings)
  84 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-07-15 15:26 UTC (permalink / raw)
  To: Gagandeep Singh; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/ac47aa31a1b2330b2c3dc5de71850826e2cf26fe

Thanks.

Luca Boccassi

---
From ac47aa31a1b2330b2c3dc5de71850826e2cf26fe Mon Sep 17 00:00:00 2001
From: Gagandeep Singh <g.singh@nxp.com>
Date: Wed, 3 Jul 2024 15:56:41 +0530
Subject: [PATCH] crypto/dpaa_sec: fix IPsec descriptor

[ upstream commit 046341575bd6e1210d6c12b595405ede41150da7 ]

During IPsec operations, driver code pre-check
whether KEYS can be inlined to limited size descriptor
or not and based on that it decides to copy the complete
KEY in descriptor or just give the memory pointer of
KEY in descriptor.
This pre-check code does not take care of padding required
for security engine to make the KEYs inline which results
in incorrect length descriptor for some algorithms.

This patch fixes this issue by updating the pre-check code
with proper padding size included for each supported
algorithm.

Fixes: 453b9593a3cf ("crypto/dpaax_sec: fix inline query for descriptors")

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
---
 drivers/common/dpaax/caamflib/desc/ipsec.h | 68 ++++++++++++++++++++++
 drivers/crypto/dpaa_sec/dpaa_sec.c         |  4 +-
 2 files changed, 70 insertions(+), 2 deletions(-)

diff --git a/drivers/common/dpaax/caamflib/desc/ipsec.h b/drivers/common/dpaax/caamflib/desc/ipsec.h
index 8ec6aac915..26bf52827e 100644
--- a/drivers/common/dpaax/caamflib/desc/ipsec.h
+++ b/drivers/common/dpaax/caamflib/desc/ipsec.h
@@ -726,6 +726,74 @@ static inline void __gen_auth_key(struct program *program,
 			     authdata->key, authdata->key_type);
 }
 
+/**
+ * rta_inline_ipsec_query() - Provide indications on which data items can be inlined
+ *                      and which shall be referenced in IPsec shared descriptor.
+ * @sd_base_len: Shared descriptor base length - bytes consumed by the commands,
+ *               excluding the data items to be inlined (or corresponding
+ *               pointer if an item is not inlined). Each cnstr_* function that
+ *               generates descriptors should have a define mentioning
+ *               corresponding length.
+ * @jd_len: Maximum length of the job descriptor(s) that will be used
+ *          together with the shared descriptor.
+ * @data_len: Array of lengths of the data items trying to be inlined
+ * @inl_mask: 32bit mask with bit x = 1 if data item x can be inlined, 0
+ *            otherwise.
+ * @count: Number of data items (size of @data_len array); must be <= 32
+ * @auth_algtype: Authentication algorithm type.
+ * @auth_index: Index value of data_len for authentication key length.
+ *		-1 if authentication key length is not present in data_len.
+ *
+ * Return: 0 if data can be inlined / referenced, negative value if not. If 0,
+ *         check @inl_mask for details.
+ */
+static inline int
+rta_inline_ipsec_query(unsigned int sd_base_len,
+		       unsigned int jd_len,
+		       unsigned int *data_len,
+		       uint32_t *inl_mask,
+		       unsigned int count,
+		       uint32_t auth_algtype,
+		       int32_t auth_index)
+{
+	uint32_t dkp_protid;
+
+	switch (auth_algtype & OP_PCL_IPSEC_AUTH_MASK) {
+	case OP_PCL_IPSEC_HMAC_MD5_96:
+	case OP_PCL_IPSEC_HMAC_MD5_128:
+		dkp_protid = OP_PCLID_DKP_MD5;
+		break;
+	case OP_PCL_IPSEC_HMAC_SHA1_96:
+	case OP_PCL_IPSEC_HMAC_SHA1_160:
+		dkp_protid = OP_PCLID_DKP_SHA1;
+		break;
+	case OP_PCL_IPSEC_HMAC_SHA2_256_128:
+		dkp_protid = OP_PCLID_DKP_SHA256;
+		break;
+	case OP_PCL_IPSEC_HMAC_SHA2_384_192:
+		dkp_protid = OP_PCLID_DKP_SHA384;
+		break;
+	case OP_PCL_IPSEC_HMAC_SHA2_512_256:
+		dkp_protid = OP_PCLID_DKP_SHA512;
+		break;
+	default:
+		return rta_inline_query(sd_base_len,
+				       jd_len,
+				       data_len,
+				       inl_mask, count);
+	}
+
+	/* Updating the maximum supported inline key length */
+	if (auth_index != -1) {
+		if (split_key_len(dkp_protid) > data_len[auth_index])
+			data_len[auth_index] = split_key_len(dkp_protid);
+	}
+	return rta_inline_query(sd_base_len,
+			       jd_len,
+			       data_len,
+			       inl_mask, count);
+}
+
 /**
  * cnstr_shdsc_ipsec_encap - IPSec ESP encapsulation protocol-level shared
  *                           descriptor.
diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c
index 7807c83e54..8687e3e75e 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec.c
+++ b/drivers/crypto/dpaa_sec/dpaa_sec.c
@@ -398,10 +398,10 @@ dpaa_sec_prep_ipsec_cdb(dpaa_sec_session *ses)
 
 	cdb->sh_desc[0] = cipherdata.keylen;
 	cdb->sh_desc[1] = authdata.keylen;
-	err = rta_inline_query(IPSEC_AUTH_VAR_AES_DEC_BASE_DESC_LEN,
+	err = rta_inline_ipsec_query(IPSEC_AUTH_VAR_AES_DEC_BASE_DESC_LEN,
 			       DESC_JOB_IO_LEN,
 			       (unsigned int *)cdb->sh_desc,
-			       &cdb->sh_desc[2], 2);
+			       &cdb->sh_desc[2], 2, authdata.algtype, 1);
 
 	if (err < 0) {
 		DPAA_SEC_ERR("Crypto: Incorrect key lengths");
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-15 16:19:35.969416915 +0100
+++ 0024-crypto-dpaa_sec-fix-IPsec-descriptor.patch	2024-07-15 16:19:34.508205182 +0100
@@ -1 +1 @@
-From 046341575bd6e1210d6c12b595405ede41150da7 Mon Sep 17 00:00:00 2001
+From ac47aa31a1b2330b2c3dc5de71850826e2cf26fe Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 046341575bd6e1210d6c12b595405ede41150da7 ]
+
@@ -20 +21,0 @@
-Cc: stable@dpdk.org
@@ -24 +25 @@
- drivers/common/dpaax/caamflib/desc/ipsec.h | 73 ++++++++++++++++++++++
+ drivers/common/dpaax/caamflib/desc/ipsec.h | 68 ++++++++++++++++++++++
@@ -26 +27 @@
- 2 files changed, 75 insertions(+), 2 deletions(-)
+ 2 files changed, 70 insertions(+), 2 deletions(-)
@@ -29 +30 @@
-index eff26f6f8b..b902873970 100644
+index 8ec6aac915..26bf52827e 100644
@@ -32 +33 @@
-@@ -728,6 +728,79 @@ static inline void __gen_auth_key(struct program *program,
+@@ -726,6 +726,74 @@ static inline void __gen_auth_key(struct program *program,
@@ -86,5 +86,0 @@
-+	case OP_PCL_IPSEC_HMAC_SHA2_224_96:
-+	case OP_PCL_IPSEC_HMAC_SHA2_224_112:
-+	case OP_PCL_IPSEC_HMAC_SHA2_224_224:
-+		dkp_protid = OP_PCLID_DKP_SHA224;
-+		break;
@@ -113 +109 @@
-index 7aa163330a..bf2a11a4d4 100644
+index 7807c83e54..8687e3e75e 100644
@@ -116 +112 @@
-@@ -395,10 +395,10 @@ dpaa_sec_prep_ipsec_cdb(dpaa_sec_session *ses)
+@@ -398,10 +398,10 @@ dpaa_sec_prep_ipsec_cdb(dpaa_sec_session *ses)

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'crypto/dpaa2_sec: fix event queue user context' has been queued to stable release 22.11.6
  2024-07-15 15:25   ` patch 'config: fix warning for cross build with meson >= 1.3.0' " luca.boccassi
                       ` (22 preceding siblings ...)
  2024-07-15 15:26     ` patch 'crypto/dpaa_sec: fix IPsec descriptor' " luca.boccassi
@ 2024-07-15 15:26     ` luca.boccassi
  2024-07-15 15:26     ` patch 'examples/ipsec-secgw: fix SA salt endianness' " luca.boccassi
                       ` (60 subsequent siblings)
  84 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-07-15 15:26 UTC (permalink / raw)
  To: Jun Yang; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/6530bf0f6de87a62a8056905dbbafbeb000d9b03

Thanks.

Luca Boccassi

---
From 6530bf0f6de87a62a8056905dbbafbeb000d9b03 Mon Sep 17 00:00:00 2001
From: Jun Yang <jun.yang@nxp.com>
Date: Wed, 3 Jul 2024 15:56:49 +0530
Subject: [PATCH] crypto/dpaa2_sec: fix event queue user context

[ upstream commit 70d3ba14391a33585a739421c6e7300bb50f53aa ]

Context configured should be aligned with context got in dq process.
Here the rx_vq is just the first element of qp which covers the issue.

Fixes: bffc7d561c81 ("crypto/dpaa2_sec: support event crypto adapter")

Signed-off-by: Jun Yang <jun.yang@nxp.com>
---
 drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
index cf1339f266..eab7091251 100644
--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
@@ -4093,7 +4093,7 @@ dpaa2_sec_eventq_attach(const struct rte_cryptodev *dev,
 	cfg.dest_cfg.priority = priority;
 
 	cfg.options |= DPSECI_QUEUE_OPT_USER_CTX;
-	cfg.user_ctx = (size_t)(qp);
+	cfg.user_ctx = (size_t)(&qp->rx_vq);
 	if (event->sched_type == RTE_SCHED_TYPE_ATOMIC) {
 		cfg.options |= DPSECI_QUEUE_OPT_ORDER_PRESERVATION;
 		cfg.order_preservation_en = 1;
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-15 16:19:36.015463587 +0100
+++ 0025-crypto-dpaa2_sec-fix-event-queue-user-context.patch	2024-07-15 16:19:34.512205267 +0100
@@ -1 +1 @@
-From 70d3ba14391a33585a739421c6e7300bb50f53aa Mon Sep 17 00:00:00 2001
+From 6530bf0f6de87a62a8056905dbbafbeb000d9b03 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 70d3ba14391a33585a739421c6e7300bb50f53aa ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -18 +19 @@
-index 07369a383f..c1f7181d55 100644
+index cf1339f266..eab7091251 100644
@@ -21 +22 @@
-@@ -4103,7 +4103,7 @@ dpaa2_sec_eventq_attach(const struct rte_cryptodev *dev,
+@@ -4093,7 +4093,7 @@ dpaa2_sec_eventq_attach(const struct rte_cryptodev *dev,

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'examples/ipsec-secgw: fix SA salt endianness' has been queued to stable release 22.11.6
  2024-07-15 15:25   ` patch 'config: fix warning for cross build with meson >= 1.3.0' " luca.boccassi
                       ` (23 preceding siblings ...)
  2024-07-15 15:26     ` patch 'crypto/dpaa2_sec: fix event queue user context' " luca.boccassi
@ 2024-07-15 15:26     ` luca.boccassi
  2024-07-15 15:26     ` patch 'fbarray: fix incorrect lookahead behavior' " luca.boccassi
                       ` (59 subsequent siblings)
  84 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-07-15 15:26 UTC (permalink / raw)
  To: Shihong Wang; +Cc: Chaoyong He, Akhil Goyal, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/e8f3418f6405784a614cb1d527bee20213770082

Thanks.

Luca Boccassi

---
From e8f3418f6405784a614cb1d527bee20213770082 Mon Sep 17 00:00:00 2001
From: Shihong Wang <shihong.wang@corigine.com>
Date: Thu, 14 Mar 2024 10:00:52 +0800
Subject: [PATCH] examples/ipsec-secgw: fix SA salt endianness
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit e6bfd9676109f904b4f263402e77105fdca8e67c ]

The SA salt of struct ipsec_sa is a CPU-endian u32 variable, but it’s
value is stored in an array of encryption or authentication keys
according to big-endian. So it maybe need to convert the endianness
order to ensure that the value assigned to the SA salt is CPU-endian.

Fixes: 50d75cae2a2c ("examples/ipsec-secgw: initialize SA salt")
Fixes: 9413c3901f31 ("examples/ipsec-secgw: support additional algorithms")
Fixes: 501e9c226adf ("examples/ipsec-secgw: add AEAD parameters")

Signed-off-by: Shihong Wang <shihong.wang@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
---
 examples/ipsec-secgw/sa.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/examples/ipsec-secgw/sa.c b/examples/ipsec-secgw/sa.c
index 45cd29f18b..c7a655003f 100644
--- a/examples/ipsec-secgw/sa.c
+++ b/examples/ipsec-secgw/sa.c
@@ -373,6 +373,7 @@ parse_sa_tokens(char **tokens, uint32_t n_tokens,
 	uint32_t ti; /*token index*/
 	uint32_t *ri /*rule index*/;
 	struct ipsec_sa_cnt *sa_cnt;
+	rte_be32_t salt; /*big-endian salt*/
 	uint32_t cipher_algo_p = 0;
 	uint32_t auth_algo_p = 0;
 	uint32_t aead_algo_p = 0;
@@ -507,8 +508,8 @@ parse_sa_tokens(char **tokens, uint32_t n_tokens,
 			if (algo->algo == RTE_CRYPTO_CIPHER_AES_CTR) {
 				key_len -= 4;
 				rule->cipher_key_len = key_len;
-				memcpy(&rule->salt,
-					&rule->cipher_key[key_len], 4);
+				memcpy(&salt, &rule->cipher_key[key_len], 4);
+				rule->salt = rte_be_to_cpu_32(salt);
 			}
 
 			cipher_algo_p = 1;
@@ -572,8 +573,8 @@ parse_sa_tokens(char **tokens, uint32_t n_tokens,
 				key_len -= 4;
 				rule->auth_key_len = key_len;
 				rule->iv_len = algo->iv_len;
-				memcpy(&rule->salt,
-					&rule->auth_key[key_len], 4);
+				memcpy(&salt, &rule->auth_key[key_len], 4);
+				rule->salt = rte_be_to_cpu_32(salt);
 			}
 
 			auth_algo_p = 1;
@@ -631,8 +632,8 @@ parse_sa_tokens(char **tokens, uint32_t n_tokens,
 
 			key_len -= 4;
 			rule->cipher_key_len = key_len;
-			memcpy(&rule->salt,
-				&rule->cipher_key[key_len], 4);
+			memcpy(&salt, &rule->cipher_key[key_len], 4);
+			rule->salt = rte_be_to_cpu_32(salt);
 
 			aead_algo_p = 1;
 			continue;
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-15 16:19:36.060115685 +0100
+++ 0026-examples-ipsec-secgw-fix-SA-salt-endianness.patch	2024-07-15 16:19:34.512205267 +0100
@@ -1 +1 @@
-From e6bfd9676109f904b4f263402e77105fdca8e67c Mon Sep 17 00:00:00 2001
+From e8f3418f6405784a614cb1d527bee20213770082 Mon Sep 17 00:00:00 2001
@@ -8,0 +9,2 @@
+[ upstream commit e6bfd9676109f904b4f263402e77105fdca8e67c ]
+
@@ -17 +18,0 @@
-Cc: stable@dpdk.org
@@ -27 +28 @@
-index c4bac17cd7..8aa9aca739 100644
+index 45cd29f18b..c7a655003f 100644
@@ -30 +31 @@
-@@ -374,6 +374,7 @@ parse_sa_tokens(char **tokens, uint32_t n_tokens,
+@@ -373,6 +373,7 @@ parse_sa_tokens(char **tokens, uint32_t n_tokens,
@@ -38 +39 @@
-@@ -508,8 +509,8 @@ parse_sa_tokens(char **tokens, uint32_t n_tokens,
+@@ -507,8 +508,8 @@ parse_sa_tokens(char **tokens, uint32_t n_tokens,
@@ -49 +50 @@
-@@ -573,8 +574,8 @@ parse_sa_tokens(char **tokens, uint32_t n_tokens,
+@@ -572,8 +573,8 @@ parse_sa_tokens(char **tokens, uint32_t n_tokens,
@@ -60 +61 @@
-@@ -632,8 +633,8 @@ parse_sa_tokens(char **tokens, uint32_t n_tokens,
+@@ -631,8 +632,8 @@ parse_sa_tokens(char **tokens, uint32_t n_tokens,

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'fbarray: fix incorrect lookahead behavior' has been queued to stable release 22.11.6
  2024-07-15 15:25   ` patch 'config: fix warning for cross build with meson >= 1.3.0' " luca.boccassi
                       ` (24 preceding siblings ...)
  2024-07-15 15:26     ` patch 'examples/ipsec-secgw: fix SA salt endianness' " luca.boccassi
@ 2024-07-15 15:26     ` luca.boccassi
  2024-07-15 15:26     ` patch 'fbarray: fix incorrect lookbehind " luca.boccassi
                       ` (58 subsequent siblings)
  84 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-07-15 15:26 UTC (permalink / raw)
  To: Anatoly Burakov; +Cc: Vipin Padmam Ramesh, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/e67654ca812a801dbb5665b36aeeedc1665336ee

Thanks.

Luca Boccassi

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

[ upstream commit 8c03a149ce957b10d7792a2a78339496dd156e9f ]

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

Fix lookahead to avoid erroneous increment,
and add corresponding unit test.

Fixes: c44d09811b40 ("eal: add shared indexed file-backed array")

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

diff --git a/.mailmap b/.mailmap
index 0798312a63..95826dac6c 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1448,6 +1448,7 @@ Vincent Jardin <vincent.jardin@6wind.com>
 Vincent Li <vincent.mc.li@gmail.com>
 Vincent S. Cojot <vcojot@redhat.com>
 Vinh Tran <vinh.t.tran10@gmail.com>
+Vipin Padmam Ramesh <vipinp@vmware.com>
 Vipin Varghese <vipin.varghese@amd.com> <vipin.varghese@intel.com>
 Vipul Ashri <vipul.ashri@oracle.com>
 Visa Hankala <visa@hankala.org>
diff --git a/app/test/test_fbarray.c b/app/test/test_fbarray.c
index a691bf4458..fff44816a1 100644
--- a/app/test/test_fbarray.c
+++ b/app/test/test_fbarray.c
@@ -103,6 +103,14 @@ static int empty_msk_test_setup(void)
 	return 0;
 }
 
+static int lookahead_test_setup(void)
+{
+	/* set index 64 as used */
+	param.start = 64;
+	param.end = 64;
+	return init_array();
+}
+
 static int test_invalid(void)
 {
 	struct rte_fbarray dummy;
@@ -709,6 +717,20 @@ static int test_empty(void)
 	return TEST_SUCCESS;
 }
 
+static int test_lookahead(void)
+{
+	int ret;
+
+	/* run regular test first */
+	ret = test_find();
+	if (ret != TEST_SUCCESS)
+		return ret;
+
+	/* test if we can find free chunk while not starting with 0 */
+	TEST_ASSERT_EQUAL(rte_fbarray_find_next_n_free(&param.arr, 1, param.start),
+			param.start + 1, "Free chunk index is wrong\n");
+	return TEST_SUCCESS;
+}
 
 static struct unit_test_suite fbarray_test_suite = {
 	.suite_name = "fbarray autotest",
@@ -723,6 +745,7 @@ static struct unit_test_suite fbarray_test_suite = {
 		TEST_CASE_ST(last_msk_test_setup, reset_array, test_find),
 		TEST_CASE_ST(full_msk_test_setup, reset_array, test_find),
 		TEST_CASE_ST(empty_msk_test_setup, reset_array, test_empty),
+		TEST_CASE_ST(lookahead_test_setup, reset_array, test_lookahead),
 		TEST_CASES_END()
 	}
 };
diff --git a/lib/eal/common/eal_common_fbarray.c b/lib/eal/common/eal_common_fbarray.c
index 169e66e04b..842073ae1c 100644
--- a/lib/eal/common/eal_common_fbarray.c
+++ b/lib/eal/common/eal_common_fbarray.c
@@ -236,7 +236,8 @@ find_next_n(const struct rte_fbarray *arr, unsigned int start, unsigned int n,
 				 * as well, so skip that on next iteration.
 				 */
 				ignore_msk = ~((1ULL << need) - 1);
-				msk_idx = lookahead_idx;
+				/* outer loop will increment msk_idx so add 1 */
+				msk_idx = lookahead_idx - 1;
 				break;
 			}
 
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-15 16:19:36.102188106 +0100
+++ 0027-fbarray-fix-incorrect-lookahead-behavior.patch	2024-07-15 16:19:34.520205439 +0100
@@ -1 +1 @@
-From 8c03a149ce957b10d7792a2a78339496dd156e9f Mon Sep 17 00:00:00 2001
+From e67654ca812a801dbb5665b36aeeedc1665336ee Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 8c03a149ce957b10d7792a2a78339496dd156e9f ]
+
@@ -20 +21,0 @@
-Cc: stable@dpdk.org
@@ -31 +32 @@
-index 74739ec9be..085e5f0004 100644
+index 0798312a63..95826dac6c 100644
@@ -34 +35 @@
-@@ -1534,6 +1534,7 @@ Vincent Jardin <vincent.jardin@6wind.com>
+@@ -1448,6 +1448,7 @@ Vincent Jardin <vincent.jardin@6wind.com>
@@ -43 +44 @@
-index 26a51e2a3e..bf89b99e5b 100644
+index a691bf4458..fff44816a1 100644
@@ -91 +92 @@
-index 0fe5bcfe06..2680b34823 100644
+index 169e66e04b..842073ae1c 100644

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'fbarray: fix incorrect lookbehind behavior' has been queued to stable release 22.11.6
  2024-07-15 15:25   ` patch 'config: fix warning for cross build with meson >= 1.3.0' " luca.boccassi
                       ` (25 preceding siblings ...)
  2024-07-15 15:26     ` patch 'fbarray: fix incorrect lookahead behavior' " luca.boccassi
@ 2024-07-15 15:26     ` luca.boccassi
  2024-07-15 15:26     ` patch 'fbarray: fix lookahead ignore mask handling' " luca.boccassi
                       ` (57 subsequent siblings)
  84 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-07-15 15:26 UTC (permalink / raw)
  To: Anatoly Burakov; +Cc: Vipin Padmam Ramesh, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/8f3876f8666456adebafd3a60b3378a96019ba1b

Thanks.

Luca Boccassi

---
From 8f3876f8666456adebafd3a60b3378a96019ba1b 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
@@ -111,6 +111,14 @@ static int lookahead_test_setup(void)
 	return init_array();
 }
 
+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)
 {
 	struct rte_fbarray dummy;
@@ -732,6 +740,21 @@ static int test_lookahead(void)
 	return TEST_SUCCESS;
 }
 
+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",
 	.setup = autotest_setup,
@@ -746,6 +769,7 @@ static struct unit_test_suite fbarray_test_suite = {
 		TEST_CASE_ST(full_msk_test_setup, reset_array, test_find),
 		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 842073ae1c..374103dc15 100644
--- a/lib/eal/common/eal_common_fbarray.c
+++ b/lib/eal/common/eal_common_fbarray.c
@@ -512,7 +512,8 @@ find_prev_n(const struct rte_fbarray *arr, unsigned int start, unsigned int n,
 				 * as well, so skip that on next iteration.
 				 */
 				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.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-15 16:19:36.145663955 +0100
+++ 0028-fbarray-fix-incorrect-lookbehind-behavior.patch	2024-07-15 16:19:34.520205439 +0100
@@ -1 +1 @@
-From 8e3712928716a1deb8857c971865aa15dc436b04 Mon Sep 17 00:00:00 2001
+From 8f3876f8666456adebafd3a60b3378a96019ba1b 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
@@ -79 +80 @@
-index 2680b34823..b4f0b0b0c3 100644
+index 842073ae1c..374103dc15 100644

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'fbarray: fix lookahead ignore mask handling' has been queued to stable release 22.11.6
  2024-07-15 15:25   ` patch 'config: fix warning for cross build with meson >= 1.3.0' " luca.boccassi
                       ` (26 preceding siblings ...)
  2024-07-15 15:26     ` patch 'fbarray: fix incorrect lookbehind " luca.boccassi
@ 2024-07-15 15:26     ` luca.boccassi
  2024-07-15 15:26     ` patch 'fbarray: fix lookbehind " luca.boccassi
                       ` (56 subsequent siblings)
  84 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-07-15 15:26 UTC (permalink / raw)
  To: Anatoly Burakov; +Cc: Vipin Padmam Ramesh, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/2050d2ea0146e2ffd93742eb9105e039e5f6eb1e

Thanks.

Luca Boccassi

---
From 2050d2ea0146e2ffd93742eb9105e039e5f6eb1e Mon Sep 17 00:00:00 2001
From: Anatoly Burakov <anatoly.burakov@intel.com>
Date: Mon, 8 Jul 2024 17:07:34 +0100
Subject: [PATCH] fbarray: fix lookahead ignore mask handling

[ upstream commit a344719c181aac28cb2ada0d2ddbfee8ad737a1a ]

When lookahead mask does not have its first bit set,
we can infer that we've lost our run.
However, currently, we set ignore mask to ignore `need` number of bits,
which is incorrect because while there is no *current* run
within those bits, we might still be able to start a new run
within those ignored bits later.

This issue is fixed by counting how many shifts it took to lose the run,
and this is the number of bits we should ignore
(+1 to skip one we stopped on).
Also, add unit tests to reproduce the problem.

Fixes: c44d09811b40 ("eal: add shared indexed file-backed array")

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

diff --git a/app/test/test_fbarray.c b/app/test/test_fbarray.c
index f448d4f196..38a62cd456 100644
--- a/app/test/test_fbarray.c
+++ b/app/test/test_fbarray.c
@@ -755,6 +755,32 @@ static int test_lookbehind(void)
 	return TEST_SUCCESS;
 }
 
+static int test_lookahead_mask(void)
+{
+	/*
+	 * There is a certain type of lookahead behavior we want to test here,
+	 * namely masking of bits that were scanned with lookahead but that we
+	 * know do not match our criteria. This is achieved in following steps:
+	 *
+	 *   0. Look for a big enough chunk of free space (say, 62 elements)
+	 *   1. Trigger lookahead by breaking a run somewhere inside mask 0
+	 *      (indices 0-63)
+	 *   2. Fail lookahead by breaking the run somewhere inside mask 1
+	 *      (indices 64-127)
+	 *   3. Ensure that we can still find free space in mask 1 afterwards
+	 */
+
+	/* break run on first mask */
+	rte_fbarray_set_used(&param.arr, 61);
+	/* break run on second mask */
+	rte_fbarray_set_used(&param.arr, 70);
+
+	/* we expect to find free space at 71 */
+	TEST_ASSERT_EQUAL(rte_fbarray_find_next_n_free(&param.arr, 0, 62),
+			71, "Free chunk index is wrong\n");
+	return TEST_SUCCESS;
+}
+
 static struct unit_test_suite fbarray_test_suite = {
 	.suite_name = "fbarray autotest",
 	.setup = autotest_setup,
@@ -770,6 +796,8 @@ 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),
+		/* setup for these tests is more complex so do it in test func */
+		TEST_CASE_ST(NULL, reset_array, test_lookahead_mask),
 		TEST_CASES_END()
 	}
 };
diff --git a/lib/eal/common/eal_common_fbarray.c b/lib/eal/common/eal_common_fbarray.c
index 374103dc15..1909615187 100644
--- a/lib/eal/common/eal_common_fbarray.c
+++ b/lib/eal/common/eal_common_fbarray.c
@@ -216,6 +216,8 @@ find_next_n(const struct rte_fbarray *arr, unsigned int start, unsigned int n,
 		for (lookahead_idx = msk_idx + 1; lookahead_idx < msk->n_masks;
 				lookahead_idx++) {
 			unsigned int s_idx, need;
+			uint64_t first_bit = 1;
+
 			lookahead_msk = msk->data[lookahead_idx];
 
 			/* if we're looking for free space, invert the mask */
@@ -225,17 +227,22 @@ find_next_n(const struct rte_fbarray *arr, unsigned int start, unsigned int n,
 			/* figure out how many consecutive bits we need here */
 			need = RTE_MIN(left, MASK_ALIGN);
 
-			for (s_idx = 0; s_idx < need - 1; s_idx++)
+			/* count number of shifts we performed */
+			for (s_idx = 0; s_idx < need - 1; s_idx++) {
 				lookahead_msk &= lookahead_msk >> 1ULL;
+				/* did we lose the run yet? */
+				if ((lookahead_msk & first_bit) == 0)
+					break;
+			}
 
 			/* if first bit is not set, we've lost the run */
-			if ((lookahead_msk & 1) == 0) {
+			if ((lookahead_msk & first_bit) == 0) {
 				/*
 				 * we've scanned this far, so we know there are
 				 * no runs in the space we've lookahead-scanned
 				 * as well, so skip that on next iteration.
 				 */
-				ignore_msk = ~((1ULL << need) - 1);
+				ignore_msk = ~((1ULL << (s_idx + 1)) - 1);
 				/* outer loop will increment msk_idx so add 1 */
 				msk_idx = lookahead_idx - 1;
 				break;
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-15 16:19:36.189873104 +0100
+++ 0029-fbarray-fix-lookahead-ignore-mask-handling.patch	2024-07-15 16:19:34.524205524 +0100
@@ -1 +1 @@
-From a344719c181aac28cb2ada0d2ddbfee8ad737a1a Mon Sep 17 00:00:00 2001
+From 2050d2ea0146e2ffd93742eb9105e039e5f6eb1e Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit a344719c181aac28cb2ada0d2ddbfee8ad737a1a ]
+
@@ -19 +20,0 @@
-Cc: stable@dpdk.org
@@ -29 +30 @@
-index 147d6e2a07..4b17ef6be3 100644
+index f448d4f196..38a62cd456 100644
@@ -75 +76 @@
-index b4f0b0b0c3..195f8394be 100644
+index 374103dc15..1909615187 100644

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'fbarray: fix lookbehind ignore mask handling' has been queued to stable release 22.11.6
  2024-07-15 15:25   ` patch 'config: fix warning for cross build with meson >= 1.3.0' " luca.boccassi
                       ` (27 preceding siblings ...)
  2024-07-15 15:26     ` patch 'fbarray: fix lookahead ignore mask handling' " luca.boccassi
@ 2024-07-15 15:26     ` luca.boccassi
  2024-07-15 15:26     ` patch 'usertools/devbind: fix indentation' " luca.boccassi
                       ` (55 subsequent siblings)
  84 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-07-15 15:26 UTC (permalink / raw)
  To: Anatoly Burakov; +Cc: Vipin Padmam Ramesh, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/58dd24b4666b3254b8acce9b7ae113d69c38d3a0

Thanks.

Luca Boccassi

---
From 58dd24b4666b3254b8acce9b7ae113d69c38d3a0 Mon Sep 17 00:00:00 2001
From: Anatoly Burakov <anatoly.burakov@intel.com>
Date: Mon, 8 Jul 2024 17:07:35 +0100
Subject: [PATCH] fbarray: fix lookbehind ignore mask handling

[ upstream commit 0c6e2781578f37d0497c225acf68ce5ffe31bd8e ]

When lookahead mask does not have its last bit set,
we can infer that we've lost our run.
However, currently, we set ignore mask to ignore first `need` bits,
which is incorrect for two reasons: first, using `need` bits as
ignore bit count means we might miss opportunities to start a new run
within those bits, and more importantly when doing lookbehind,
we start looking from the top, so we should be ignoring *last* N bits,
not *first* N bits of the mask.

This issue is fixed by counting how many shifts it took to lose the run,
and this is the number of bits we should ignore from the top
(+1 to skip one we stopped on).
Also, add unit tests to reproduce the problem.

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             | 27 +++++++++++++++++++++++++++
 lib/eal/common/eal_common_fbarray.c |  9 +++++++--
 2 files changed, 34 insertions(+), 2 deletions(-)

diff --git a/app/test/test_fbarray.c b/app/test/test_fbarray.c
index 38a62cd456..3be9e19e78 100644
--- a/app/test/test_fbarray.c
+++ b/app/test/test_fbarray.c
@@ -781,6 +781,32 @@ static int test_lookahead_mask(void)
 	return TEST_SUCCESS;
 }
 
+static int test_lookbehind_mask(void)
+{
+	/*
+	 * There is a certain type of lookbehind behavior we want to test here,
+	 * namely masking of bits that were scanned with lookbehind but that we
+	 * know do not match our criteria. This is achieved in two steps:
+	 *
+	 *   0. Look for a big enough chunk of free space (say, 62 elements)
+	 *   1. Trigger lookbehind by breaking a run somewhere inside mask 2
+	 *      (indices 128-191)
+	 *   2. Fail lookbehind by breaking the run somewhere inside mask 1
+	 *      (indices 64-127)
+	 *   3. Ensure that we can still find free space in mask 1 afterwards
+	 */
+
+	/* break run on mask 2 */
+	rte_fbarray_set_used(&param.arr, 130);
+	/* break run on mask 1 */
+	rte_fbarray_set_used(&param.arr, 70);
+
+	/* start from 190, we expect to find free space at 8 */
+	TEST_ASSERT_EQUAL(rte_fbarray_find_prev_n_free(&param.arr, 190, 62),
+			8, "Free chunk index is wrong\n");
+	return TEST_SUCCESS;
+}
+
 static struct unit_test_suite fbarray_test_suite = {
 	.suite_name = "fbarray autotest",
 	.setup = autotest_setup,
@@ -798,6 +824,7 @@ static struct unit_test_suite fbarray_test_suite = {
 		TEST_CASE_ST(lookbehind_test_setup, reset_array, test_lookbehind),
 		/* setup for these tests is more complex so do it in test func */
 		TEST_CASE_ST(NULL, reset_array, test_lookahead_mask),
+		TEST_CASE_ST(NULL, reset_array, test_lookbehind_mask),
 		TEST_CASES_END()
 	}
 };
diff --git a/lib/eal/common/eal_common_fbarray.c b/lib/eal/common/eal_common_fbarray.c
index 1909615187..34f51d8530 100644
--- a/lib/eal/common/eal_common_fbarray.c
+++ b/lib/eal/common/eal_common_fbarray.c
@@ -508,8 +508,13 @@ find_prev_n(const struct rte_fbarray *arr, unsigned int start, unsigned int n,
 			/* figure out how many consecutive bits we need here */
 			need = RTE_MIN(left, MASK_ALIGN);
 
-			for (s_idx = 0; s_idx < need - 1; s_idx++)
+			/* count number of shifts we performed */
+			for (s_idx = 0; s_idx < need - 1; s_idx++) {
 				lookbehind_msk &= lookbehind_msk << 1ULL;
+				/* did we lose the run yet? */
+				if ((lookbehind_msk & last_bit) == 0)
+					break;
+			}
 
 			/* if last bit is not set, we've lost the run */
 			if ((lookbehind_msk & last_bit) == 0) {
@@ -518,7 +523,7 @@ find_prev_n(const struct rte_fbarray *arr, unsigned int start, unsigned int n,
 				 * no runs in the space we've lookbehind-scanned
 				 * as well, so skip that on next iteration.
 				 */
-				ignore_msk = UINT64_MAX << need;
+				ignore_msk = ~(UINT64_MAX << (MASK_ALIGN - s_idx - 1));
 				/* outer loop will decrement msk_idx so add 1 */
 				msk_idx = lookbehind_idx + 1;
 				break;
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-15 16:19:36.233590416 +0100
+++ 0030-fbarray-fix-lookbehind-ignore-mask-handling.patch	2024-07-15 16:19:34.528205609 +0100
@@ -1 +1 @@
-From 0c6e2781578f37d0497c225acf68ce5ffe31bd8e Mon Sep 17 00:00:00 2001
+From 58dd24b4666b3254b8acce9b7ae113d69c38d3a0 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 0c6e2781578f37d0497c225acf68ce5ffe31bd8e ]
+
@@ -21 +22,0 @@
-Cc: stable@dpdk.org
@@ -31 +32 @@
-index 4b17ef6be3..13c6691e50 100644
+index 38a62cd456..3be9e19e78 100644
@@ -76 +77 @@
-index 195f8394be..63d8b731f5 100644
+index 1909615187..34f51d8530 100644

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'usertools/devbind: fix indentation' has been queued to stable release 22.11.6
  2024-07-15 15:25   ` patch 'config: fix warning for cross build with meson >= 1.3.0' " luca.boccassi
                       ` (28 preceding siblings ...)
  2024-07-15 15:26     ` patch 'fbarray: fix lookbehind " luca.boccassi
@ 2024-07-15 15:26     ` luca.boccassi
  2024-07-15 15:26     ` patch 'eal/linux: lower log level on allocation attempt failure' " luca.boccassi
                       ` (54 subsequent siblings)
  84 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-07-15 15:26 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Robin Jarry, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/49fc31bc8b1eee29c396b025088dca7a65cf663a

Thanks.

Luca Boccassi

---
From 49fc31bc8b1eee29c396b025088dca7a65cf663a Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Mon, 1 Jul 2024 10:45:44 -0700
Subject: [PATCH] usertools/devbind: fix indentation

[ upstream commit 04f14ad7e0a829354b58e0b2efcfd906e51327d9 ]

The python check tool (flake8) is picky about the indentation
of continuation lines, and dpdk-devbind was not following standard.

Error is:
	 E127 continuation line over-indented for visual indent

Fixes: 2ff801515e49 ("usertools/devbind: update octeontx2 DMA device")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Robin Jarry <rjarry@redhat.com>
---
 usertools/dpdk-devbind.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/usertools/dpdk-devbind.py b/usertools/dpdk-devbind.py
index 4d9c1be666..d9aff74873 100755
--- a/usertools/dpdk-devbind.py
+++ b/usertools/dpdk-devbind.py
@@ -66,14 +66,14 @@ intel_ntb_icx = {'Class': '06', 'Vendor': '8086', 'Device': '347e',
                  'SVendor': None, 'SDevice': None}
 
 cnxk_sso = {'Class': '08', 'Vendor': '177d', 'Device': 'a0f9,a0fa',
-                 'SVendor': None, 'SDevice': None}
+            'SVendor': None, 'SDevice': None}
 cnxk_npa = {'Class': '08', 'Vendor': '177d', 'Device': 'a0fb,a0fc',
-                 'SVendor': None, 'SDevice': None}
+            'SVendor': None, 'SDevice': None}
 cn9k_ree = {'Class': '08', 'Vendor': '177d', 'Device': 'a0f4',
-                 'SVendor': None, 'SDevice': None}
+            'SVendor': None, 'SDevice': None}
 
 virtio_blk = {'Class': '01', 'Vendor': "1af4", 'Device': '1001,1042',
-                    'SVendor': None, 'SDevice': None}
+              'SVendor': None, 'SDevice': None}
 
 network_devices = [network_class, cavium_pkx, avp_vnic, ifpga_class]
 baseband_devices = [acceleration_class]
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-15 16:19:36.275415613 +0100
+++ 0031-usertools-devbind-fix-indentation.patch	2024-07-15 16:19:34.528205609 +0100
@@ -1 +1 @@
-From 04f14ad7e0a829354b58e0b2efcfd906e51327d9 Mon Sep 17 00:00:00 2001
+From 49fc31bc8b1eee29c396b025088dca7a65cf663a Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 04f14ad7e0a829354b58e0b2efcfd906e51327d9 ]
+
@@ -17,2 +19,2 @@
- usertools/dpdk-devbind.py | 10 +++++-----
- 1 file changed, 5 insertions(+), 5 deletions(-)
+ usertools/dpdk-devbind.py | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
@@ -21 +23 @@
-index a278f5e7f3..5dc42d8fe2 100755
+index 4d9c1be666..d9aff74873 100755
@@ -24 +26 @@
-@@ -66,17 +66,17 @@ intel_ntb_icx = {'Class': '06', 'Vendor': '8086', 'Device': '347e',
+@@ -66,14 +66,14 @@ intel_ntb_icx = {'Class': '06', 'Vendor': '8086', 'Device': '347e',
@@ -40,4 +41,0 @@
- 
- cnxk_ml = {'Class': '08', 'Vendor': '177d', 'Device': 'a092',
--            'SVendor': None, 'SDevice': None}
-+           'SVendor': None, 'SDevice': None}

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'eal/linux: lower log level on allocation attempt failure' has been queued to stable release 22.11.6
  2024-07-15 15:25   ` patch 'config: fix warning for cross build with meson >= 1.3.0' " luca.boccassi
                       ` (29 preceding siblings ...)
  2024-07-15 15:26     ` patch 'usertools/devbind: fix indentation' " luca.boccassi
@ 2024-07-15 15:26     ` luca.boccassi
  2024-07-15 15:26     ` patch 'dma/idxd: fix setup with Ubuntu 24.04' " luca.boccassi
                       ` (53 subsequent siblings)
  84 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-07-15 15:26 UTC (permalink / raw)
  To: David Marchand; +Cc: Stephen Hemminger, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/b929a370ef2064f97a3e37810f2331e552dde220

Thanks.

Luca Boccassi

---
From b929a370ef2064f97a3e37810f2331e552dde220 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Wed, 26 Jun 2024 16:51:42 +0200
Subject: [PATCH] eal/linux: lower log level on allocation attempt failure

[ upstream commit 8f4611d893b4eeffb942fffdadc4cde394e4c309 ]

On a ARM system with only 2MB hugepages configured, EAL emits an error
log with allocations larger than 512MB.

Example with testpmd:
$ dpdk-testpmd --in-memory --no-pci --log-level=*:debug -- -i
...
EAL: In-memory mode enabled, hugepages of size 33554432 bytes will be
	allocated anonymously
EAL: No free 32768 kB hugepages reported on node 0
EAL: In-memory mode enabled, hugepages of size 65536 bytes will be
	allocated anonymously
EAL: No free 64 kB hugepages reported on node 0
EAL: In-memory mode enabled, hugepages of size 1073741824 bytes will be
	allocated anonymously
EAL: No free 1048576 kB hugepages reported on node 0
...
EAL: Detected memory type: socket_id:0 hugepage_sz:1073741824
EAL: Detected memory type: socket_id:0 hugepage_sz:33554432
EAL: Detected memory type: socket_id:0 hugepage_sz:2097152
EAL: Detected memory type: socket_id:0 hugepage_sz:65536
EAL: Creating 2 segment lists: n_segs:32 socket_id:0
	hugepage_sz:1073741824
...
EAL: Creating 2 segment lists: n_segs:1024 socket_id:0
	hugepage_sz:33554432
...
EAL: Creating 4 segment lists: n_segs:8192 socket_id:0
	hugepage_sz:2097152
...
EAL: Creating 4 segment lists: n_segs:8192 socket_id:0
	hugepage_sz:65536
...
EAL: Trying to obtain current memory policy.
EAL: Setting policy MPOL_PREFERRED for socket 0
EAL: alloc_seg(): mmap() failed: Cannot allocate memory
EAL: Ask a virtual area of 0x40000000 bytes
EAL: Virtual area found at 0x140000000 (size = 0x40000000)
EAL: attempted to allocate 2 segments, but only 0 were allocated
EAL: Restoring previous memory policy: 4
EAL: Trying to obtain current memory policy.
EAL: Setting policy MPOL_PREFERRED for socket 0
EAL: eal_memalloc_alloc_seg_bulk(): couldn't find suitable memseg_list
EAL: Restoring previous memory policy: 4
EAL: Trying to obtain current memory policy.
EAL: Setting policy MPOL_PREFERRED for socket 0
EAL: Restoring previous memory policy: 4
EAL: request: mp_malloc_sync
EAL: No shared files mode enabled, IPC is disabled
EAL: Heap on socket 0 was expanded by 1064MB
...

The reason is that the memzone allocation (~1GB large) would require
17017 (32kB) segments. However, as displayed in the early logs, a 32kB
memory segment list can only host 8192 segments (controlled by the build
option RTE_MAX_MEMSEG_PER_LIST).

This log message is misleading as there is no issue in the end: the
allocation succeeded with 2MB hugepages.

Fixes: 582bed1e1d1d ("mem: support mapping hugepages at runtime")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/eal/linux/eal_memalloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/eal/linux/eal_memalloc.c b/lib/eal/linux/eal_memalloc.c
index 9853ec78a2..b9fc83fe6a 100644
--- a/lib/eal/linux/eal_memalloc.c
+++ b/lib/eal/linux/eal_memalloc.c
@@ -1061,7 +1061,7 @@ eal_memalloc_alloc_seg_bulk(struct rte_memseg **ms, int n_segs, size_t page_sz,
 	/* memalloc is locked, so it's safe to use thread-unsafe version */
 	ret = rte_memseg_list_walk_thread_unsafe(alloc_seg_walk, &wa);
 	if (ret == 0) {
-		RTE_LOG(ERR, EAL, "%s(): couldn't find suitable memseg_list\n",
+		RTE_LOG(DEBUG, EAL, "%s(): couldn't find suitable memseg_list\n",
 			__func__);
 		ret = -1;
 	} else if (ret > 0) {
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-15 16:19:36.321854357 +0100
+++ 0032-eal-linux-lower-log-level-on-allocation-attempt-fail.patch	2024-07-15 16:19:34.528205609 +0100
@@ -1 +1 @@
-From 8f4611d893b4eeffb942fffdadc4cde394e4c309 Mon Sep 17 00:00:00 2001
+From b929a370ef2064f97a3e37810f2331e552dde220 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 8f4611d893b4eeffb942fffdadc4cde394e4c309 ]
+
@@ -66 +67,0 @@
-Cc: stable@dpdk.org
@@ -75 +76 @@
-index 0cc3295994..e354efc95d 100644
+index 9853ec78a2..b9fc83fe6a 100644
@@ -82,2 +83,2 @@
--		EAL_LOG(ERR, "%s(): couldn't find suitable memseg_list",
-+		EAL_LOG(DEBUG, "%s(): couldn't find suitable memseg_list",
+-		RTE_LOG(ERR, EAL, "%s(): couldn't find suitable memseg_list\n",
++		RTE_LOG(DEBUG, EAL, "%s(): couldn't find suitable memseg_list\n",

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'dma/idxd: fix setup with Ubuntu 24.04' has been queued to stable release 22.11.6
  2024-07-15 15:25   ` patch 'config: fix warning for cross build with meson >= 1.3.0' " luca.boccassi
                       ` (30 preceding siblings ...)
  2024-07-15 15:26     ` patch 'eal/linux: lower log level on allocation attempt failure' " luca.boccassi
@ 2024-07-15 15:26     ` luca.boccassi
  2024-07-15 15:26     ` patch 'app/testpmd: fix help string of BPF load command' " luca.boccassi
                       ` (52 subsequent siblings)
  84 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-07-15 15:26 UTC (permalink / raw)
  To: Wenwu Ma; +Cc: Bruce Richardson, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/c74c897cfed45faaec981b9d31ee40b203aad7f4

Thanks.

Luca Boccassi

---
From c74c897cfed45faaec981b9d31ee40b203aad7f4 Mon Sep 17 00:00:00 2001
From: Wenwu Ma <wenwux.ma@intel.com>
Date: Fri, 28 Jun 2024 17:54:00 +0800
Subject: [PATCH] dma/idxd: fix setup with Ubuntu 24.04

[ upstream commit d569af3d4e8ef896591f4e50f7bd1c1274c86e15 ]

In Ubuntu 24.04 and with Linux kernel >= v6.7, DSA's workqueue has a
driver_name file in sysfs.
DPDK needs to write a correct value to this file when configuring a device
instance using the dpdk_idxd_cfg.py script, otherwise it will fail to be
configured, this patch fixes the issue.

Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7af1e0aceeb3
Signed-off-by: Wenwu Ma <wenwux.ma@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/dma/idxd/dpdk_idxd_cfg.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/dma/idxd/dpdk_idxd_cfg.py b/drivers/dma/idxd/dpdk_idxd_cfg.py
index 41b4d13b9c..3f0de59e91 100755
--- a/drivers/dma/idxd/dpdk_idxd_cfg.py
+++ b/drivers/dma/idxd/dpdk_idxd_cfg.py
@@ -98,8 +98,10 @@ def configure_dsa(dsa_id, args):
                  "priority": 1,
                  "max_batch_size": 1024,
                  "size": int(max_work_queues_size / nb_queues)}
-        wqcfg.update(parse_wq_opts(args.wq_option))
         wq_dir = SysfsDir(os.path.join(dsa_dir.path, f"wq{dsa_id}.{q}"))
+        if os.path.exists(os.path.join(wq_dir.path, f"driver_name")):
+            wqcfg.update({"driver_name": "user"})
+        wqcfg.update(parse_wq_opts(args.wq_option))
         wq_dir.write_values(wqcfg)
 
     # enable device and then queues
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-15 16:19:36.364946782 +0100
+++ 0033-dma-idxd-fix-setup-with-Ubuntu-24.04.patch	2024-07-15 16:19:34.528205609 +0100
@@ -1 +1 @@
-From d569af3d4e8ef896591f4e50f7bd1c1274c86e15 Mon Sep 17 00:00:00 2001
+From c74c897cfed45faaec981b9d31ee40b203aad7f4 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit d569af3d4e8ef896591f4e50f7bd1c1274c86e15 ]
+
@@ -12,2 +13,0 @@
-Cc: stable@dpdk.org
-
@@ -22 +22 @@
-index c0c833ade9..5c9572b49d 100755
+index 41b4d13b9c..3f0de59e91 100755
@@ -25 +25 @@
-@@ -104,8 +104,10 @@ def configure_dsa(dsa_id, args):
+@@ -98,8 +98,10 @@ def configure_dsa(dsa_id, args):

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'app/testpmd: fix help string of BPF load command' has been queued to stable release 22.11.6
  2024-07-15 15:25   ` patch 'config: fix warning for cross build with meson >= 1.3.0' " luca.boccassi
                       ` (31 preceding siblings ...)
  2024-07-15 15:26     ` patch 'dma/idxd: fix setup with Ubuntu 24.04' " luca.boccassi
@ 2024-07-15 15:26     ` luca.boccassi
  2024-07-15 15:26     ` patch 'bus/dpaa: fix bus scan for DMA devices' " luca.boccassi
                       ` (51 subsequent siblings)
  84 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-07-15 15:26 UTC (permalink / raw)
  To: Chaoyong He; +Cc: Long Wu, Peng Zhang, Konstantin Ananyev, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/e922a98a21a315f0a7eaa08207bcd5c66942defb

Thanks.

Luca Boccassi

---
From e922a98a21a315f0a7eaa08207bcd5c66942defb Mon Sep 17 00:00:00 2001
From: Chaoyong He <chaoyong.he@corigine.com>
Date: Mon, 24 Jun 2024 09:58:52 +0800
Subject: [PATCH] app/testpmd: fix help string of BPF load command

[ upstream commit 34890bfa6e11bae143064825c22755d842531e40 ]

Based on the logic of 'bpf_parse_flags()' and the 'bpf-load' section of
'testpmd_funcs.rst' document, the 'B' flag in the help string of
bpf-load command should be '-'.

Fixes: e977e4199a8d ("app/testpmd: add commands to load/unload BPF filters")

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@huawei.com>
---
 app/test-pmd/bpf_cmd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test-pmd/bpf_cmd.c b/app/test-pmd/bpf_cmd.c
index 46f6b7d6d2..24d34f983e 100644
--- a/app/test-pmd/bpf_cmd.c
+++ b/app/test-pmd/bpf_cmd.c
@@ -139,7 +139,7 @@ static cmdline_parse_token_string_t cmd_load_bpf_prm =
 cmdline_parse_inst_t cmd_operate_bpf_ld_parse = {
 	.f = cmd_operate_bpf_ld_parsed,
 	.data = NULL,
-	.help_str = "bpf-load rx|tx <port> <queue> <J|M|B> <file_name>",
+	.help_str = "bpf-load rx|tx <port> <queue> <J|M|-> <file_name>",
 	.tokens = {
 		(void *)&cmd_load_bpf_start,
 		(void *)&cmd_load_bpf_dir,
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-15 16:19:36.407658167 +0100
+++ 0034-app-testpmd-fix-help-string-of-BPF-load-command.patch	2024-07-15 16:19:34.528205609 +0100
@@ -1 +1 @@
-From 34890bfa6e11bae143064825c22755d842531e40 Mon Sep 17 00:00:00 2001
+From e922a98a21a315f0a7eaa08207bcd5c66942defb Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 34890bfa6e11bae143064825c22755d842531e40 ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'bus/dpaa: fix bus scan for DMA devices' has been queued to stable release 22.11.6
  2024-07-15 15:25   ` patch 'config: fix warning for cross build with meson >= 1.3.0' " luca.boccassi
                       ` (32 preceding siblings ...)
  2024-07-15 15:26     ` patch 'app/testpmd: fix help string of BPF load command' " luca.boccassi
@ 2024-07-15 15:26     ` luca.boccassi
  2024-07-15 15:26     ` patch 'bus/dpaa: fix memory leak in bus scan' " luca.boccassi
                       ` (50 subsequent siblings)
  84 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-07-15 15:26 UTC (permalink / raw)
  To: Gagandeep Singh; +Cc: Vanshika Shukla, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/b82122e2ab8e7baf6516e68a917399107d333b48

Thanks.

Luca Boccassi

---
From b82122e2ab8e7baf6516e68a917399107d333b48 Mon Sep 17 00:00:00 2001
From: Gagandeep Singh <g.singh@nxp.com>
Date: Wed, 10 Jul 2024 14:25:27 +0530
Subject: [PATCH] bus/dpaa: fix bus scan for DMA devices

[ upstream commit bf62ec7f0c99e861b65f550191b98377ac9dd2f9 ]

If there is no sec device available, code is not scanning QDMA dev.
This patch fixes this problem by adding a goto statement instead
of return in case no sec device available.

Fixes: 583f3732974f ("dma/dpaa: introduce DPAA DMA driver skeleton")

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Signed-off-by: Vanshika Shukla <vanshika.shukla@nxp.com>
---
 drivers/bus/dpaa/dpaa_bus.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c
index a67f5c9ab5..0823553398 100644
--- a/drivers/bus/dpaa/dpaa_bus.c
+++ b/drivers/bus/dpaa/dpaa_bus.c
@@ -220,7 +220,7 @@ dpaa_create_device_list(void)
 
 	if (dpaa_sec_available()) {
 		DPAA_BUS_LOG(INFO, "DPAA SEC devices are not available");
-		return 0;
+		goto qdma_dpaa;
 	}
 
 	/* Creating SEC Devices */
@@ -259,6 +259,7 @@ dpaa_create_device_list(void)
 
 	rte_dpaa_bus.device_count += i;
 
+qdma_dpaa:
 	/* Creating QDMA Device */
 	for (i = 0; i < RTE_DPAA_QDMA_DEVICES; i++) {
 		dev = calloc(1, sizeof(struct rte_dpaa_device));
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-15 16:19:36.449684955 +0100
+++ 0035-bus-dpaa-fix-bus-scan-for-DMA-devices.patch	2024-07-15 16:19:34.532205695 +0100
@@ -1 +1 @@
-From bf62ec7f0c99e861b65f550191b98377ac9dd2f9 Mon Sep 17 00:00:00 2001
+From b82122e2ab8e7baf6516e68a917399107d333b48 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit bf62ec7f0c99e861b65f550191b98377ac9dd2f9 ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org
@@ -20 +21 @@
-index 64b748626b..b8f41ec069 100644
+index a67f5c9ab5..0823553398 100644
@@ -23 +24 @@
-@@ -221,7 +221,7 @@ dpaa_create_device_list(void)
+@@ -220,7 +220,7 @@ dpaa_create_device_list(void)
@@ -32 +33 @@
-@@ -260,6 +260,7 @@ dpaa_create_device_list(void)
+@@ -259,6 +259,7 @@ dpaa_create_device_list(void)

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'bus/dpaa: fix memory leak in bus scan' has been queued to stable release 22.11.6
  2024-07-15 15:25   ` patch 'config: fix warning for cross build with meson >= 1.3.0' " luca.boccassi
                       ` (33 preceding siblings ...)
  2024-07-15 15:26     ` patch 'bus/dpaa: fix bus scan for DMA devices' " luca.boccassi
@ 2024-07-15 15:26     ` luca.boccassi
  2024-07-15 15:26     ` patch 'common/dpaax: fix IOVA table cleanup' " luca.boccassi
                       ` (49 subsequent siblings)
  84 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-07-15 15:26 UTC (permalink / raw)
  To: Apeksha Gupta; +Cc: Vanshika Shukla, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/75332a8da8bfa24d03d24267470feeb38eab0eb8

Thanks.

Luca Boccassi

---
From 75332a8da8bfa24d03d24267470feeb38eab0eb8 Mon Sep 17 00:00:00 2001
From: Apeksha Gupta <apeksha.gupta@nxp.com>
Date: Wed, 10 Jul 2024 14:25:28 +0530
Subject: [PATCH] bus/dpaa: fix memory leak in bus scan

[ upstream commit de0833ffe31739fd40789b1580025bc849d8871f ]

Resource leak:
variable dev is going out of scope leaks the storage.

Coverity issue: 373703
Fixes: d61138d4f0e2 ("drivers: remove direct access to interrupt handle")

Signed-off-by: Apeksha Gupta <apeksha.gupta@nxp.com>
Signed-off-by: Vanshika Shukla <vanshika.shukla@nxp.com>
---
 drivers/bus/dpaa/dpaa_bus.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c
index 0823553398..aaf2a5f43e 100644
--- a/drivers/bus/dpaa/dpaa_bus.c
+++ b/drivers/bus/dpaa/dpaa_bus.c
@@ -187,6 +187,7 @@ dpaa_create_device_list(void)
 		if (dev->intr_handle == NULL) {
 			DPAA_BUS_LOG(ERR, "Failed to allocate intr handle");
 			ret = -ENOMEM;
+			free(dev);
 			goto cleanup;
 		}
 
@@ -238,6 +239,7 @@ dpaa_create_device_list(void)
 		if (dev->intr_handle == NULL) {
 			DPAA_BUS_LOG(ERR, "Failed to allocate intr handle");
 			ret = -ENOMEM;
+			free(dev);
 			goto cleanup;
 		}
 
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-15 16:19:36.502998244 +0100
+++ 0036-bus-dpaa-fix-memory-leak-in-bus-scan.patch	2024-07-15 16:19:34.532205695 +0100
@@ -1 +1 @@
-From de0833ffe31739fd40789b1580025bc849d8871f Mon Sep 17 00:00:00 2001
+From 75332a8da8bfa24d03d24267470feeb38eab0eb8 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit de0833ffe31739fd40789b1580025bc849d8871f ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org
@@ -20 +21 @@
-index b8f41ec069..1f6997c77e 100644
+index 0823553398..aaf2a5f43e 100644
@@ -23 +24 @@
-@@ -188,6 +188,7 @@ dpaa_create_device_list(void)
+@@ -187,6 +187,7 @@ dpaa_create_device_list(void)
@@ -31 +32 @@
-@@ -239,6 +240,7 @@ dpaa_create_device_list(void)
+@@ -238,6 +239,7 @@ dpaa_create_device_list(void)

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'common/dpaax: fix IOVA table cleanup' has been queued to stable release 22.11.6
  2024-07-15 15:25   ` patch 'config: fix warning for cross build with meson >= 1.3.0' " luca.boccassi
                       ` (34 preceding siblings ...)
  2024-07-15 15:26     ` patch 'bus/dpaa: fix memory leak in bus scan' " luca.boccassi
@ 2024-07-15 15:26     ` luca.boccassi
  2024-07-15 15:26     ` patch 'common/dpaax: fix node array overrun' " luca.boccassi
                       ` (48 subsequent siblings)
  84 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-07-15 15:26 UTC (permalink / raw)
  To: Gagandeep Singh; +Cc: Vanshika Shukla, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/041e6663bd8ed4da45cd30e24b96a7494c953c53

Thanks.

Luca Boccassi

---
From 041e6663bd8ed4da45cd30e24b96a7494c953c53 Mon Sep 17 00:00:00 2001
From: Gagandeep Singh <g.singh@nxp.com>
Date: Wed, 10 Jul 2024 14:25:29 +0530
Subject: [PATCH] common/dpaax: fix IOVA table cleanup

[ upstream commit 3a3cdff440fe6b98b95f798caf7a4583a49ebe08 ]

Fixes incorrect structure free.

Fixes: 2f3d633aa593 ("common/dpaax: add library for PA/VA translation table")

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Signed-off-by: Vanshika Shukla <vanshika.shukla@nxp.com>
---
 drivers/common/dpaax/dpaax_iova_table.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/common/dpaax/dpaax_iova_table.c b/drivers/common/dpaax/dpaax_iova_table.c
index 9daac4bc03..d2a78f4c19 100644
--- a/drivers/common/dpaax/dpaax_iova_table.c
+++ b/drivers/common/dpaax/dpaax_iova_table.c
@@ -1,5 +1,5 @@
 /* SPDX-License-Identifier: BSD-3-Clause
- * Copyright 2018 NXP
+ * Copyright 2018-2023 NXP
  */
 
 #include <rte_memory.h>
@@ -255,10 +255,7 @@ dpaax_iova_table_populate(void)
 void
 dpaax_iova_table_depopulate(void)
 {
-	if (dpaax_iova_table_p == NULL)
-		return;
-
-	rte_free(dpaax_iova_table_p->entries);
+	rte_free(dpaax_iova_table_p);
 	dpaax_iova_table_p = NULL;
 
 	DPAAX_DEBUG("IOVA Table cleaned");
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-15 16:19:36.547200055 +0100
+++ 0037-common-dpaax-fix-IOVA-table-cleanup.patch	2024-07-15 16:19:34.532205695 +0100
@@ -1 +1 @@
-From 3a3cdff440fe6b98b95f798caf7a4583a49ebe08 Mon Sep 17 00:00:00 2001
+From 041e6663bd8ed4da45cd30e24b96a7494c953c53 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 3a3cdff440fe6b98b95f798caf7a4583a49ebe08 ]
+
@@ -9 +10,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'common/dpaax: fix node array overrun' has been queued to stable release 22.11.6
  2024-07-15 15:25   ` patch 'config: fix warning for cross build with meson >= 1.3.0' " luca.boccassi
                       ` (35 preceding siblings ...)
  2024-07-15 15:26     ` patch 'common/dpaax: fix IOVA table cleanup' " luca.boccassi
@ 2024-07-15 15:26     ` luca.boccassi
  2024-07-15 15:26     ` patch 'bus/dpaa: remove redundant file descriptor check' " luca.boccassi
                       ` (47 subsequent siblings)
  84 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-07-15 15:26 UTC (permalink / raw)
  To: Apeksha Gupta; +Cc: Vanshika Shukla, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/55950c7aa54f377fc6de2b3249b323506b96bbda

Thanks.

Luca Boccassi

---
From 55950c7aa54f377fc6de2b3249b323506b96bbda Mon Sep 17 00:00:00 2001
From: Apeksha Gupta <apeksha.gupta@nxp.com>
Date: Wed, 10 Jul 2024 14:25:30 +0530
Subject: [PATCH] common/dpaax: fix node array overrun

[ upstream commit fae5c5cf59b13efa1fe40d9dd75e0c8731dc46b1 ]

Out-of-bounds read, overrunning dynamic array nodes at offset
corresponding to index variable j.

Fixes: 2f3d633aa593 ("common/dpaax: add library for PA/VA translation table")

Signed-off-by: Apeksha Gupta <apeksha.gupta@nxp.com>
Signed-off-by: Vanshika Shukla <vanshika.shukla@nxp.com>
---
 drivers/common/dpaax/dpaax_iova_table.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/common/dpaax/dpaax_iova_table.c b/drivers/common/dpaax/dpaax_iova_table.c
index d2a78f4c19..860e702333 100644
--- a/drivers/common/dpaax/dpaax_iova_table.c
+++ b/drivers/common/dpaax/dpaax_iova_table.c
@@ -139,10 +139,12 @@ read_memory_node(unsigned int *count)
 	}
 
 	DPAAX_DEBUG("Device-tree memory node data:");
-	do {
+
+	while (j > 0) {
+		--j;
 		DPAAX_DEBUG("    %08" PRIx64 " %08zu",
 			    nodes[j].addr, nodes[j].len);
-	} while (--j);
+	}
 
 cleanup:
 	close(fd);
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-15 16:19:36.590856580 +0100
+++ 0038-common-dpaax-fix-node-array-overrun.patch	2024-07-15 16:19:34.532205695 +0100
@@ -1 +1 @@
-From fae5c5cf59b13efa1fe40d9dd75e0c8731dc46b1 Mon Sep 17 00:00:00 2001
+From 55950c7aa54f377fc6de2b3249b323506b96bbda Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit fae5c5cf59b13efa1fe40d9dd75e0c8731dc46b1 ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'bus/dpaa: remove redundant file descriptor check' has been queued to stable release 22.11.6
  2024-07-15 15:25   ` patch 'config: fix warning for cross build with meson >= 1.3.0' " luca.boccassi
                       ` (36 preceding siblings ...)
  2024-07-15 15:26     ` patch 'common/dpaax: fix node array overrun' " luca.boccassi
@ 2024-07-15 15:26     ` luca.boccassi
  2024-07-15 15:26     ` patch 'net/dpaa: forbid MTU configuration for shared interface' " luca.boccassi
                       ` (46 subsequent siblings)
  84 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-07-15 15:26 UTC (permalink / raw)
  To: Rohit Raj; +Cc: Vanshika Shukla, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/b7594f8f156098c3e00f7f005f44758f770542f2

Thanks.

Luca Boccassi

---
From b7594f8f156098c3e00f7f005f44758f770542f2 Mon Sep 17 00:00:00 2001
From: Rohit Raj <rohit.raj@nxp.com>
Date: Wed, 10 Jul 2024 14:25:31 +0530
Subject: [PATCH] bus/dpaa: remove redundant file descriptor check

[ upstream commit 0ca2093f6b3608467bebe9caf27ce98671fb3381 ]

This patch removes the redundant file descriptor check.

Coverity issue: 425715
Fixes: 2f3d633aa593 ("common/dpaax: add library for PA/VA translation table")

Signed-off-by: Rohit Raj <rohit.raj@nxp.com>
Signed-off-by: Vanshika Shukla <vanshika.shukla@nxp.com>
---
 drivers/bus/dpaa/base/qbman/process.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/bus/dpaa/base/qbman/process.c b/drivers/bus/dpaa/base/qbman/process.c
index 3504ec97db..3e4622f606 100644
--- a/drivers/bus/dpaa/base/qbman/process.c
+++ b/drivers/bus/dpaa/base/qbman/process.c
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
  *
  * Copyright 2011-2016 Freescale Semiconductor Inc.
- * Copyright 2017,2020 NXP
+ * Copyright 2017,2020,2022,2024 NXP
  *
  */
 #include <assert.h>
@@ -27,15 +27,16 @@ static int check_fd(void)
 {
 	int ret;
 
-	if (fd >= 0)
-		return 0;
 	ret = pthread_mutex_lock(&fd_init_lock);
 	assert(!ret);
+
 	/* check again with the lock held */
 	if (fd < 0)
 		fd = open(PROCESS_PATH, O_RDWR);
+
 	ret = pthread_mutex_unlock(&fd_init_lock);
 	assert(!ret);
+
 	return (fd >= 0) ? 0 : -ENODEV;
 }
 
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-15 16:19:36.635580126 +0100
+++ 0039-bus-dpaa-remove-redundant-file-descriptor-check.patch	2024-07-15 16:19:34.532205695 +0100
@@ -1 +1 @@
-From 0ca2093f6b3608467bebe9caf27ce98671fb3381 Mon Sep 17 00:00:00 2001
+From b7594f8f156098c3e00f7f005f44758f770542f2 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 0ca2093f6b3608467bebe9caf27ce98671fb3381 ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -19 +20 @@
-index 59e0d641ce..2d805c5bd9 100644
+index 3504ec97db..3e4622f606 100644
@@ -31 +32 @@
-@@ -28,15 +28,16 @@ static int check_fd(void)
+@@ -27,15 +27,16 @@ static int check_fd(void)

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/dpaa: forbid MTU configuration for shared interface' has been queued to stable release 22.11.6
  2024-07-15 15:25   ` patch 'config: fix warning for cross build with meson >= 1.3.0' " luca.boccassi
                       ` (37 preceding siblings ...)
  2024-07-15 15:26     ` patch 'bus/dpaa: remove redundant file descriptor check' " luca.boccassi
@ 2024-07-15 15:26     ` luca.boccassi
  2024-07-15 15:26     ` patch 'net/mlx5: fix start without duplicate flow patterns' " luca.boccassi
                       ` (45 subsequent siblings)
  84 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-07-15 15:26 UTC (permalink / raw)
  To: Rohit Raj; +Cc: Vanshika Shukla, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/c1257d39c700b7bf9fe7c73a23e21adf64193ff7

Thanks.

Luca Boccassi

---
From c1257d39c700b7bf9fe7c73a23e21adf64193ff7 Mon Sep 17 00:00:00 2001
From: Rohit Raj <rohit.raj@nxp.com>
Date: Wed, 10 Jul 2024 14:25:33 +0530
Subject: [PATCH] net/dpaa: forbid MTU configuration for shared interface

[ upstream commit ee0fa7552a0af02e2151414aeec2ce4e12a2e806 ]

Since DPDK was able to configure mtu in VSP/Shared interface mode,
it was causing misconfiguration of the hw which further caused crashes.

This patch allows only kernel to config MTU in such cases.

Fixes: e4abd4ff183c ("net/dpaa: support virtual storage profile")

Signed-off-by: Rohit Raj <rohit.raj@nxp.com>
Signed-off-by: Vanshika Shukla <vanshika.shukla@nxp.com>
---
 drivers/net/dpaa/dpaa_ethdev.c | 33 +++++++++++++++++++++++++++++++--
 1 file changed, 31 insertions(+), 2 deletions(-)

diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index 779bdc5860..bcb28f33ee 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -14,6 +14,7 @@
 #include <pthread.h>
 #include <sys/types.h>
 #include <sys/syscall.h>
+#include <sys/ioctl.h>
 
 #include <rte_string_fns.h>
 #include <rte_byteorder.h>
@@ -165,9 +166,15 @@ dpaa_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
 	uint32_t frame_size = mtu + RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN
 				+ VLAN_TAG_SIZE;
 	uint32_t buffsz = dev->data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM;
+	struct fman_if *fif = dev->process_private;
 
 	PMD_INIT_FUNC_TRACE();
 
+	if (fif->is_shared_mac) {
+		DPAA_PMD_ERR("Cannot configure mtu from DPDK in VSP mode.");
+		return -ENOTSUP;
+	}
+
 	/*
 	 * Refuse mtu that requires the support of scattered packets
 	 * when this feature has not been enabled before.
@@ -206,7 +213,8 @@ dpaa_eth_dev_configure(struct rte_eth_dev *dev)
 	struct rte_intr_handle *intr_handle;
 	uint32_t max_rx_pktlen;
 	int speed, duplex;
-	int ret, rx_status;
+	int ret, rx_status, socket_fd;
+	struct ifreq ifr;
 
 	PMD_INIT_FUNC_TRACE();
 
@@ -222,6 +230,26 @@ dpaa_eth_dev_configure(struct rte_eth_dev *dev)
 				     dpaa_intf->name);
 			return -EHOSTDOWN;
 		}
+
+		socket_fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_IP);
+		if (socket_fd == -1) {
+			DPAA_PMD_ERR("Cannot open IF socket");
+			return -errno;
+		}
+
+		strncpy(ifr.ifr_name, dpaa_intf->name, IFNAMSIZ - 1);
+
+		if (ioctl(socket_fd, SIOCGIFMTU, &ifr) < 0) {
+			DPAA_PMD_ERR("Cannot get interface mtu");
+			close(socket_fd);
+			return -errno;
+		}
+
+		close(socket_fd);
+		DPAA_PMD_INFO("Using kernel configured mtu size(%u)",
+			     ifr.ifr_mtu);
+
+		eth_conf->rxmode.mtu = ifr.ifr_mtu;
 	}
 
 	/* Rx offloads which are enabled by default */
@@ -249,7 +277,8 @@ dpaa_eth_dev_configure(struct rte_eth_dev *dev)
 		max_rx_pktlen = DPAA_MAX_RX_PKT_LEN;
 	}
 
-	fman_if_set_maxfrm(dev->process_private, max_rx_pktlen);
+	if (!fif->is_shared_mac)
+		fman_if_set_maxfrm(dev->process_private, max_rx_pktlen);
 
 	if (rx_offloads & RTE_ETH_RX_OFFLOAD_SCATTER) {
 		DPAA_PMD_DEBUG("enabling scatter mode");
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-15 16:19:36.683813201 +0100
+++ 0040-net-dpaa-forbid-MTU-configuration-for-shared-interfa.patch	2024-07-15 16:19:34.536205780 +0100
@@ -1 +1 @@
-From ee0fa7552a0af02e2151414aeec2ce4e12a2e806 Mon Sep 17 00:00:00 2001
+From c1257d39c700b7bf9fe7c73a23e21adf64193ff7 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit ee0fa7552a0af02e2151414aeec2ce4e12a2e806 ]
+
@@ -12 +13,0 @@
-Cc: stable@dpdk.org
@@ -21 +22 @@
-index 44bac67803..060b8c678f 100644
+index 779bdc5860..bcb28f33ee 100644

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/mlx5: fix start without duplicate flow patterns' has been queued to stable release 22.11.6
  2024-07-15 15:25   ` patch 'config: fix warning for cross build with meson >= 1.3.0' " luca.boccassi
                       ` (38 preceding siblings ...)
  2024-07-15 15:26     ` patch 'net/dpaa: forbid MTU configuration for shared interface' " luca.boccassi
@ 2024-07-15 15:26     ` luca.boccassi
  2024-07-15 15:26     ` patch 'fbarray: fix finding for unaligned length' " luca.boccassi
                       ` (44 subsequent siblings)
  84 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-07-15 15:26 UTC (permalink / raw)
  To: Rongwei Liu; +Cc: Viacheslav Ovsiienko, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/3a0b6d25c07b19625ef6d6821ff4f1cd34bf81ef

Thanks.

Luca Boccassi

---
From 3a0b6d25c07b19625ef6d6821ff4f1cd34bf81ef Mon Sep 17 00:00:00 2001
From: Rongwei Liu <rongweil@nvidia.com>
Date: Thu, 13 Jun 2024 15:45:28 +0300
Subject: [PATCH] net/mlx5: fix start without duplicate flow patterns

[ upstream commit 13b5713a627d313d4717923df4c37158b1cb4019 ]

When devargs "allow_duplicate_pattern=0" is specified, PMD won't
allow duplicated flows to be inserted and return EEXIST as rte_errno.

The queue/RSS split table is shared globally by all representors and
PMD didn't prepend port information into it, so all the following ports
tries to insert the same flows and cause PMD insertion failure.

Using the hash list to manage it can solve the issue.

Fixes: ddb68e47331e ("net/mlx5: add extended metadata mode for HWS")

Signed-off-by: Rongwei Liu <rongweil@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 drivers/net/mlx5/linux/mlx5_os.c | 106 +++++++++++++++++--------------
 drivers/net/mlx5/mlx5.c          |   2 -
 drivers/net/mlx5/mlx5.h          |   4 +-
 drivers/net/mlx5/mlx5_flow.c     |  16 ++---
 4 files changed, 67 insertions(+), 61 deletions(-)

diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c
index 8477e83917..bdb2f6fb59 100644
--- a/drivers/net/mlx5/linux/mlx5_os.c
+++ b/drivers/net/mlx5/linux/mlx5_os.c
@@ -455,15 +455,16 @@ __mlx5_discovery_misc5_cap(struct mlx5_priv *priv)
  * Routine checks the reference counter and does actual
  * resources creation/initialization only if counter is zero.
  *
- * @param[in] priv
- *   Pointer to the private device data structure.
+ * @param[in] eth_dev
+ *   Pointer to the device.
  *
  * @return
  *   Zero on success, positive error code otherwise.
  */
 static int
-mlx5_alloc_shared_dr(struct mlx5_priv *priv)
+mlx5_alloc_shared_dr(struct rte_eth_dev *eth_dev)
 {
+	struct mlx5_priv *priv = eth_dev->data->dev_private;
 	struct mlx5_dev_ctx_shared *sh = priv->sh;
 	char s[MLX5_NAME_SIZE] __rte_unused;
 	int err;
@@ -575,6 +576,44 @@ mlx5_alloc_shared_dr(struct mlx5_priv *priv)
 		err = errno;
 		goto error;
 	}
+
+	if (sh->config.dv_flow_en == 1) {
+		/* Query availability of metadata reg_c's. */
+		if (!priv->sh->metadata_regc_check_flag) {
+			err = mlx5_flow_discover_mreg_c(eth_dev);
+			if (err < 0) {
+				err = -err;
+				goto error;
+			}
+		}
+		if (!mlx5_flow_ext_mreg_supported(eth_dev)) {
+			DRV_LOG(DEBUG,
+				"port %u extensive metadata register is not supported",
+				eth_dev->data->port_id);
+			if (sh->config.dv_xmeta_en != MLX5_XMETA_MODE_LEGACY) {
+				DRV_LOG(ERR, "metadata mode %u is not supported "
+					     "(no metadata registers available)",
+					     sh->config.dv_xmeta_en);
+				err = ENOTSUP;
+				goto error;
+			}
+		}
+		if (sh->config.dv_xmeta_en != MLX5_XMETA_MODE_LEGACY &&
+		    mlx5_flow_ext_mreg_supported(eth_dev) && sh->dv_regc0_mask) {
+			sh->mreg_cp_tbl = mlx5_hlist_create(MLX5_FLOW_MREG_HNAME,
+							    MLX5_FLOW_MREG_HTABLE_SZ,
+							    false, true, eth_dev,
+							    flow_dv_mreg_create_cb,
+							    flow_dv_mreg_match_cb,
+							    flow_dv_mreg_remove_cb,
+							    flow_dv_mreg_clone_cb,
+							    flow_dv_mreg_clone_free_cb);
+			if (!sh->mreg_cp_tbl) {
+				err = ENOMEM;
+				goto error;
+			}
+		}
+	}
 #endif
 	if (!sh->tunnel_hub && sh->config.dv_miss_info)
 		err = mlx5_alloc_tunnel_hub(sh);
@@ -659,6 +698,10 @@ error:
 		mlx5_list_destroy(sh->dest_array_list);
 		sh->dest_array_list = NULL;
 	}
+	if (sh->mreg_cp_tbl) {
+		mlx5_hlist_destroy(sh->mreg_cp_tbl);
+		sh->mreg_cp_tbl = NULL;
+	}
 	return err;
 }
 
@@ -751,6 +794,10 @@ mlx5_os_free_shared_dr(struct mlx5_priv *priv)
 		mlx5_list_destroy(sh->dest_array_list);
 		sh->dest_array_list = NULL;
 	}
+	if (sh->mreg_cp_tbl) {
+		mlx5_hlist_destroy(sh->mreg_cp_tbl);
+		sh->mreg_cp_tbl = NULL;
+	}
 }
 
 /**
@@ -1508,13 +1555,6 @@ err_secondary:
 	}
 	/* Create context for virtual machine VLAN workaround. */
 	priv->vmwa_context = mlx5_vlan_vmwa_init(eth_dev, spawn->ifindex);
-	if (sh->config.dv_flow_en) {
-		err = mlx5_alloc_shared_dr(priv);
-		if (err)
-			goto error;
-		if (mlx5_flex_item_port_init(eth_dev) < 0)
-			goto error;
-	}
 	if (mlx5_devx_obj_ops_en(sh)) {
 		priv->obj_ops = devx_obj_ops;
 		mlx5_queue_counter_id_prepare(eth_dev);
@@ -1565,6 +1605,13 @@ err_secondary:
 			goto error;
 	}
 	rte_rwlock_init(&priv->ind_tbls_lock);
+	if (sh->config.dv_flow_en) {
+		err = mlx5_alloc_shared_dr(eth_dev);
+		if (err)
+			goto error;
+		if (mlx5_flex_item_port_init(eth_dev) < 0)
+			goto error;
+	}
 	if (priv->sh->config.dv_flow_en == 2) {
 #ifdef HAVE_MLX5_HWS_SUPPORT
 		if (priv->sh->config.dv_esw_en) {
@@ -1648,43 +1695,6 @@ err_secondary:
 		err = -err;
 		goto error;
 	}
-	/* Query availability of metadata reg_c's. */
-	if (!priv->sh->metadata_regc_check_flag) {
-		err = mlx5_flow_discover_mreg_c(eth_dev);
-		if (err < 0) {
-			err = -err;
-			goto error;
-		}
-	}
-	if (!mlx5_flow_ext_mreg_supported(eth_dev)) {
-		DRV_LOG(DEBUG,
-			"port %u extensive metadata register is not supported",
-			eth_dev->data->port_id);
-		if (sh->config.dv_xmeta_en != MLX5_XMETA_MODE_LEGACY) {
-			DRV_LOG(ERR, "metadata mode %u is not supported "
-				     "(no metadata registers available)",
-				     sh->config.dv_xmeta_en);
-			err = ENOTSUP;
-			goto error;
-		}
-	}
-	if (sh->config.dv_flow_en &&
-	    sh->config.dv_xmeta_en != MLX5_XMETA_MODE_LEGACY &&
-	    mlx5_flow_ext_mreg_supported(eth_dev) &&
-	    priv->sh->dv_regc0_mask) {
-		priv->mreg_cp_tbl = mlx5_hlist_create(MLX5_FLOW_MREG_HNAME,
-						      MLX5_FLOW_MREG_HTABLE_SZ,
-						      false, true, eth_dev,
-						      flow_dv_mreg_create_cb,
-						      flow_dv_mreg_match_cb,
-						      flow_dv_mreg_remove_cb,
-						      flow_dv_mreg_clone_cb,
-						    flow_dv_mreg_clone_free_cb);
-		if (!priv->mreg_cp_tbl) {
-			err = ENOMEM;
-			goto error;
-		}
-	}
 	rte_spinlock_init(&priv->shared_act_sl);
 	mlx5_flow_counter_mode_config(eth_dev);
 	mlx5_flow_drop_action_config(eth_dev);
@@ -1703,8 +1713,6 @@ error:
 		    priv->sh->config.dv_esw_en)
 			flow_hw_destroy_vport_action(eth_dev);
 #endif
-		if (priv->mreg_cp_tbl)
-			mlx5_hlist_destroy(priv->mreg_cp_tbl);
 		if (priv->sh)
 			mlx5_os_free_shared_dr(priv);
 		if (priv->nl_socket_route >= 0)
diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 96e732950d..d66254740b 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -2090,8 +2090,6 @@ mlx5_dev_close(struct rte_eth_dev *dev)
 		mlx5_devx_cmd_destroy(priv->q_counters);
 		priv->q_counters = NULL;
 	}
-	if (priv->mreg_cp_tbl)
-		mlx5_hlist_destroy(priv->mreg_cp_tbl);
 	mlx5_mprq_free_mp(dev);
 	mlx5_os_free_shared_dr(priv);
 #ifdef HAVE_MLX5_HWS_SUPPORT
diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h
index ca0e9ee647..80dcaf96a3 100644
--- a/drivers/net/mlx5/mlx5.h
+++ b/drivers/net/mlx5/mlx5.h
@@ -1412,6 +1412,8 @@ struct mlx5_dev_ctx_shared {
 		struct mlx5_hlist *flow_tbls; /* SWS flow table. */
 		struct mlx5_hlist *groups; /* HWS flow group. */
 	};
+	struct mlx5_hlist *mreg_cp_tbl;
+	/* Hash table of Rx metadata register copy table. */
 	struct mlx5_flow_tunnel_hub *tunnel_hub;
 	/* Direct Rules tables for FDB, NIC TX+RX */
 	void *dr_drop_action; /* Pointer to DR drop action, any domain. */
@@ -1771,8 +1773,6 @@ struct mlx5_priv {
 	int nl_socket_rdma; /* Netlink socket (NETLINK_RDMA). */
 	int nl_socket_route; /* Netlink socket (NETLINK_ROUTE). */
 	struct mlx5_nl_vlan_vmwa_context *vmwa_context; /* VLAN WA context. */
-	struct mlx5_hlist *mreg_cp_tbl;
-	/* Hash table of Rx metadata register copy table. */
 	struct mlx5_mtr_config mtr_config; /* Meter configuration */
 	uint8_t mtr_sfx_reg; /* Meter prefix-suffix flow match REG_C. */
 	uint8_t mtr_color_reg; /* Meter color match REG_C. */
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 1e8d9ac978..a44ccea436 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -4871,8 +4871,8 @@ flow_mreg_add_copy_action(struct rte_eth_dev *dev, uint32_t mark_id,
 	};
 
 	/* Check if already registered. */
-	MLX5_ASSERT(priv->mreg_cp_tbl);
-	entry = mlx5_hlist_register(priv->mreg_cp_tbl, mark_id, &ctx);
+	MLX5_ASSERT(priv->sh->mreg_cp_tbl);
+	entry = mlx5_hlist_register(priv->sh->mreg_cp_tbl, mark_id, &ctx);
 	if (!entry)
 		return NULL;
 	return container_of(entry, struct mlx5_flow_mreg_copy_resource,
@@ -4911,10 +4911,10 @@ flow_mreg_del_copy_action(struct rte_eth_dev *dev,
 		return;
 	mcp_res = mlx5_ipool_get(priv->sh->ipool[MLX5_IPOOL_MCP],
 				 flow->rix_mreg_copy);
-	if (!mcp_res || !priv->mreg_cp_tbl)
+	if (!mcp_res || !priv->sh->mreg_cp_tbl)
 		return;
 	MLX5_ASSERT(mcp_res->rix_flow);
-	mlx5_hlist_unregister(priv->mreg_cp_tbl, &mcp_res->hlist_ent);
+	mlx5_hlist_unregister(priv->sh->mreg_cp_tbl, &mcp_res->hlist_ent);
 	flow->rix_mreg_copy = 0;
 }
 
@@ -4936,14 +4936,14 @@ flow_mreg_del_default_copy_action(struct rte_eth_dev *dev)
 	uint32_t mark_id;
 
 	/* Check if default flow is registered. */
-	if (!priv->mreg_cp_tbl)
+	if (!priv->sh->mreg_cp_tbl)
 		return;
 	mark_id = MLX5_DEFAULT_COPY_ID;
 	ctx.data = &mark_id;
-	entry = mlx5_hlist_lookup(priv->mreg_cp_tbl, mark_id, &ctx);
+	entry = mlx5_hlist_lookup(priv->sh->mreg_cp_tbl, mark_id, &ctx);
 	if (!entry)
 		return;
-	mlx5_hlist_unregister(priv->mreg_cp_tbl, entry);
+	mlx5_hlist_unregister(priv->sh->mreg_cp_tbl, entry);
 }
 
 /**
@@ -4981,7 +4981,7 @@ flow_mreg_add_default_copy_action(struct rte_eth_dev *dev,
 	 */
 	mark_id = MLX5_DEFAULT_COPY_ID;
 	ctx.data = &mark_id;
-	if (mlx5_hlist_lookup(priv->mreg_cp_tbl, mark_id, &ctx))
+	if (mlx5_hlist_lookup(priv->sh->mreg_cp_tbl, mark_id, &ctx))
 		return 0;
 	mcp_res = flow_mreg_add_copy_action(dev, mark_id, error);
 	if (!mcp_res)
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-15 16:19:36.730951647 +0100
+++ 0041-net-mlx5-fix-start-without-duplicate-flow-patterns.patch	2024-07-15 16:19:34.556206207 +0100
@@ -1 +1 @@
-From 13b5713a627d313d4717923df4c37158b1cb4019 Mon Sep 17 00:00:00 2001
+From 3a0b6d25c07b19625ef6d6821ff4f1cd34bf81ef Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 13b5713a627d313d4717923df4c37158b1cb4019 ]
+
@@ -16 +17,0 @@
-Cc: stable@dpdk.org
@@ -28 +29 @@
-index 1753acd050..50f4810bff 100644
+index 8477e83917..bdb2f6fb59 100644
@@ -31 +32 @@
-@@ -467,15 +467,16 @@ __mlx5_discovery_misc5_cap(struct mlx5_priv *priv)
+@@ -455,15 +455,16 @@ __mlx5_discovery_misc5_cap(struct mlx5_priv *priv)
@@ -51 +52 @@
-@@ -590,6 +591,44 @@ mlx5_alloc_shared_dr(struct mlx5_priv *priv)
+@@ -575,6 +576,44 @@ mlx5_alloc_shared_dr(struct mlx5_priv *priv)
@@ -96 +97 @@
-@@ -674,6 +713,10 @@ error:
+@@ -659,6 +698,10 @@ error:
@@ -107 +108 @@
-@@ -771,6 +814,10 @@ mlx5_os_free_shared_dr(struct mlx5_priv *priv)
+@@ -751,6 +794,10 @@ mlx5_os_free_shared_dr(struct mlx5_priv *priv)
@@ -118 +119 @@
-@@ -1572,13 +1619,6 @@ err_secondary:
+@@ -1508,13 +1555,6 @@ err_secondary:
@@ -132 +133 @@
-@@ -1629,6 +1669,13 @@ err_secondary:
+@@ -1565,6 +1605,13 @@ err_secondary:
@@ -143,4 +144,4 @@
- 	if (sh->phdev->config.ipv6_tc_fallback == MLX5_IPV6_TC_UNKNOWN) {
- 		sh->phdev->config.ipv6_tc_fallback = MLX5_IPV6_TC_OK;
- 		if (!sh->cdev->config.hca_attr.modify_outer_ipv6_traffic_class ||
-@@ -1715,43 +1762,6 @@ err_secondary:
+ 	if (priv->sh->config.dv_flow_en == 2) {
+ #ifdef HAVE_MLX5_HWS_SUPPORT
+ 		if (priv->sh->config.dv_esw_en) {
+@@ -1648,43 +1695,6 @@ err_secondary:
@@ -190 +191 @@
-@@ -1770,8 +1780,6 @@ error:
+@@ -1703,8 +1713,6 @@ error:
@@ -200 +201 @@
-index 997b02c571..e482f7f0e5 100644
+index 96e732950d..d66254740b 100644
@@ -203 +204 @@
-@@ -2394,8 +2394,6 @@ mlx5_dev_close(struct rte_eth_dev *dev)
+@@ -2090,8 +2090,6 @@ mlx5_dev_close(struct rte_eth_dev *dev)
@@ -213 +214 @@
-index c9a3837bd2..bd149b43e5 100644
+index ca0e9ee647..80dcaf96a3 100644
@@ -216 +217 @@
-@@ -1542,6 +1542,8 @@ struct mlx5_dev_ctx_shared {
+@@ -1412,6 +1412,8 @@ struct mlx5_dev_ctx_shared {
@@ -225 +226 @@
-@@ -1968,8 +1970,6 @@ struct mlx5_priv {
+@@ -1771,8 +1773,6 @@ struct mlx5_priv {
@@ -233 +234 @@
- 	struct mlx5_legacy_flow_meters flow_meters; /* MTR list. */
+ 	uint8_t mtr_color_reg; /* Meter color match REG_C. */
@@ -235 +236 @@
-index daf0e41c6f..833db1f320 100644
+index 1e8d9ac978..a44ccea436 100644
@@ -238 +239 @@
-@@ -5201,8 +5201,8 @@ flow_mreg_add_copy_action(struct rte_eth_dev *dev, uint32_t mark_id,
+@@ -4871,8 +4871,8 @@ flow_mreg_add_copy_action(struct rte_eth_dev *dev, uint32_t mark_id,
@@ -249 +250 @@
-@@ -5241,10 +5241,10 @@ flow_mreg_del_copy_action(struct rte_eth_dev *dev,
+@@ -4911,10 +4911,10 @@ flow_mreg_del_copy_action(struct rte_eth_dev *dev,
@@ -262 +263 @@
-@@ -5266,14 +5266,14 @@ flow_mreg_del_default_copy_action(struct rte_eth_dev *dev)
+@@ -4936,14 +4936,14 @@ flow_mreg_del_default_copy_action(struct rte_eth_dev *dev)
@@ -280 +281 @@
-@@ -5311,7 +5311,7 @@ flow_mreg_add_default_copy_action(struct rte_eth_dev *dev,
+@@ -4981,7 +4981,7 @@ flow_mreg_add_default_copy_action(struct rte_eth_dev *dev,

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'fbarray: fix finding for unaligned length' has been queued to stable release 22.11.6
  2024-07-15 15:25   ` patch 'config: fix warning for cross build with meson >= 1.3.0' " luca.boccassi
                       ` (39 preceding siblings ...)
  2024-07-15 15:26     ` patch 'net/mlx5: fix start without duplicate flow patterns' " luca.boccassi
@ 2024-07-15 15:26     ` luca.boccassi
  2024-07-15 15:26     ` patch 'buildtools: fix build with clang 17 and ASan' " luca.boccassi
                       ` (43 subsequent siblings)
  84 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-07-15 15:26 UTC (permalink / raw)
  To: Anatoly Burakov; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/73a8315608a79ab9b721d5155e407cb4f6a0499a

Thanks.

Luca Boccassi

---
From 73a8315608a79ab9b721d5155e407cb4f6a0499a Mon Sep 17 00:00:00 2001
From: Anatoly Burakov <anatoly.burakov@intel.com>
Date: Wed, 10 Jul 2024 12:49:26 +0100
Subject: [PATCH] fbarray: fix finding for unaligned length

[ upstream commit a744665d2149ba8707621c1214c798f807ec398e ]

When array length is not aligned on a power of 2, we need to mask out the
unaligned bits from the mask whenever we reach the last mask.
However, when both ignore mask (e.g. due to starting at unaligned bit) and
last index ignore mask are specified, we combine them with an OR,
which is incorrect.
Fix it to combine them with AND instead,
and add a unit test covering this case.

The reverse function does not suffer from this issue
because it does not have to deal with array end,
and array beginning is always aligned.

Fixes: c44d09811b40 ("eal: add shared indexed file-backed array")

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 app/test/test_fbarray.c             | 123 +++++++++++++++++++++-------
 lib/eal/common/eal_common_fbarray.c |   2 +-
 2 files changed, 94 insertions(+), 31 deletions(-)

diff --git a/app/test/test_fbarray.c b/app/test/test_fbarray.c
index 3be9e19e78..8a3a3d77ab 100644
--- a/app/test/test_fbarray.c
+++ b/app/test/test_fbarray.c
@@ -21,23 +21,41 @@ struct fbarray_testsuite_params {
 };
 
 static struct fbarray_testsuite_params param;
+static struct fbarray_testsuite_params unaligned;
 
 #define FBARRAY_TEST_ARR_NAME "fbarray_autotest"
 #define FBARRAY_TEST_LEN 256
+#define FBARRAY_UNALIGNED_TEST_ARR_NAME "fbarray_unaligned_autotest"
+#define FBARRAY_UNALIGNED_TEST_LEN 60
 #define FBARRAY_TEST_ELT_SZ (sizeof(int))
 
 static int autotest_setup(void)
 {
-	return rte_fbarray_init(&param.arr, FBARRAY_TEST_ARR_NAME,
+	int ret;
+
+	ret = rte_fbarray_init(&param.arr, FBARRAY_TEST_ARR_NAME,
 			FBARRAY_TEST_LEN, FBARRAY_TEST_ELT_SZ);
+	if (ret) {
+		printf("Failed to initialize test array\n");
+		return -1;
+	}
+	ret = rte_fbarray_init(&unaligned.arr, FBARRAY_UNALIGNED_TEST_ARR_NAME,
+			FBARRAY_UNALIGNED_TEST_LEN, FBARRAY_TEST_ELT_SZ);
+	if (ret) {
+		printf("Failed to initialize unaligned test array\n");
+		rte_fbarray_destroy(&param.arr);
+		return -1;
+	}
+	return 0;
 }
 
 static void autotest_teardown(void)
 {
 	rte_fbarray_destroy(&param.arr);
+	rte_fbarray_destroy(&unaligned.arr);
 }
 
-static int init_array(void)
+static int init_aligned(void)
 {
 	int i;
 	for (i = param.start; i <= param.end; i++) {
@@ -47,11 +65,35 @@ static int init_array(void)
 	return 0;
 }
 
-static void reset_array(void)
+static int init_unaligned(void)
+{
+	int i;
+	for (i = unaligned.start; i <= unaligned.end; i++) {
+		if (rte_fbarray_set_used(&unaligned.arr, i))
+			return -1;
+	}
+	return 0;
+}
+
+static void reset_aligned(void)
 {
 	int i;
 	for (i = 0; i < FBARRAY_TEST_LEN; i++)
 		rte_fbarray_set_free(&param.arr, i);
+	/* reset param as well */
+	param.start = -1;
+	param.end = -1;
+}
+
+static void reset_unaligned(void)
+{
+	int i;
+	for (i = 0; i < FBARRAY_UNALIGNED_TEST_LEN; i++)
+		rte_fbarray_set_free(&unaligned.arr, i);
+	/* reset param as well */
+	unaligned.start = -1;
+	unaligned.end = -1;
+
 }
 
 static int first_msk_test_setup(void)
@@ -59,7 +101,7 @@ static int first_msk_test_setup(void)
 	/* put all within first mask */
 	param.start = 3;
 	param.end = 10;
-	return init_array();
+	return init_aligned();
 }
 
 static int cross_msk_test_setup(void)
@@ -67,7 +109,7 @@ static int cross_msk_test_setup(void)
 	/* put all within second and third mask */
 	param.start = 70;
 	param.end = 160;
-	return init_array();
+	return init_aligned();
 }
 
 static int multi_msk_test_setup(void)
@@ -75,7 +117,7 @@ static int multi_msk_test_setup(void)
 	/* put all within first and last mask */
 	param.start = 3;
 	param.end = FBARRAY_TEST_LEN - 20;
-	return init_array();
+	return init_aligned();
 }
 
 static int last_msk_test_setup(void)
@@ -83,7 +125,7 @@ static int last_msk_test_setup(void)
 	/* put all within last mask */
 	param.start = FBARRAY_TEST_LEN - 20;
 	param.end = FBARRAY_TEST_LEN - 1;
-	return init_array();
+	return init_aligned();
 }
 
 static int full_msk_test_setup(void)
@@ -91,16 +133,7 @@ static int full_msk_test_setup(void)
 	/* fill entire mask */
 	param.start = 0;
 	param.end = FBARRAY_TEST_LEN - 1;
-	return init_array();
-}
-
-static int empty_msk_test_setup(void)
-{
-	/* do not fill anything in */
-	reset_array();
-	param.start = -1;
-	param.end = -1;
-	return 0;
+	return init_aligned();
 }
 
 static int lookahead_test_setup(void)
@@ -108,7 +141,7 @@ static int lookahead_test_setup(void)
 	/* set index 64 as used */
 	param.start = 64;
 	param.end = 64;
-	return init_array();
+	return init_aligned();
 }
 
 static int lookbehind_test_setup(void)
@@ -116,7 +149,15 @@ static int lookbehind_test_setup(void)
 	/* set index 63 as used */
 	param.start = 63;
 	param.end = 63;
-	return init_array();
+	return init_aligned();
+}
+
+static int unaligned_test_setup(void)
+{
+	unaligned.start = 0;
+	/* leave one free bit at the end */
+	unaligned.end = FBARRAY_UNALIGNED_TEST_LEN - 2;
+	return init_unaligned();
 }
 
 static int test_invalid(void)
@@ -470,7 +511,7 @@ static int test_basic(void)
 	if (check_free())
 		return TEST_FAILED;
 
-	reset_array();
+	reset_aligned();
 
 	return TEST_SUCCESS;
 }
@@ -713,6 +754,26 @@ static int test_find(void)
 	return TEST_SUCCESS;
 }
 
+static int test_find_unaligned(void)
+{
+	TEST_ASSERT_EQUAL((int)unaligned.arr.count, unaligned.end - unaligned.start + 1,
+			"Wrong element count\n");
+	/* ensure space is free before start */
+	if (ensure_correct(&unaligned.arr, 0, unaligned.start - 1, false))
+		return TEST_FAILED;
+	/* ensure space is occupied where it's supposed to be */
+	if (ensure_correct(&unaligned.arr, unaligned.start, unaligned.end, true))
+		return TEST_FAILED;
+	/* ensure space after end is free as well */
+	if (ensure_correct(&unaligned.arr, unaligned.end + 1, FBARRAY_UNALIGNED_TEST_LEN - 1,
+			false))
+		return TEST_FAILED;
+	/* test if find_biggest API's work correctly */
+	if (test_biggest(&unaligned.arr, unaligned.start, unaligned.end))
+		return TEST_FAILED;
+	return TEST_SUCCESS;
+}
+
 static int test_empty(void)
 {
 	TEST_ASSERT_EQUAL((int)param.arr.count, 0, "Wrong element count\n");
@@ -814,17 +875,19 @@ static struct unit_test_suite fbarray_test_suite = {
 	.unit_test_cases = {
 		TEST_CASE(test_invalid),
 		TEST_CASE(test_basic),
-		TEST_CASE_ST(first_msk_test_setup, reset_array, test_find),
-		TEST_CASE_ST(cross_msk_test_setup, reset_array, test_find),
-		TEST_CASE_ST(multi_msk_test_setup, reset_array, test_find),
-		TEST_CASE_ST(last_msk_test_setup, reset_array, test_find),
-		TEST_CASE_ST(full_msk_test_setup, reset_array, test_find),
-		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_CASE_ST(first_msk_test_setup, reset_aligned, test_find),
+		TEST_CASE_ST(cross_msk_test_setup, reset_aligned, test_find),
+		TEST_CASE_ST(multi_msk_test_setup, reset_aligned, test_find),
+		TEST_CASE_ST(last_msk_test_setup, reset_aligned, test_find),
+		TEST_CASE_ST(full_msk_test_setup, reset_aligned, test_find),
+		/* empty test does not need setup */
+		TEST_CASE_ST(NULL, reset_aligned, test_empty),
+		TEST_CASE_ST(lookahead_test_setup, reset_aligned, test_lookahead),
+		TEST_CASE_ST(lookbehind_test_setup, reset_aligned, test_lookbehind),
 		/* setup for these tests is more complex so do it in test func */
-		TEST_CASE_ST(NULL, reset_array, test_lookahead_mask),
-		TEST_CASE_ST(NULL, reset_array, test_lookbehind_mask),
+		TEST_CASE_ST(NULL, reset_aligned, test_lookahead_mask),
+		TEST_CASE_ST(NULL, reset_aligned, test_lookbehind_mask),
+		TEST_CASE_ST(unaligned_test_setup, reset_unaligned, test_find_unaligned),
 		TEST_CASES_END()
 	}
 };
diff --git a/lib/eal/common/eal_common_fbarray.c b/lib/eal/common/eal_common_fbarray.c
index 34f51d8530..4b3b3904c7 100644
--- a/lib/eal/common/eal_common_fbarray.c
+++ b/lib/eal/common/eal_common_fbarray.c
@@ -173,7 +173,7 @@ find_next_n(const struct rte_fbarray *arr, unsigned int start, unsigned int n,
 
 		/* combine current ignore mask with last index ignore mask */
 		if (msk_idx == last)
-			ignore_msk |= last_msk;
+			ignore_msk &= last_msk;
 
 		/* if we have an ignore mask, ignore once */
 		if (ignore_msk) {
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-15 16:19:36.791681237 +0100
+++ 0042-fbarray-fix-finding-for-unaligned-length.patch	2024-07-15 16:19:34.564206378 +0100
@@ -1 +1 @@
-From a744665d2149ba8707621c1214c798f807ec398e Mon Sep 17 00:00:00 2001
+From 73a8315608a79ab9b721d5155e407cb4f6a0499a Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit a744665d2149ba8707621c1214c798f807ec398e ]
+
@@ -19 +20,0 @@
-Cc: stable@dpdk.org
@@ -28 +29 @@
-index 13c6691e50..09f6907fb1 100644
+index 3be9e19e78..8a3a3d77ab 100644
@@ -259 +260 @@
-index 63d8b731f5..22b43073c6 100644
+index 34f51d8530..4b3b3904c7 100644

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'buildtools: fix build with clang 17 and ASan' has been queued to stable release 22.11.6
  2024-07-15 15:25   ` patch 'config: fix warning for cross build with meson >= 1.3.0' " luca.boccassi
                       ` (40 preceding siblings ...)
  2024-07-15 15:26     ` patch 'fbarray: fix finding for unaligned length' " luca.boccassi
@ 2024-07-15 15:26     ` luca.boccassi
  2024-07-15 15:26     ` patch 'net/ice/base: fix pointer to variable outside scope' " luca.boccassi
                       ` (42 subsequent siblings)
  84 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-07-15 15:26 UTC (permalink / raw)
  To: David Marchand; +Cc: Ali Alnubani, Song Jiale, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/f7dcc5e44f9a545a5e3edfaa15a2e03516dd25f1

Thanks.

Luca Boccassi

---
From f7dcc5e44f9a545a5e3edfaa15a2e03516dd25f1 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Thu, 11 Jul 2024 11:35:36 +0200
Subject: [PATCH] buildtools: fix build with clang 17 and ASan

[ upstream commit e1d8a879abac499a66801bb8238d59ba52f4fc6b ]

ASan included in clang 17 and later suffixes symbols.
$ nm build/drivers/libtmp_rte_net_null.a | grep this_pmd
0000000000000000 r this_pmd_name3
0000000000000000 n this_pmd_name3.f2cd16678ab09dba8fd23405d8d11fce

This breaks the detection of driver symbols in pmdinfogen which then
creates duplicate symbols "_pmd_info" in many drivers. Such duplicate
symbols trigger a link error.

$ grep -w _pmd_info build/drivers/rte_net_*.pmd.c
build/drivers/rte_net_af_packet.pmd.c:const char _pmd_info[]
	__attribute__((used)) =
	"PMD_INFO_STRING= {\"name\": \"\", \"pci_ids\": []}";
build/drivers/rte_net_null.pmd.c:const char _pmd_info[]
	__attribute__((used)) =
	"PMD_INFO_STRING= {\"name\": \"\", \"pci_ids\": []}";

A simple reproducer:
$ CC=clang meson setup build -Denable_apps=test-pmd -Ddisable_libs=* \
  -Denable_drivers=net/null,net/af_packet -Dtests=false \
  -Db_lundef=false -Db_sanitize=address

$ ninja -C build

Before this patch, the pmdinfogen script was relying on a symbol name
starting with this_pmd_name.
On the other hand, what this script needs is symbols whose names are
this_pmd_name ## __COUNTER__, see below an example for PCI driver
symbols (the same applies to other buses).

$ git grep -w RTE_PMD_EXPORT_NAME drivers/bus/pci/bus_pci_driver.h
drivers/bus/pci/bus_pci_driver.h:RTE_PMD_EXPORT_NAME(nm, __COUNTER__)
$ git grep -B1 this_pmd_name lib/eal/
lib/eal/include/rte_dev.h-#define RTE_PMD_EXPORT_NAME(name, idx) \
lib/eal/include/rte_dev.h:static const char
	RTE_PMD_EXPORT_NAME_ARRAY(this_pmd_name, idx) \
$ git grep define.RTE_PMD_EXPORT_NAME_ARRAY lib/eal/include/rte_dev.h
lib/eal/include/rte_dev.h:#define
	RTE_PMD_EXPORT_NAME_ARRAY(n, idx) n##idx[]

Adjust the symbol filter for both ELF and COFF implementations.

Bugzilla ID: 1466

Reported-by: Ali Alnubani <alialnu@nvidia.com>
Reported-by: Song Jiale <songx.jiale@intel.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
Tested-by: Song Jiale <songx.jiale@intel.com>
---
 buildtools/pmdinfogen.py | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/buildtools/pmdinfogen.py b/buildtools/pmdinfogen.py
index 2a44f17bda..dfb89500c0 100755
--- a/buildtools/pmdinfogen.py
+++ b/buildtools/pmdinfogen.py
@@ -6,6 +6,7 @@
 import argparse
 import ctypes
 import json
+import re
 import sys
 import tempfile
 
@@ -66,11 +67,11 @@ class ELFImage:
                 return [symbol]
         return None
 
-    def find_by_prefix(self, prefix):
-        prefix = prefix.encode("utf-8") if self._legacy_elftools else prefix
+    def find_by_pattern(self, pattern):
+        pattern = pattern.encode("utf-8") if self._legacy_elftools else pattern
         for i in range(self._symtab.num_symbols()):
             symbol = self._symtab.get_symbol(i)
-            if symbol.name.startswith(prefix):
+            if re.match(pattern, symbol.name):
                 yield ELFSymbol(self._image, symbol)
 
 
@@ -97,9 +98,9 @@ class COFFImage:
     def is_big_endian(self):
         return False
 
-    def find_by_prefix(self, prefix):
+    def find_by_pattern(self, pattern):
         for symbol in self._image.symbols:
-            if symbol.name.startswith(prefix):
+            if re.match(pattern, symbol.name):
                 yield COFFSymbol(self._image, symbol)
 
     def find_by_name(self, name):
@@ -199,7 +200,7 @@ class Driver:
 
 def load_drivers(image):
     drivers = []
-    for symbol in image.find_by_prefix("this_pmd_name"):
+    for symbol in image.find_by_pattern("^this_pmd_name[0-9]+$"):
         drivers.append(Driver.load(image, symbol))
     return drivers
 
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-15 16:19:36.833194817 +0100
+++ 0043-buildtools-fix-build-with-clang-17-and-ASan.patch	2024-07-15 16:19:34.564206378 +0100
@@ -1 +1 @@
-From e1d8a879abac499a66801bb8238d59ba52f4fc6b Mon Sep 17 00:00:00 2001
+From f7dcc5e44f9a545a5e3edfaa15a2e03516dd25f1 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit e1d8a879abac499a66801bb8238d59ba52f4fc6b ]
+
@@ -49 +50,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/ice/base: fix pointer to variable outside scope' has been queued to stable release 22.11.6
  2024-07-15 15:25   ` patch 'config: fix warning for cross build with meson >= 1.3.0' " luca.boccassi
                       ` (41 preceding siblings ...)
  2024-07-15 15:26     ` patch 'buildtools: fix build with clang 17 and ASan' " luca.boccassi
@ 2024-07-15 15:26     ` luca.boccassi
  2024-07-15 15:26     ` patch 'net/ice/base: fix memory leak in firmware version check' " luca.boccassi
                       ` (41 subsequent siblings)
  84 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-07-15 15:26 UTC (permalink / raw)
  To: Stefan Wegrzyn; +Cc: Ian Stokes, Bruce Richardson, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/7f57a7a2ce3ccdc1061b08d0df6a0a1d02784df1

Thanks.

Luca Boccassi

---
From 7f57a7a2ce3ccdc1061b08d0df6a0a1d02784df1 Mon Sep 17 00:00:00 2001
From: Stefan Wegrzyn <stefan.wegrzyn@intel.com>
Date: Tue, 25 Jun 2024 12:12:10 +0100
Subject: [PATCH] net/ice/base: fix pointer to variable outside scope

[ upstream commit 794adf885cbbc949b4a292ce98bc57d77ea77391 ]

Currently, the 'temp' variable is in smaller scope than 'first_teid_ptr'
which can point to it. This means on new loop iterations the memory
goes out of scope and we can end up with a dangling pointer.
Move 'temp' to outside of the loop to fix it.

Fixes: 254f19c8c061 ("net/ice/base: modify recursive way of adding nodes")

Signed-off-by: Stefan Wegrzyn <stefan.wegrzyn@intel.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/ice/base/ice_sched.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ice/base/ice_sched.c b/drivers/net/ice/base/ice_sched.c
index b16b27dcbf..d505c8d16c 100644
--- a/drivers/net/ice/base/ice_sched.c
+++ b/drivers/net/ice/base/ice_sched.c
@@ -1057,11 +1057,11 @@ ice_sched_add_nodes_to_layer(struct ice_port_info *pi,
 	u32 *first_teid_ptr = first_node_teid;
 	u16 new_num_nodes = num_nodes;
 	enum ice_status status = ICE_SUCCESS;
+	u32 temp;
 
 	*num_nodes_added = 0;
 	while (*num_nodes_added < num_nodes) {
 		u16 max_child_nodes, num_added = 0;
-		u32 temp;
 
 		status = ice_sched_add_nodes_to_hw_layer(pi, tc_node, parent,
 							 layer,	new_num_nodes,
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-15 16:19:36.872273522 +0100
+++ 0044-net-ice-base-fix-pointer-to-variable-outside-scope.patch	2024-07-15 16:19:34.572206549 +0100
@@ -1 +1 @@
-From 794adf885cbbc949b4a292ce98bc57d77ea77391 Mon Sep 17 00:00:00 2001
+From 7f57a7a2ce3ccdc1061b08d0df6a0a1d02784df1 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 794adf885cbbc949b4a292ce98bc57d77ea77391 ]
+
@@ -12 +13,0 @@
-Cc: stable@dpdk.org
@@ -22 +23 @@
-index d694bfd414..c9d70fb043 100644
+index b16b27dcbf..d505c8d16c 100644
@@ -25 +26 @@
-@@ -1069,11 +1069,11 @@ ice_sched_add_nodes_to_layer(struct ice_port_info *pi,
+@@ -1057,11 +1057,11 @@ ice_sched_add_nodes_to_layer(struct ice_port_info *pi,
@@ -28 +29 @@
- 	int status = 0;
+ 	enum ice_status status = ICE_SUCCESS;

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/ice/base: fix memory leak in firmware version check' has been queued to stable release 22.11.6
  2024-07-15 15:25   ` patch 'config: fix warning for cross build with meson >= 1.3.0' " luca.boccassi
                       ` (42 preceding siblings ...)
  2024-07-15 15:26     ` patch 'net/ice/base: fix pointer to variable outside scope' " luca.boccassi
@ 2024-07-15 15:26     ` luca.boccassi
  2024-07-15 15:26     ` patch 'net/ice/base: fix sign extension' " luca.boccassi
                       ` (40 subsequent siblings)
  84 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-07-15 15:26 UTC (permalink / raw)
  To: Eric Joyner; +Cc: Ian Stokes, Bruce Richardson, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/64f49919dd07cb0b6d70c32703f0afb61de44139

Thanks.

Luca Boccassi

---
From 64f49919dd07cb0b6d70c32703f0afb61de44139 Mon Sep 17 00:00:00 2001
From: Eric Joyner <eric.joyner@intel.com>
Date: Tue, 25 Jun 2024 12:12:25 +0100
Subject: [PATCH] net/ice/base: fix memory leak in firmware version check

[ upstream commit 6b75956aacc081d56a36ab8f82c530832b288c01 ]

If ice_cfg_phy_fec() goes through case ICE_FEC_DIS_AUTO but the
underlying device firmware isn't the correct version, then the memory
used to hold the PHY capabilities output from the firmware isn't freed.

Fix this by making sure the memory is freed by jumping to the label that
frees the memory instead of returning from the version check
immediately.

Fixes: 4b6ede113f55 ("net/ice/base: support auto FEC with FEC disabled")

Signed-off-by: Eric Joyner <eric.joyner@intel.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/ice/base/ice_common.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ice/base/ice_common.c b/drivers/net/ice/base/ice_common.c
index a327a4b374..ac67411ebd 100644
--- a/drivers/net/ice/base/ice_common.c
+++ b/drivers/net/ice/base/ice_common.c
@@ -3803,8 +3803,10 @@ ice_cfg_phy_fec(struct ice_port_info *pi, struct ice_aqc_set_phy_cfg_data *cfg,
 		break;
 	case ICE_FEC_DIS_AUTO:
 		/* Set No FEC and auto FEC */
-		if (!ice_fw_supports_fec_dis_auto(hw))
-			return ICE_ERR_NOT_SUPPORTED;
+		if (!ice_fw_supports_fec_dis_auto(hw)) {
+			status = ICE_ERR_NOT_SUPPORTED;
+			goto out;
+		}
 		cfg->link_fec_opt |= ICE_AQC_PHY_FEC_DIS;
 		/* fall-through */
 	case ICE_FEC_AUTO:
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-15 16:19:36.916273769 +0100
+++ 0045-net-ice-base-fix-memory-leak-in-firmware-version-che.patch	2024-07-15 16:19:34.576206634 +0100
@@ -1 +1 @@
-From 6b75956aacc081d56a36ab8f82c530832b288c01 Mon Sep 17 00:00:00 2001
+From 64f49919dd07cb0b6d70c32703f0afb61de44139 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 6b75956aacc081d56a36ab8f82c530832b288c01 ]
+
@@ -15 +16,0 @@
-Cc: stable@dpdk.org
@@ -25 +26 @@
-index 3d787d2a29..ef6696cddf 100644
+index a327a4b374..ac67411ebd 100644
@@ -28 +29 @@
-@@ -3843,8 +3843,10 @@ ice_cfg_phy_fec(struct ice_port_info *pi, struct ice_aqc_set_phy_cfg_data *cfg,
+@@ -3803,8 +3803,10 @@ ice_cfg_phy_fec(struct ice_port_info *pi, struct ice_aqc_set_phy_cfg_data *cfg,

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/ice/base: fix sign extension' has been queued to stable release 22.11.6
  2024-07-15 15:25   ` patch 'config: fix warning for cross build with meson >= 1.3.0' " luca.boccassi
                       ` (43 preceding siblings ...)
  2024-07-15 15:26     ` patch 'net/ice/base: fix memory leak in firmware version check' " luca.boccassi
@ 2024-07-15 15:26     ` luca.boccassi
  2024-07-15 15:26     ` patch 'net/ice/base: fix size when allocating children arrays' " luca.boccassi
                       ` (39 subsequent siblings)
  84 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-07-15 15:26 UTC (permalink / raw)
  To: Jesse Brandeburg; +Cc: Ian Stokes, Bruce Richardson, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/7fdbc3da5bd6a7dac5e933fb70f2864ce108331e

Thanks.

Luca Boccassi

---
From 7fdbc3da5bd6a7dac5e933fb70f2864ce108331e Mon Sep 17 00:00:00 2001
From: Jesse Brandeburg <jesse.brandeburg@intel.com>
Date: Wed, 26 Jun 2024 12:41:03 +0100
Subject: [PATCH] net/ice/base: fix sign extension

[ upstream commit 4fe3f901f86243bf2dc5925e870030995f229888 ]

Fix a static analysis warning where if the 16-bit value in mask has the
high-bit set, it will be sign extended by the shift left (which converts
it to a signed integer). Avoid this by casting to a u32 to make sure the
conversion happens before the shift and that it stays unsigned.

Fixes: 9467486f179f ("net/ice/base: enable masking for RSS and FD field vectors")

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/ice/base/ice_flex_pipe.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ice/base/ice_flex_pipe.c b/drivers/net/ice/base/ice_flex_pipe.c
index b6bc0062a3..e1c5e00c91 100644
--- a/drivers/net/ice/base/ice_flex_pipe.c
+++ b/drivers/net/ice/base/ice_flex_pipe.c
@@ -1534,16 +1534,14 @@ ice_write_prof_mask_reg(struct ice_hw *hw, enum ice_block blk, u16 mask_idx,
 	switch (blk) {
 	case ICE_BLK_RSS:
 		offset = GLQF_HMASK(mask_idx);
-		val = (idx << GLQF_HMASK_MSK_INDEX_S) &
-			GLQF_HMASK_MSK_INDEX_M;
-		val |= (mask << GLQF_HMASK_MASK_S) & GLQF_HMASK_MASK_M;
+		val = (idx << GLQF_HMASK_MSK_INDEX_S) & GLQF_HMASK_MSK_INDEX_M;
+		val |= ((u32)mask << GLQF_HMASK_MASK_S) & GLQF_HMASK_MASK_M;
 		break;
 	case ICE_BLK_FD:
 		offset = GLQF_FDMASK(mask_idx);
 		val = (idx << GLQF_FDMASK_MSK_INDEX_S) &
 			GLQF_FDMASK_MSK_INDEX_M;
-		val |= (mask << GLQF_FDMASK_MASK_S) &
-			GLQF_FDMASK_MASK_M;
+		val |= ((u32)mask << GLQF_FDMASK_MASK_S) & GLQF_FDMASK_MASK_M;
 		break;
 	default:
 		ice_debug(hw, ICE_DBG_PKG, "No profile masks for block %d\n",
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-15 16:19:36.964447872 +0100
+++ 0046-net-ice-base-fix-sign-extension.patch	2024-07-15 16:19:34.580206719 +0100
@@ -1 +1 @@
-From 4fe3f901f86243bf2dc5925e870030995f229888 Mon Sep 17 00:00:00 2001
+From 7fdbc3da5bd6a7dac5e933fb70f2864ce108331e Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 4fe3f901f86243bf2dc5925e870030995f229888 ]
+
@@ -12 +13,0 @@
-Cc: stable@dpdk.org
@@ -22 +23 @@
-index e06dbb0885..413b6f8ece 100644
+index b6bc0062a3..e1c5e00c91 100644

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/ice/base: fix size when allocating children arrays' has been queued to stable release 22.11.6
  2024-07-15 15:25   ` patch 'config: fix warning for cross build with meson >= 1.3.0' " luca.boccassi
                       ` (44 preceding siblings ...)
  2024-07-15 15:26     ` patch 'net/ice/base: fix sign extension' " luca.boccassi
@ 2024-07-15 15:26     ` luca.boccassi
  2024-07-15 15:26     ` patch 'net/ice/base: fix GCS descriptor field offsets' " luca.boccassi
                       ` (38 subsequent siblings)
  84 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-07-15 15:26 UTC (permalink / raw)
  To: Jacob Keller; +Cc: Ian Stokes, Bruce Richardson, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/f3701c8b98920a64c3774b5a250ba48512c1fda8

Thanks.

Luca Boccassi

---
From f3701c8b98920a64c3774b5a250ba48512c1fda8 Mon Sep 17 00:00:00 2001
From: Jacob Keller <jacob.e.keller@intel.com>
Date: Wed, 26 Jun 2024 12:41:08 +0100
Subject: [PATCH] net/ice/base: fix size when allocating children arrays

[ upstream commit 3072e5e2da9870d8cb119f15482eae9d9fb51e98 ]

The ice_sched_add_root_node() and ice_sched_add_node() functions have
comments to suppress Coverity warnings about a suspicious sizeof used
when allocating the children array of an struct ice_sched_node.

The size is calculated using the size of the scheduler node, which
overallocates the array by a significant amount.

Fix the code to correctly calculate the size by using *root->children
and *node->children respectively.

This saves some memory and allows us to drop the Coverity suppression
comments.

Fixes: 93e84b1bfc92 ("net/ice/base: add basic Tx scheduler")

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/ice/base/ice_sched.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ice/base/ice_sched.c b/drivers/net/ice/base/ice_sched.c
index d505c8d16c..25bf3fca76 100644
--- a/drivers/net/ice/base/ice_sched.c
+++ b/drivers/net/ice/base/ice_sched.c
@@ -28,9 +28,8 @@ ice_sched_add_root_node(struct ice_port_info *pi,
 	if (!root)
 		return ICE_ERR_NO_MEMORY;
 
-	/* coverity[suspicious_sizeof] */
 	root->children = (struct ice_sched_node **)
-		ice_calloc(hw, hw->max_children[0], sizeof(*root));
+		ice_calloc(hw, hw->max_children[0], sizeof(*root->children));
 	if (!root->children) {
 		ice_free(hw, root);
 		return ICE_ERR_NO_MEMORY;
@@ -180,9 +179,9 @@ ice_sched_add_node(struct ice_port_info *pi, u8 layer,
 	if (!node)
 		return ICE_ERR_NO_MEMORY;
 	if (hw->max_children[layer]) {
-		/* coverity[suspicious_sizeof] */
 		node->children = (struct ice_sched_node **)
-			ice_calloc(hw, hw->max_children[layer], sizeof(*node));
+			ice_calloc(hw, hw->max_children[layer],
+				   sizeof(*node->children));
 		if (!node->children) {
 			ice_free(hw, node);
 			return ICE_ERR_NO_MEMORY;
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-15 16:19:37.009241692 +0100
+++ 0047-net-ice-base-fix-size-when-allocating-children-array.patch	2024-07-15 16:19:34.588206890 +0100
@@ -1 +1 @@
-From 3072e5e2da9870d8cb119f15482eae9d9fb51e98 Mon Sep 17 00:00:00 2001
+From f3701c8b98920a64c3774b5a250ba48512c1fda8 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 3072e5e2da9870d8cb119f15482eae9d9fb51e98 ]
+
@@ -20 +21,0 @@
-Cc: stable@dpdk.org
@@ -30 +31 @@
-index c9d70fb043..74d57329da 100644
+index d505c8d16c..25bf3fca76 100644
@@ -44 +45 @@
-@@ -186,9 +185,9 @@ ice_sched_add_node(struct ice_port_info *pi, u8 layer,
+@@ -180,9 +179,9 @@ ice_sched_add_node(struct ice_port_info *pi, u8 layer,

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/ice/base: fix GCS descriptor field offsets' has been queued to stable release 22.11.6
  2024-07-15 15:25   ` patch 'config: fix warning for cross build with meson >= 1.3.0' " luca.boccassi
                       ` (45 preceding siblings ...)
  2024-07-15 15:26     ` patch 'net/ice/base: fix size when allocating children arrays' " luca.boccassi
@ 2024-07-15 15:26     ` luca.boccassi
  2024-07-15 15:26     ` patch 'net/ice/base: fix return type of bitmap hamming weight' " luca.boccassi
                       ` (37 subsequent siblings)
  84 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-07-15 15:26 UTC (permalink / raw)
  To: Eric Joyner; +Cc: Ian Stokes, Bruce Richardson, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.6

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/92938d56d0f7ea32972107db372ee83cb3037421

Thanks.

Luca Boccassi

---
From 92938d56d0f7ea32972107db372ee83cb3037421 Mon Sep 17 00:00:00 2001
From: Eric Joyner <eric.joyner@intel.com>
Date: Wed, 26 Jun 2024 12:41:09 +0100
Subject: [PATCH] net/ice/base: fix GCS descriptor field offsets

[ upstream commit 243ec291b1eba3ddf7554c9c80a173e9aee58b68 ]

Update the offsets, and remove the ICE_TX_GCS_DESC_ENA define since a
non-0 value used for the ICE_TX_GCS_DESC_TYPE field will enable GCS
offload; there is no dedicated bit to enable it anymore.

Fixes: c31095a0b20f ("net/ice/base: add GCO defines and GCO flex descriptor")

Signed-off-by: Eric Joyner <eric.joyner@intel.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/ice/base/ice_lan_tx_rx.h | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ice/base/ice_lan_tx_rx.h b/drivers/net/ice/base/ice_lan_tx_rx.h
index be6d88f0ca..cd12d47d9b 100644
--- a/drivers/net/ice/base/ice_lan_tx_rx.h
+++ b/drivers/net/ice/base/ice_lan_tx_rx.h
@@ -1074,10 +1074,9 @@ struct ice_tx_ctx_desc {
 	__le64 qw1;
 };
 
-#define ICE_TX_GSC_DESC_START	0  /* 7 BITS */
-#define ICE_TX_GSC_DESC_OFFSET	7  /* 4 BITS */
-#define ICE_TX_GSC_DESC_TYPE	11 /* 2 BITS */
-#define ICE_TX_GSC_DESC_ENA	13 /* 1 BIT */
+#define ICE_TX_GCS_DESC_START	0  /* 8 BITS */
+#define ICE_TX_GCS_DESC_OFFSET	8  /* 4 BITS */
+#define ICE_TX_GCS_DESC_TYPE	12 /* 3 BITS */
 
 #define ICE_TXD_CTX_QW1_DTYPE_S	0
 #define ICE_TXD_CTX_QW1_DTYPE_M	(0xFUL << ICE_TXD_CTX_QW1_DTYPE_S)
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-15 16:19:37.064054551 +0100
+++ 0048-net-ice-base-fix-GCS-descriptor-field-offsets.patch	2024-07-15 16:19:34.588206890 +0100
@@ -1 +1 @@
-From 243ec291b1eba3ddf7554c9c80a173e9aee58b68 Mon Sep 17 00:00:00 2001
+From 92938d56d0f7ea32972107db372ee83cb3037421 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 243ec291b1eba3ddf7554c9c80a173e9aee58b68 ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org
@@ -21 +22 @@
-index d816df0ff6..39673e36f7 100644
+index be6d88f0ca..cd12d47d9b 100644

^ permalink raw reply	[flat|nested] 167+ messages in thread

* patch 'net/ice/base: fix return type of bitmap hamming weight' has been queued to stable release 22.11.6
  2024-07-15 15:25   ` patch 'config: fix warning for cross build with meson >= 1.3.0' " luca.boccassi
                       ` (46 preceding siblings ...)
  2024-07-15 15:26     ` patch 'net/ice/base: fix GCS descriptor field offsets' " luca.boccassi
@ 2024-07-15 15:26     ` luca.boccassi
  2024-07-15 15:26     ` patch 'net/ice/base: fix check for existing switch rule' " luca.boccassi
                       ` (36 subsequent siblings)
  84 siblings, 0 replies; 167+ messages in thread
From: luca.boccassi @ 2024-07-15 15:26 UTC (