patches for DPDK stable branches
 help / color / mirror / Atom feed
* patch 'raw/ifpga: remove virtual devices on close' has been queued to stable release 21.11.2
@ 2022-06-20  9:47 Kevin Traynor
  2022-06-20  9:47 ` patch 'raw/ifpga: unregister interrupt " Kevin Traynor
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: Kevin Traynor @ 2022-06-20  9:47 UTC (permalink / raw)
  To: Wei Huang; +Cc: Tianfei Zhang, Rosen Xu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 21.11.2

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/23/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

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

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

Thanks.

Kevin

---
From 56e6acc152ee763d61ca3b018c46bc23a542710a Mon Sep 17 00:00:00 2001
From: Wei Huang <wei.huang@intel.com>
Date: Tue, 7 Jun 2022 05:07:21 -0400
Subject: [PATCH] raw/ifpga: remove virtual devices on close

[ upstream commit ae835aba40349ee9631ef6b52e68a2893febe7e0 ]

Virtual devices created on ifpga raw device will not be removed
when ifpga device has closed. To avoid resource leak problem,
this patch introduces an ifpga virtual device remove function,
virtual devices will be destroyed after the ifpga raw device closed.

Fixes: ef1e8ede3da5 ("raw/ifpga: add Intel FPGA bus rawdev driver")

Signed-off-by: Wei Huang <wei.huang@intel.com>
Acked-by: Tianfei Zhang <tianfei.zhang@intel.com>
Reviewed-by: Rosen Xu <rosen.xu@intel.com>
---
 drivers/raw/ifpga/ifpga_rawdev.c | 176 +++++++++++++++++++++++--------
 drivers/raw/ifpga/ifpga_rawdev.h |   8 ++
 2 files changed, 142 insertions(+), 42 deletions(-)

diff --git a/drivers/raw/ifpga/ifpga_rawdev.c b/drivers/raw/ifpga/ifpga_rawdev.c
index 75800aed3a..b456feac9a 100644
--- a/drivers/raw/ifpga/ifpga_rawdev.c
+++ b/drivers/raw/ifpga/ifpga_rawdev.c
@@ -135,4 +135,6 @@ ifpga_rawdev_allocate(struct rte_rawdev *rawdev)
 		dev->intr_handle[i] = NULL;
 	dev->poll_enabled = 0;
+	for (i = 0; i < IFPGA_MAX_VDEV; i++)
+		dev->vdev_name[i] = NULL;
 
 	return dev;
@@ -737,8 +739,20 @@ static int
 ifpga_rawdev_close(struct rte_rawdev *dev)
 {
+	struct ifpga_rawdev *ifpga_rdev = NULL;
 	struct opae_adapter *adapter;
+	char *vdev_name = NULL;
+	int i = 0;
 
 	if (dev) {
-		ifpga_monitor_stop_func(ifpga_rawdev_get(dev));
+		ifpga_rdev = ifpga_rawdev_get(dev);
+		if (ifpga_rdev) {
+			for (i = 0; i < IFPGA_MAX_VDEV; i++) {
+				vdev_name = ifpga_rdev->vdev_name[i];
+				if (vdev_name)
+					rte_vdev_uninit(vdev_name);
+			}
+			ifpga_monitor_stop_func(ifpga_rdev);
+			ifpga_rdev->rawdev = NULL;
+		}
 		adapter = ifpga_rawdev_get_priv(dev);
 		if (adapter) {
@@ -1640,6 +1654,4 @@ ifpga_rawdev_destroy(struct rte_pci_device *pci_dev)
 	}
 	dev = ifpga_rawdev_get(rawdev);
-	if (dev)
-		dev->rawdev = NULL;
 
 	adapter = ifpga_rawdev_get_priv(rawdev);
@@ -1716,73 +1728,116 @@ static int ifpga_rawdev_get_string_arg(const char *key __rte_unused,
 	return 0;
 }
+
 static int
-ifpga_cfg_probe(struct rte_vdev_device *dev)
+ifpga_vdev_parse_devargs(struct rte_devargs *devargs,
+	struct ifpga_vdev_args *args)
 {
-	struct rte_devargs *devargs;
-	struct rte_kvargs *kvlist = NULL;
-	struct rte_rawdev *rawdev = NULL;
-	struct ifpga_rawdev *ifpga_dev;
-	int port;
+	struct rte_kvargs *kvlist;
 	char *name = NULL;
-	char dev_name[RTE_RAWDEV_NAME_MAX_LEN];
-	int ret = -1;
+	int port = 0;
+	int ret = -EINVAL;
 
-	devargs = dev->device.devargs;
+	if (!devargs || !args)
+		return ret;
 
 	kvlist = rte_kvargs_parse(devargs->args, valid_args);
 	if (!kvlist) {
-		IFPGA_RAWDEV_PMD_LOG(ERR, "error when parsing param");
-		goto end;
+		IFPGA_RAWDEV_PMD_ERR("error when parsing devargs");
+		return ret;
 	}
 
 	if (rte_kvargs_count(kvlist, IFPGA_ARG_NAME) == 1) {
 		if (rte_kvargs_process(kvlist, IFPGA_ARG_NAME,
-				       &ifpga_rawdev_get_string_arg,
-				       &name) < 0) {
+			&ifpga_rawdev_get_string_arg, &name) < 0) {
 			IFPGA_RAWDEV_PMD_ERR("error to parse %s",
-				     IFPGA_ARG_NAME);
+				IFPGA_ARG_NAME);
 			goto end;
+		} else {
+			strlcpy(args->bdf, name, sizeof(args->bdf));
+			rte_free(name);
 		}
 	} else {
 		IFPGA_RAWDEV_PMD_ERR("arg %s is mandatory for ifpga bus",
-			  IFPGA_ARG_NAME);
+			IFPGA_ARG_NAME);
 		goto end;
 	}
 
 	if (rte_kvargs_count(kvlist, IFPGA_ARG_PORT) == 1) {
-		if (rte_kvargs_process(kvlist,
-			IFPGA_ARG_PORT,
-			&rte_ifpga_get_integer32_arg,
-			&port) < 0) {
+		if (rte_kvargs_process(kvlist, IFPGA_ARG_PORT,
+			&rte_ifpga_get_integer32_arg, &port) < 0) {
 			IFPGA_RAWDEV_PMD_ERR("error to parse %s",
 				IFPGA_ARG_PORT);
 			goto end;
+		} else {
+			args->port = port;
 		}
 	} else {
 		IFPGA_RAWDEV_PMD_ERR("arg %s is mandatory for ifpga bus",
-			  IFPGA_ARG_PORT);
+			IFPGA_ARG_PORT);
 		goto end;
 	}
 
-	memset(dev_name, 0, sizeof(dev_name));
-	snprintf(dev_name, RTE_RAWDEV_NAME_MAX_LEN, "IFPGA:%s", name);
-	rawdev = rte_rawdev_pmd_get_named_dev(dev_name);
-	if (!rawdev)
-		goto end;
-	ifpga_dev = ifpga_rawdev_get(rawdev);
-	if (!ifpga_dev)
-		goto end;
+	ret = 0;
 
-	memset(dev_name, 0, sizeof(dev_name));
-	snprintf(dev_name, RTE_RAWDEV_NAME_MAX_LEN, "%d|%s",
-	port, name);
-
-	ret = rte_eal_hotplug_add(RTE_STR(IFPGA_BUS_NAME),
-			dev_name, devargs->args);
 end:
 	if (kvlist)
 		rte_kvargs_free(kvlist);
-	if (name)
-		free(name);
+
+	return ret;
+}
+
+static int
+ifpga_cfg_probe(struct rte_vdev_device *vdev)
+{
+	struct rte_rawdev *rawdev = NULL;
+	struct ifpga_rawdev *ifpga_dev;
+	struct ifpga_vdev_args args;
+	char dev_name[RTE_RAWDEV_NAME_MAX_LEN];
+	const char *vdev_name = NULL;
+	int i, n, ret = 0;
+
+	vdev_name = rte_vdev_device_name(vdev);
+	if (!vdev_name)
+		return -EINVAL;
+
+	IFPGA_RAWDEV_PMD_INFO("probe ifpga virtual device %s", vdev_name);
+
+	ret = ifpga_vdev_parse_devargs(vdev->device.devargs, &args);
+	if (ret)
+		return ret;
+
+	memset(dev_name, 0, sizeof(dev_name));
+	snprintf(dev_name, RTE_RAWDEV_NAME_MAX_LEN, "IFPGA:%s", args.bdf);
+	rawdev = rte_rawdev_pmd_get_named_dev(dev_name);
+	if (!rawdev)
+		return -ENODEV;
+	ifpga_dev = ifpga_rawdev_get(rawdev);
+	if (!ifpga_dev)
+		return -ENODEV;
+
+	for (i = 0; i < IFPGA_MAX_VDEV; i++) {
+		if (ifpga_dev->vdev_name[i] == NULL) {
+			n = strlen(vdev_name) + 1;
+			ifpga_dev->vdev_name[i] = rte_malloc(NULL, n, 0);
+			if (ifpga_dev->vdev_name[i] == NULL)
+				return -ENOMEM;
+			strlcpy(ifpga_dev->vdev_name[i], vdev_name, n);
+			break;
+		}
+	}
+
+	if (i >= IFPGA_MAX_VDEV) {
+		IFPGA_RAWDEV_PMD_ERR("Can't create more virtual device!");
+		return -ENOENT;
+	}
+
+	snprintf(dev_name, RTE_RAWDEV_NAME_MAX_LEN, "%d|%s",
+		args.port, args.bdf);
+	ret = rte_eal_hotplug_add(RTE_STR(IFPGA_BUS_NAME),
+			dev_name, vdev->device.devargs->args);
+	if (ret) {
+		rte_free(ifpga_dev->vdev_name[i]);
+		ifpga_dev->vdev_name[i] = NULL;
+	}
 
 	return ret;
@@ -1792,8 +1847,45 @@ static int
 ifpga_cfg_remove(struct rte_vdev_device *vdev)
 {
-	IFPGA_RAWDEV_PMD_INFO("Remove ifpga_cfg %p",
-		vdev);
+	struct rte_rawdev *rawdev = NULL;
+	struct ifpga_rawdev *ifpga_dev;
+	struct ifpga_vdev_args args;
+	char dev_name[RTE_RAWDEV_NAME_MAX_LEN];
+	const char *vdev_name = NULL;
+	char *tmp_vdev = NULL;
+	int i, ret = 0;
 
-	return 0;
+	vdev_name = rte_vdev_device_name(vdev);
+	if (!vdev_name)
+		return -EINVAL;
+
+	IFPGA_RAWDEV_PMD_INFO("remove ifpga virtual device %s", vdev_name);
+
+	ret = ifpga_vdev_parse_devargs(vdev->device.devargs, &args);
+	if (ret)
+		return ret;
+
+	memset(dev_name, 0, sizeof(dev_name));
+	snprintf(dev_name, RTE_RAWDEV_NAME_MAX_LEN, "IFPGA:%s", args.bdf);
+	rawdev = rte_rawdev_pmd_get_named_dev(dev_name);
+	if (!rawdev)
+		return -ENODEV;
+	ifpga_dev = ifpga_rawdev_get(rawdev);
+	if (!ifpga_dev)
+		return -ENODEV;
+
+	snprintf(dev_name, RTE_RAWDEV_NAME_MAX_LEN, "%d|%s",
+		args.port, args.bdf);
+	ret = rte_eal_hotplug_remove(RTE_STR(IFPGA_BUS_NAME), dev_name);
+
+	for (i = 0; i < IFPGA_MAX_VDEV; i++) {
+		tmp_vdev = ifpga_dev->vdev_name[i];
+		if (tmp_vdev && !strcmp(tmp_vdev, vdev_name)) {
+			free(tmp_vdev);
+			ifpga_dev->vdev_name[i] = NULL;
+			break;
+		}
+	}
+
+	return ret;
 }
 
diff --git a/drivers/raw/ifpga/ifpga_rawdev.h b/drivers/raw/ifpga/ifpga_rawdev.h
index 857b73463d..4c191190ca 100644
--- a/drivers/raw/ifpga/ifpga_rawdev.h
+++ b/drivers/raw/ifpga/ifpga_rawdev.h
@@ -51,4 +51,5 @@ ifpga_rawdev_get_priv(const struct rte_rawdev *rawdev)
 #define IFPGA_RAWDEV_MSIX_IRQ_NUM 7
 #define IFPGA_RAWDEV_NUM 32
+#define IFPGA_MAX_VDEV 4
 #define IFPGA_MAX_IRQ 12
 
@@ -65,4 +66,11 @@ struct ifpga_rawdev {
 	/* enable monitor thread poll device's sensors or not */
 	int poll_enabled;
+	/* name of virtual devices created on raw device */
+	char *vdev_name[IFPGA_MAX_VDEV];
+};
+
+struct ifpga_vdev_args {
+	char bdf[PCI_PRI_STR_SIZE];
+	int port;
 };
 
-- 
2.34.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-06-20 10:46:27.816736077 +0100
+++ 0001-raw-ifpga-remove-virtual-devices-on-close.patch	2022-06-20 10:46:27.760146785 +0100
@@ -1 +1 @@
-From ae835aba40349ee9631ef6b52e68a2893febe7e0 Mon Sep 17 00:00:00 2001
+From 56e6acc152ee763d61ca3b018c46bc23a542710a Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit ae835aba40349ee9631ef6b52e68a2893febe7e0 ]
+
@@ -12 +13,0 @@
-Cc: stable@dpdk.org
@@ -18 +19 @@
- drivers/raw/ifpga/ifpga_rawdev.c | 166 ++++++++++++++++++++++++-------
+ drivers/raw/ifpga/ifpga_rawdev.c | 176 +++++++++++++++++++++++--------
@@ -20 +21 @@
- 2 files changed, 138 insertions(+), 36 deletions(-)
+ 2 files changed, 142 insertions(+), 42 deletions(-)
@@ -23 +24 @@
-index 6d4117c5e8..fe3fc43abe 100644
+index 75800aed3a..b456feac9a 100644
@@ -55 +56 @@
-@@ -1639,6 +1653,4 @@ ifpga_rawdev_destroy(struct rte_pci_device *pci_dev)
+@@ -1640,6 +1654,4 @@ ifpga_rawdev_destroy(struct rte_pci_device *pci_dev)
@@ -62 +63 @@
-@@ -1715,71 +1727,116 @@ static int ifpga_rawdev_get_string_arg(const char *key __rte_unused,
+@@ -1716,73 +1728,116 @@ static int ifpga_rawdev_get_string_arg(const char *key __rte_unused,
@@ -134,0 +136,8 @@
+-	memset(dev_name, 0, sizeof(dev_name));
+-	snprintf(dev_name, RTE_RAWDEV_NAME_MAX_LEN, "IFPGA:%s", name);
+-	rawdev = rte_rawdev_pmd_get_named_dev(dev_name);
+-	if (!rawdev)
+-		goto end;
+-	ifpga_dev = ifpga_rawdev_get(rawdev);
+-	if (!ifpga_dev)
+-		goto end;
@@ -136,4 +145,12 @@
-+
-+end:
-+	if (kvlist)
-+		rte_kvargs_free(kvlist);
+ 
+-	memset(dev_name, 0, sizeof(dev_name));
+-	snprintf(dev_name, RTE_RAWDEV_NAME_MAX_LEN, "%d|%s",
+-	port, name);
+-
+-	ret = rte_eal_hotplug_add(RTE_STR(IFPGA_BUS_NAME),
+-			dev_name, devargs->args);
+ end:
+ 	if (kvlist)
+ 		rte_kvargs_free(kvlist);
+-	if (name)
+-		free(name);
@@ -164,2 +181 @@
- 	memset(dev_name, 0, sizeof(dev_name));
--	snprintf(dev_name, RTE_RAWDEV_NAME_MAX_LEN, "IFPGA:%s", name);
++	memset(dev_name, 0, sizeof(dev_name));
@@ -167,3 +183,2 @@
- 	rawdev = rte_rawdev_pmd_get_named_dev(dev_name);
- 	if (!rawdev)
--		goto end;
++	rawdev = rte_rawdev_pmd_get_named_dev(dev_name);
++	if (!rawdev)
@@ -171,3 +186,2 @@
- 	ifpga_dev = ifpga_rawdev_get(rawdev);
- 	if (!ifpga_dev)
--		goto end;
++	ifpga_dev = ifpga_rawdev_get(rawdev);
++	if (!ifpga_dev)
@@ -191,5 +205,2 @@
- 
--	memset(dev_name, 0, sizeof(dev_name));
- 	snprintf(dev_name, RTE_RAWDEV_NAME_MAX_LEN, "%d|%s",
--	port, name);
--
++
++	snprintf(dev_name, RTE_RAWDEV_NAME_MAX_LEN, "%d|%s",
@@ -197,5 +208 @@
- 	ret = rte_eal_hotplug_add(RTE_STR(IFPGA_BUS_NAME),
--			dev_name, devargs->args);
--end:
--	rte_kvargs_free(kvlist);
--	free(name);
++	ret = rte_eal_hotplug_add(RTE_STR(IFPGA_BUS_NAME),
@@ -209 +216 @@
-@@ -1789,8 +1846,45 @@ static int
+@@ -1792,8 +1847,45 @@ static int


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

* patch 'raw/ifpga: unregister interrupt on close' has been queued to stable release 21.11.2
  2022-06-20  9:47 patch 'raw/ifpga: remove virtual devices on close' has been queued to stable release 21.11.2 Kevin Traynor
@ 2022-06-20  9:47 ` Kevin Traynor
  2022-06-20  9:47 ` patch 'bus/fslmc: fix VFIO setup' " Kevin Traynor
                   ` (16 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: Kevin Traynor @ 2022-06-20  9:47 UTC (permalink / raw)
  To: Wei Huang; +Cc: Tianfei Zhang, Rosen Xu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 21.11.2

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/23/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

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

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

Thanks.

Kevin

---
From d2d91f50f715013dccd0f5b5dac845ba5569d5b8 Mon Sep 17 00:00:00 2001
From: Wei Huang <wei.huang@intel.com>
Date: Tue, 7 Jun 2022 05:07:22 -0400
Subject: [PATCH] raw/ifpga: unregister interrupt on close

[ upstream commit 2545683564aa15f36392be2b4ceead454064135b ]

There is an API rte_pmd_ifpga_cleanup provided by ifpga driver to
free the software resource used by ifpga card. The function call
of rte_pmd_ifpga_cleanup is list below.
rte_pmd_ifpga_cleanup()
  ifpga_rawdev_cleanup()
     rte_rawdev_pmd_release()
       rte_rawdev_close()
         ifpga_rawdev_close()

The interrupts are unregistered in ifpga_rawdev_destroy instead of
ifpga_rawdev_close function, so rte_pmd_ifpga_cleanup cannot free
interrupt resource as expected.

To fix such issue, interrupt unregistration is moved from
ifpga_rawdev_destroy to ifpga_rawdev_close function. The change of
function call of ifpga_rawdev_destroy is as below.
ifpga_rawdev_destroy()
  ifpga_unregister_msix_irq()  // removed
  rte_rawdev_pmd_release()
    rte_rawdev_close()
      ifpga_rawdev_close()

Fixes: e0a1aafe2af9 ("raw/ifpga: introduce IRQ functions")

Signed-off-by: Wei Huang <wei.huang@intel.com>
Acked-by: Tianfei Zhang <tianfei.zhang@intel.com>
Reviewed-by: Rosen Xu <rosen.xu@intel.com>
---
 drivers/raw/ifpga/ifpga_rawdev.c | 29 +++++++++++------------------
 1 file changed, 11 insertions(+), 18 deletions(-)

diff --git a/drivers/raw/ifpga/ifpga_rawdev.c b/drivers/raw/ifpga/ifpga_rawdev.c
index b456feac9a..cb0427157a 100644
--- a/drivers/raw/ifpga/ifpga_rawdev.c
+++ b/drivers/raw/ifpga/ifpga_rawdev.c
@@ -79,4 +79,5 @@ static int ifpga_pci_find_next_ext_capability(unsigned int fd,
 					      int start, uint32_t cap);
 static int ifpga_pci_find_ext_capability(unsigned int fd, uint32_t cap);
+static void fme_interrupt_handler(void *param);
 
 struct ifpga_rawdev *
@@ -741,6 +742,7 @@ ifpga_rawdev_close(struct rte_rawdev *dev)
 	struct ifpga_rawdev *ifpga_rdev = NULL;
 	struct opae_adapter *adapter;
+	struct opae_manager *mgr;
 	char *vdev_name = NULL;
-	int i = 0;
+	int i, ret = 0;
 
 	if (dev) {
@@ -757,4 +759,11 @@ ifpga_rawdev_close(struct rte_rawdev *dev)
 		adapter = ifpga_rawdev_get_priv(dev);
 		if (adapter) {
+			mgr = opae_adapter_get_mgr(adapter);
+			if (ifpga_rdev && mgr) {
+				if (ifpga_unregister_msix_irq(ifpga_rdev,
+					IFPGA_FME_IRQ, 0,
+					fme_interrupt_handler, mgr) < 0)
+					ret = -EINVAL;
+			}
 			opae_adapter_destroy(adapter);
 			opae_adapter_data_free(adapter->data);
@@ -762,5 +771,5 @@ ifpga_rawdev_close(struct rte_rawdev *dev)
 	}
 
-	return dev ? 0:1;
+	return ret;
 }
 
@@ -1631,7 +1640,4 @@ ifpga_rawdev_destroy(struct rte_pci_device *pci_dev)
 	struct rte_rawdev *rawdev;
 	char name[RTE_RAWDEV_NAME_MAX_LEN];
-	struct opae_adapter *adapter;
-	struct opae_manager *mgr;
-	struct ifpga_rawdev *dev;
 
 	if (!pci_dev) {
@@ -1653,17 +1659,4 @@ ifpga_rawdev_destroy(struct rte_pci_device *pci_dev)
 		return -EINVAL;
 	}
-	dev = ifpga_rawdev_get(rawdev);
-
-	adapter = ifpga_rawdev_get_priv(rawdev);
-	if (!adapter)
-		return -ENODEV;
-
-	mgr = opae_adapter_get_mgr(adapter);
-	if (!mgr)
-		return -ENODEV;
-
-	if (ifpga_unregister_msix_irq(dev, IFPGA_FME_IRQ, 0,
-				fme_interrupt_handler, mgr) < 0)
-		return -EINVAL;
 
 	/* rte_rawdev_close is called by pmd_release */
-- 
2.34.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-06-20 10:46:27.837302935 +0100
+++ 0002-raw-ifpga-unregister-interrupt-on-close.patch	2022-06-20 10:46:27.763146791 +0100
@@ -1 +1 @@
-From 2545683564aa15f36392be2b4ceead454064135b Mon Sep 17 00:00:00 2001
+From d2d91f50f715013dccd0f5b5dac845ba5569d5b8 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 2545683564aa15f36392be2b4ceead454064135b ]
+
@@ -29 +30,0 @@
-Cc: stable@dpdk.org
@@ -39 +40 @@
-index fe3fc43abe..94df56c90c 100644
+index b456feac9a..cb0427157a 100644
@@ -76 +77 @@
-@@ -1630,7 +1639,4 @@ ifpga_rawdev_destroy(struct rte_pci_device *pci_dev)
+@@ -1631,7 +1640,4 @@ ifpga_rawdev_destroy(struct rte_pci_device *pci_dev)
@@ -84 +85 @@
-@@ -1652,17 +1658,4 @@ ifpga_rawdev_destroy(struct rte_pci_device *pci_dev)
+@@ -1653,17 +1659,4 @@ ifpga_rawdev_destroy(struct rte_pci_device *pci_dev)


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

* patch 'bus/fslmc: fix VFIO setup' has been queued to stable release 21.11.2
  2022-06-20  9:47 patch 'raw/ifpga: remove virtual devices on close' has been queued to stable release 21.11.2 Kevin Traynor
  2022-06-20  9:47 ` patch 'raw/ifpga: unregister interrupt " Kevin Traynor
@ 2022-06-20  9:47 ` Kevin Traynor
  2022-06-20  9:47 ` patch 'doc: fix formatting and link in BPF library guide' " Kevin Traynor
                   ` (15 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: Kevin Traynor @ 2022-06-20  9:47 UTC (permalink / raw)
  To: Romain Delhomel; +Cc: Hemant Agrawal, dpdk stable

Hi,

FYI, your patch has been queued to stable release 21.11.2

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/23/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

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

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

Thanks.

Kevin

---
From 7133eadc9ccca643a3c507c4505726eaf706ef5b Mon Sep 17 00:00:00 2001
From: Romain Delhomel <romain.delhomel@6wind.com>
Date: Fri, 3 Jun 2022 17:18:30 +0200
Subject: [PATCH] bus/fslmc: fix VFIO setup

[ upstream commit 36c3c4df136f6d79c0ffaddec00696f5eddaef16 ]

At device probe, the fslmc bus driver calls rte_vfio_get_group_fd() to
get a fd associated to a vfio group. This function first checks if the
group is already opened, else it opens /dev/vfio/%u, and increases the
number of active groups in default_vfio_cfg (which references the
default vfio container).

When adding the first group to a vfio_cfg, the caller is supposed to
pick an IOMMU type and set up DMA mappings for container, as it's done
by pci bus, but it is not done here. Instead, a new container is created
and used.

This prevents the pci bus driver, which uses the default_vfio_cfg
container, to configure the container because
default_vfio_cfg->active_group > 1.

This patch fixes the issue by always creating a new container (and its
associated vfio_cfg) and binding the group to it.

Fixes: a69f79300262 ("bus/fslmc: support multi VFIO group")

Signed-off-by: Romain Delhomel <romain.delhomel@6wind.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/bus/fslmc/fslmc_vfio.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c
index b4704eeae4..abe1cab2ee 100644
--- a/drivers/bus/fslmc/fslmc_vfio.c
+++ b/drivers/bus/fslmc/fslmc_vfio.c
@@ -980,4 +980,5 @@ fslmc_vfio_setup_group(void)
 	int groupid;
 	int ret;
+	int vfio_container_fd;
 	struct vfio_group_status status = { .argsz = sizeof(status) };
 
@@ -998,6 +999,13 @@ fslmc_vfio_setup_group(void)
 	}
 
+	ret = rte_vfio_container_create();
+	if (ret < 0) {
+		DPAA2_BUS_ERR("Failed to open VFIO container");
+		return ret;
+	}
+	vfio_container_fd = ret;
+
 	/* Get the actual group fd */
-	ret = rte_vfio_get_group_fd(groupid);
+	ret = rte_vfio_container_group_bind(vfio_container_fd, groupid);
 	if (ret < 0)
 		return ret;
-- 
2.34.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-06-20 10:46:27.858802137 +0100
+++ 0003-bus-fslmc-fix-VFIO-setup.patch	2022-06-20 10:46:27.765146795 +0100
@@ -1 +1 @@
-From 36c3c4df136f6d79c0ffaddec00696f5eddaef16 Mon Sep 17 00:00:00 2001
+From 7133eadc9ccca643a3c507c4505726eaf706ef5b Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 36c3c4df136f6d79c0ffaddec00696f5eddaef16 ]
+
@@ -25 +26,0 @@
-Cc: stable@dpdk.org
@@ -34 +35 @@
-index 1b89a56bbc..3d4e71a80a 100644
+index b4704eeae4..abe1cab2ee 100644
@@ -37 +38 @@
-@@ -996,4 +996,5 @@ fslmc_vfio_setup_group(void)
+@@ -980,4 +980,5 @@ fslmc_vfio_setup_group(void)
@@ -43 +44 @@
-@@ -1014,6 +1015,13 @@ fslmc_vfio_setup_group(void)
+@@ -998,6 +999,13 @@ fslmc_vfio_setup_group(void)


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

* patch 'doc: fix formatting and link in BPF library guide' has been queued to stable release 21.11.2
  2022-06-20  9:47 patch 'raw/ifpga: remove virtual devices on close' has been queued to stable release 21.11.2 Kevin Traynor
  2022-06-20  9:47 ` patch 'raw/ifpga: unregister interrupt " Kevin Traynor
  2022-06-20  9:47 ` patch 'bus/fslmc: fix VFIO setup' " Kevin Traynor
@ 2022-06-20  9:47 ` Kevin Traynor
  2022-06-20  9:47 ` patch 'dma/idxd: fix error code for PCI device commands' " Kevin Traynor
                   ` (14 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: Kevin Traynor @ 2022-06-20  9:47 UTC (permalink / raw)
  To: Harry van Haaren; +Cc: Konstantin Ananyev, dpdk stable

Hi,

FYI, your patch has been queued to stable release 21.11.2

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/23/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

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

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

Thanks.

Kevin

---
From 5215fd05ab3559b6fc77ace3938fc2d3a5099e7b Mon Sep 17 00:00:00 2001
From: Harry van Haaren <harry.van.haaren@intel.com>
Date: Fri, 27 May 2022 13:45:00 +0000
Subject: [PATCH] doc: fix formatting and link in BPF library guide

[ upstream commit 85bd316d084f6a2715f8574f322f09b56075789b ]

Small improvements to the documentation based on Sphinx HTML doc output.

Fixes: 14b8f0bbe519 ("doc: add BPF library guide")
Fixes: b901d928361c ("bpf: support packet data load instructions")

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>
---
 doc/guides/prog_guide/bpf_lib.rst | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/doc/guides/prog_guide/bpf_lib.rst b/doc/guides/prog_guide/bpf_lib.rst
index 1feb7734a3..1cf2d59429 100644
--- a/doc/guides/prog_guide/bpf_lib.rst
+++ b/doc/guides/prog_guide/bpf_lib.rst
@@ -11,5 +11,5 @@ user-space dpdk application.
 It supports basic set of features from eBPF spec.
 Please refer to the
-`eBPF spec <https://www.kernel.org/doc/Documentation/networking/filter.txt>`
+`eBPF spec <https://www.kernel.org/doc/Documentation/networking/filter.txt>`_
 for more information.
 Also it introduces basic framework to load/unload BPF-based filters
@@ -49,7 +49,7 @@ For example, ``(BPF_IND | BPF_W | BPF_LD)`` means:
 
     uint32_t tmp;
-    R0 = rte_pktmbuf_read((const struct rte_mbuf *)R6,  src_reg + imm32,
-	sizeof(tmp), &tmp);
-    if (R0 == NULL) return FAILED;
+    R0 = rte_pktmbuf_read((const struct rte_mbuf *)R6,  src_reg + imm32, sizeof(tmp), &tmp);
+    if (R0 == NULL)
+        return FAILED;
     R0 = ntohl(*(uint32_t *)R0);
 
-- 
2.34.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-06-20 10:46:27.878710074 +0100
+++ 0004-doc-fix-formatting-and-link-in-BPF-library-guide.patch	2022-06-20 10:46:27.765146795 +0100
@@ -1 +1 @@
-From 85bd316d084f6a2715f8574f322f09b56075789b Mon Sep 17 00:00:00 2001
+From 5215fd05ab3559b6fc77ace3938fc2d3a5099e7b Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 85bd316d084f6a2715f8574f322f09b56075789b ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org


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

* patch 'dma/idxd: fix error code for PCI device commands' has been queued to stable release 21.11.2
  2022-06-20  9:47 patch 'raw/ifpga: remove virtual devices on close' has been queued to stable release 21.11.2 Kevin Traynor
                   ` (2 preceding siblings ...)
  2022-06-20  9:47 ` patch 'doc: fix formatting and link in BPF library guide' " Kevin Traynor
@ 2022-06-20  9:47 ` Kevin Traynor
  2022-06-20  9:47 ` patch 'app/testpmd: fix packet segment allocation' " Kevin Traynor
                   ` (13 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: Kevin Traynor @ 2022-06-20  9:47 UTC (permalink / raw)
  To: Kevin Laatz; +Cc: Conor Walsh, dpdk stable

Hi,

FYI, your patch has been queued to stable release 21.11.2

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/23/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

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

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

Thanks.

Kevin

---
From 8bb9213bbceaef634a7f54cb5775211efdbbaff5 Mon Sep 17 00:00:00 2001
From: Kevin Laatz <kevin.laatz@intel.com>
Date: Fri, 8 Apr 2022 15:16:55 +0100
Subject: [PATCH] dma/idxd: fix error code for PCI device commands

[ upstream commit f217dbff20603b51a51e226be77593ea06122ab5 ]

When sending a command to an idxd device via PCI BAR, the response from
HW is checked to ensure it was successful. The response was incorrectly
being negated before being returned by the function, meaning error codes
cannot be checked against the HW specification.

This patch fixes the return values of the function by removing the
negation.

Fixes: 9449330a8458 ("dma/idxd: create dmadev instances on PCI probe")
Fixes: 452c1916b0db ("dma/idxd: fix truncated error code in status check")

Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Conor Walsh <conor.walsh@intel.com>
---
 drivers/dma/idxd/idxd_pci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/dma/idxd/idxd_pci.c b/drivers/dma/idxd/idxd_pci.c
index 9ca1ec64e9..65c6bbf4c1 100644
--- a/drivers/dma/idxd/idxd_pci.c
+++ b/drivers/dma/idxd/idxd_pci.c
@@ -39,5 +39,5 @@ idxd_pci_dev_command(struct idxd_dmadev *idxd, enum rte_idxd_cmds command)
 			rte_spinlock_unlock(&idxd->u.pci->lk);
 			err_code &= CMDSTATUS_ERR_MASK;
-			return -err_code;
+			return err_code;
 		}
 	} while (err_code & CMDSTATUS_ACTIVE_MASK);
@@ -45,5 +45,5 @@ idxd_pci_dev_command(struct idxd_dmadev *idxd, enum rte_idxd_cmds command)
 
 	err_code &= CMDSTATUS_ERR_MASK;
-	return -err_code;
+	return err_code;
 }
 
-- 
2.34.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-06-20 10:46:27.898144895 +0100
+++ 0005-dma-idxd-fix-error-code-for-PCI-device-commands.patch	2022-06-20 10:46:27.766146797 +0100
@@ -1 +1 @@
-From f217dbff20603b51a51e226be77593ea06122ab5 Mon Sep 17 00:00:00 2001
+From 8bb9213bbceaef634a7f54cb5775211efdbbaff5 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit f217dbff20603b51a51e226be77593ea06122ab5 ]
+
@@ -16 +17,0 @@
-Cc: stable@dpdk.org


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

* patch 'app/testpmd: fix packet segment allocation' has been queued to stable release 21.11.2
  2022-06-20  9:47 patch 'raw/ifpga: remove virtual devices on close' has been queued to stable release 21.11.2 Kevin Traynor
                   ` (3 preceding siblings ...)
  2022-06-20  9:47 ` patch 'dma/idxd: fix error code for PCI device commands' " Kevin Traynor
@ 2022-06-20  9:47 ` Kevin Traynor
  2022-06-20  9:47 ` patch 'app/testpmd: fix multicast address pool leak' " Kevin Traynor
                   ` (12 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: Kevin Traynor @ 2022-06-20  9:47 UTC (permalink / raw)
  To: Raja Zidane; +Cc: Matan Azrad, dpdk stable

Hi,

FYI, your patch has been queued to stable release 21.11.2

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/23/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

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

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

Thanks.

Kevin

---
From c18ad5cc3eec4b56421f4bd200aa1ba819044e9c Mon Sep 17 00:00:00 2001
From: Raja Zidane <rzidane@nvidia.com>
Date: Thu, 2 Jun 2022 15:59:47 +0300
Subject: [PATCH] app/testpmd: fix packet segment allocation
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit 1108c33e743f8be81e765165c8b3cf27d57a7220 ]

When --mbuf-size cmdline parameter is specified, the segments to scatter
packets on are allocated sequentially from these extra memory pools
(the mbuf for the first segment is allocated from the first pool, the
second one from the second pool, and so on, if segment number is greater
then pool’s the mbuf for remaining segments will be allocated from the
last valid pool).
A bug in comparing segment index with mbuf index caused wrong mapping
of one of the segments.

Fix the comparison.

Fixes: 2befc67ff679 ("app/testpmd: add extended Rx queue setup")

Signed-off-by: Raja Zidane <rzidane@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 app/test-pmd/testpmd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index fa449183c1..1c415b0209 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -2673,5 +2673,5 @@ rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id,
 		 * exceeding the pool index.
 		 */
-		mp_n = (i > mbuf_data_size_n) ? mbuf_data_size_n - 1 : i;
+		mp_n = (i >= mbuf_data_size_n) ? mbuf_data_size_n - 1 : i;
 		mpx = mbuf_pool_find(socket_id, mp_n);
 		/* Handle zero as mbuf data buffer size. */
-- 
2.34.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-06-20 10:46:27.917728197 +0100
+++ 0006-app-testpmd-fix-packet-segment-allocation.patch	2022-06-20 10:46:27.771146807 +0100
@@ -1 +1 @@
-From 1108c33e743f8be81e765165c8b3cf27d57a7220 Mon Sep 17 00:00:00 2001
+From c18ad5cc3eec4b56421f4bd200aa1ba819044e9c Mon Sep 17 00:00:00 2001
@@ -8,0 +9,2 @@
+[ upstream commit 1108c33e743f8be81e765165c8b3cf27d57a7220 ]
+
@@ -21 +22,0 @@
-Cc: stable@dpdk.org
@@ -30 +31 @@
-index fc1b64b60d..4d51eb9576 100644
+index fa449183c1..1c415b0209 100644
@@ -33 +34 @@
-@@ -2672,5 +2672,5 @@ rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id,
+@@ -2673,5 +2673,5 @@ rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id,


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

* patch 'app/testpmd: fix multicast address pool leak' has been queued to stable release 21.11.2
  2022-06-20  9:47 patch 'raw/ifpga: remove virtual devices on close' has been queued to stable release 21.11.2 Kevin Traynor
                   ` (4 preceding siblings ...)
  2022-06-20  9:47 ` patch 'app/testpmd: fix packet segment allocation' " Kevin Traynor
@ 2022-06-20  9:47 ` Kevin Traynor
  2022-06-20  9:47 ` patch 'net/failsafe: fix device freeing' " Kevin Traynor
                   ` (11 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: Kevin Traynor @ 2022-06-20  9:47 UTC (permalink / raw)
  To: Ke Zhang; +Cc: Yuying Zhang, Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 21.11.2

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/23/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

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

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

Thanks.

Kevin

---
From a9062fa2fc4e005036475a9161fe0ba38d896564 Mon Sep 17 00:00:00 2001
From: Ke Zhang <ke1x.zhang@intel.com>
Date: Fri, 25 Mar 2022 08:35:55 +0000
Subject: [PATCH] app/testpmd: fix multicast address pool leak

[ upstream commit 68629be3a622ee53cd5b40c8447ae9b083ff3f6c ]

A multicast address pool is allocated for a port when
using mcast_addr testpmd commands.

When closing a port or stopping testpmd, this pool was
not freed, resulting in a leak.
This issue has been caught using ASan.

Free this pool when closing the port.

Error info as following:
ERROR: LeakSanitizer: detected memory leaksDirect leak of
       192 byte(s)
0 0x7f6a2e0aeffe in __interceptor_realloc
	(/lib/x86_64-linux-gnu/libasan.so.5+0x10dffe)
1 0x565361eb340f in mcast_addr_pool_extend
	../app/test-pmd/config.c:5162
2 0x565361eb3556 in mcast_addr_pool_append
	../app/test-pmd/config.c:5180
3 0x565361eb3aae in mcast_addr_add
	../app/test-pmd/config.c:5243

Fixes: 8fff667578a7 ("app/testpmd: new command to add/remove multicast MAC addresses")

Signed-off-by: Ke Zhang <ke1x.zhang@intel.com>
Acked-by: Yuying Zhang <yuying.zhang@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@xilinx.com>
---
 app/test-pmd/config.c  | 19 +++++++++++++++++++
 app/test-pmd/testpmd.c |  1 +
 app/test-pmd/testpmd.h |  1 +
 3 files changed, 21 insertions(+)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 3855a6809f..f8c058f204 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -5292,4 +5292,23 @@ mcast_addr_pool_remove(struct rte_port *port, uint32_t addr_idx)
 }
 
+int
+mcast_addr_pool_destroy(portid_t port_id)
+{
+	struct rte_port *port;
+
+	if (port_id_is_invalid(port_id, ENABLED_WARN) ||
+	    port_id == (portid_t)RTE_PORT_ALL)
+		return -EINVAL;
+	port = &ports[port_id];
+
+	if (port->mc_addr_nb != 0) {
+		/* free the pool of multicast addresses. */
+		free(port->mc_addr_pool);
+		port->mc_addr_pool = NULL;
+		port->mc_addr_nb = 0;
+	}
+	return 0;
+}
+
 static int
 eth_port_multicast_addr_list_set(portid_t port_id)
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 1c415b0209..214763d65b 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -3239,4 +3239,5 @@ close_port(portid_t pid)
 
 		if (is_proc_primary()) {
+			mcast_addr_pool_destroy(pi);
 			port_flow_flush(pi);
 			port_flex_item_flush(pi);
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index 42db6b56df..04bc7ffbc2 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -918,4 +918,5 @@ int port_action_handle_query(portid_t port_id, uint32_t id);
 void update_age_action_context(const struct rte_flow_action *actions,
 		     struct port_flow *pf);
+int mcast_addr_pool_destroy(portid_t port_id);
 int port_flow_destroy(portid_t port_id, uint32_t n, const uint32_t *rule);
 int port_flow_flush(portid_t port_id);
-- 
2.34.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-06-20 10:46:27.940808817 +0100
+++ 0007-app-testpmd-fix-multicast-address-pool-leak.patch	2022-06-20 10:46:27.782146829 +0100
@@ -1 +1 @@
-From 68629be3a622ee53cd5b40c8447ae9b083ff3f6c Mon Sep 17 00:00:00 2001
+From a9062fa2fc4e005036475a9161fe0ba38d896564 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 68629be3a622ee53cd5b40c8447ae9b083ff3f6c ]
+
@@ -28 +29,0 @@
-Cc: stable@dpdk.org
@@ -40 +41 @@
-index 72d2606d19..d6caa1f0b2 100644
+index 3855a6809f..f8c058f204 100644
@@ -43 +44 @@
-@@ -6071,4 +6071,23 @@ mcast_addr_pool_remove(struct rte_port *port, uint32_t addr_idx)
+@@ -5292,4 +5292,23 @@ mcast_addr_pool_remove(struct rte_port *port, uint32_t addr_idx)
@@ -68 +69 @@
-index 4d51eb9576..9d6175e9a7 100644
+index 1c415b0209..214763d65b 100644
@@ -71 +72 @@
-@@ -3238,4 +3238,5 @@ close_port(portid_t pid)
+@@ -3239,4 +3239,5 @@ close_port(portid_t pid)
@@ -78 +79 @@
-index 6693813dda..dd34b025e6 100644
+index 42db6b56df..04bc7ffbc2 100644
@@ -81 +82 @@
-@@ -992,4 +992,5 @@ int port_action_handle_query(portid_t port_id, uint32_t id);
+@@ -918,4 +918,5 @@ int port_action_handle_query(portid_t port_id, uint32_t id);


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

* patch 'net/failsafe: fix device freeing' has been queued to stable release 21.11.2
  2022-06-20  9:47 patch 'raw/ifpga: remove virtual devices on close' has been queued to stable release 21.11.2 Kevin Traynor
                   ` (5 preceding siblings ...)
  2022-06-20  9:47 ` patch 'app/testpmd: fix multicast address pool leak' " Kevin Traynor
@ 2022-06-20  9:47 ` Kevin Traynor
  2022-06-20  9:47 ` patch 'net/tap: " Kevin Traynor
                   ` (10 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: Kevin Traynor @ 2022-06-20  9:47 UTC (permalink / raw)
  To: Yunjian Wang; +Cc: Andrew Rybchenko, dpdk stable

Hi,

FYI, your patch has been queued to stable release 21.11.2

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/23/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

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

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

Thanks.

Kevin

---
From 63bb35c3f358a75067f775d549fa82b68a28c08f Mon Sep 17 00:00:00 2001
From: Yunjian Wang <wangyunjian@huawei.com>
Date: Tue, 7 Jun 2022 14:50:49 +0800
Subject: [PATCH] net/failsafe: fix device freeing

[ upstream commit fd819cad0a266421ca9872570e923c2a7ae68183 ]

The PMD destroy function was calling the release function, which frees
dev->data->dev_private, and then tries to free PRIV(dev)->intr_handle,
which causes the heap use after free issue.

The free can be moved to before the release function is called.

Fixes: d61138d4f0e ("drivers: remove direct access to interrupt handle")

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
 drivers/net/failsafe/failsafe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/failsafe/failsafe.c b/drivers/net/failsafe/failsafe.c
index 3c754a5f66..05cf533896 100644
--- a/drivers/net/failsafe/failsafe.c
+++ b/drivers/net/failsafe/failsafe.c
@@ -309,6 +309,6 @@ fs_rte_eth_free(const char *name)
 		return 0; /* port already released */
 	ret = failsafe_eth_dev_close(dev);
-	rte_eth_dev_release_port(dev);
 	rte_intr_instance_free(PRIV(dev)->intr_handle);
+	rte_eth_dev_release_port(dev);
 	return ret;
 }
-- 
2.34.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-06-20 10:46:27.967483912 +0100
+++ 0008-net-failsafe-fix-device-freeing.patch	2022-06-20 10:46:27.783146830 +0100
@@ -1 +1 @@
-From fd819cad0a266421ca9872570e923c2a7ae68183 Mon Sep 17 00:00:00 2001
+From 63bb35c3f358a75067f775d549fa82b68a28c08f Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit fd819cad0a266421ca9872570e923c2a7ae68183 ]
+
@@ -13 +14,0 @@
-Cc: stable@dpdk.org


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

* patch 'net/tap: fix device freeing' has been queued to stable release 21.11.2
  2022-06-20  9:47 patch 'raw/ifpga: remove virtual devices on close' has been queued to stable release 21.11.2 Kevin Traynor
                   ` (6 preceding siblings ...)
  2022-06-20  9:47 ` patch 'net/failsafe: fix device freeing' " Kevin Traynor
@ 2022-06-20  9:47 ` Kevin Traynor
  2022-06-20  9:47 ` patch 'kni: use dedicated function to set random MAC address' " Kevin Traynor
                   ` (9 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: Kevin Traynor @ 2022-06-20  9:47 UTC (permalink / raw)
  To: Yunjian Wang; +Cc: Xiangjun Meng, Andrew Rybchenko, dpdk stable

Hi,

FYI, your patch has been queued to stable release 21.11.2

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/23/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

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

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

Thanks.

Kevin

---
From e731132bca9f559d6d941240bc383d2435fcccb4 Mon Sep 17 00:00:00 2001
From: Yunjian Wang <wangyunjian@huawei.com>
Date: Tue, 7 Jun 2022 14:50:57 +0800
Subject: [PATCH] net/tap: fix device freeing

[ upstream commit f2aebfc4e941b315cebb71d6408dd5bbb0570a96 ]

The error path was calling rte_eth_dev_release_port() function,
which frees eth_dev->data->dev_private, and then tries to free
pmd->intr_handle, which causes the use after free issue.

The free can be moved to before the release function is called.

Fixes: d61138d4f0e ("drivers: remove direct access to interrupt handle")

Signed-off-by: Xiangjun Meng <mengxiangjun4@huawei.com>
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
 drivers/net/tap/rte_eth_tap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
index 919968af44..e020a2417b 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -2172,6 +2172,6 @@ error_exit:
 	/* mac_addrs must not be freed alone because part of dev_private */
 	dev->data->mac_addrs = NULL;
-	rte_eth_dev_release_port(dev);
 	rte_intr_instance_free(pmd->intr_handle);
+	rte_eth_dev_release_port(dev);
 
 error_exit_nodev:
-- 
2.34.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-06-20 10:46:27.986783609 +0100
+++ 0009-net-tap-fix-device-freeing.patch	2022-06-20 10:46:27.785146834 +0100
@@ -1 +1 @@
-From f2aebfc4e941b315cebb71d6408dd5bbb0570a96 Mon Sep 17 00:00:00 2001
+From e731132bca9f559d6d941240bc383d2435fcccb4 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit f2aebfc4e941b315cebb71d6408dd5bbb0570a96 ]
+
@@ -13 +14,0 @@
-Cc: stable@dpdk.org
@@ -23 +24 @@
-index 5495818be6..9e1032fe72 100644
+index 919968af44..e020a2417b 100644
@@ -26 +27 @@
-@@ -2180,6 +2180,6 @@ error_exit:
+@@ -2172,6 +2172,6 @@ error_exit:


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

* patch 'kni: use dedicated function to set random MAC address' has been queued to stable release 21.11.2
  2022-06-20  9:47 patch 'raw/ifpga: remove virtual devices on close' has been queued to stable release 21.11.2 Kevin Traynor
                   ` (7 preceding siblings ...)
  2022-06-20  9:47 ` patch 'net/tap: " Kevin Traynor
@ 2022-06-20  9:47 ` Kevin Traynor
  2022-06-20  9:47 ` patch 'kni: use dedicated function to set " Kevin Traynor
                   ` (8 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: Kevin Traynor @ 2022-06-20  9:47 UTC (permalink / raw)
  To: Ke Zhang; +Cc: Andrew Rybchenko, Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 21.11.2

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/23/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

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

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

Thanks.

Kevin

---
From 9b7982b9867a3c28728f73678ff9cf497dde72f3 Mon Sep 17 00:00:00 2001
From: Ke Zhang <ke1x.zhang@intel.com>
Date: Wed, 8 Jun 2022 15:11:16 +0300
Subject: [PATCH] kni: use dedicated function to set random MAC address
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit 2ee8c67ef9399759cb0d3f34b2c9fb6ea0ecc832 ]

eth_hw_addr_random() sets address type correctly.

eth_hw_addr_random() is available since Linux v3.4, so
no compat is required.

Also fix the warning:
warning: passing argument 1 of ‘memcpy’ discards ‘const’
qualifier from pointer target type

Variable dev_addr is done const intentionally in Linux v5.17 to
prevent using it directly.

Fixes: ea6b39b5b847 ("kni: remove ethtool support")

Signed-off-by: Ke Zhang <ke1x.zhang@intel.com>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Ferruh Yigit <ferruh.yigit@xilinx.com>
---
 kernel/linux/kni/kni_misc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/linux/kni/kni_misc.c b/kernel/linux/kni/kni_misc.c
index ad1582d911..38fcd7f4f2 100644
--- a/kernel/linux/kni/kni_misc.c
+++ b/kernel/linux/kni/kni_misc.c
@@ -408,6 +408,6 @@ kni_ioctl_create(struct net *net, uint32_t ioctl_num,
 		memcpy(net_dev->dev_addr, dev_info.mac_addr, ETH_ALEN);
 	else
-		/* Generate random MAC address. */
-		eth_random_addr(net_dev->dev_addr);
+		/* Assign random MAC address. */
+		eth_hw_addr_random(net_dev);
 
 	if (dev_info.mtu)
-- 
2.34.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-06-20 10:46:28.008186419 +0100
+++ 0010-kni-use-dedicated-function-to-set-random-MAC-address.patch	2022-06-20 10:46:27.786146836 +0100
@@ -1 +1 @@
-From 2ee8c67ef9399759cb0d3f34b2c9fb6ea0ecc832 Mon Sep 17 00:00:00 2001
+From 9b7982b9867a3c28728f73678ff9cf497dde72f3 Mon Sep 17 00:00:00 2001
@@ -8,0 +9,2 @@
+[ upstream commit 2ee8c67ef9399759cb0d3f34b2c9fb6ea0ecc832 ]
+
@@ -22 +23,0 @@
-Cc: stable@dpdk.org
@@ -32 +33 @@
-index 780187d8bf..4f6dd373a3 100644
+index ad1582d911..38fcd7f4f2 100644
@@ -35 +36 @@
-@@ -406,6 +406,6 @@ kni_ioctl_create(struct net *net, uint32_t ioctl_num,
+@@ -408,6 +408,6 @@ kni_ioctl_create(struct net *net, uint32_t ioctl_num,


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

* patch 'kni: use dedicated function to set MAC address' has been queued to stable release 21.11.2
  2022-06-20  9:47 patch 'raw/ifpga: remove virtual devices on close' has been queued to stable release 21.11.2 Kevin Traynor
                   ` (8 preceding siblings ...)
  2022-06-20  9:47 ` patch 'kni: use dedicated function to set random MAC address' " Kevin Traynor
@ 2022-06-20  9:47 ` Kevin Traynor
  2022-06-20  9:47 ` patch 'crypto/ipsec_mb: fix build with GCC 12' " Kevin Traynor
                   ` (7 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: Kevin Traynor @ 2022-06-20  9:47 UTC (permalink / raw)
  To: Ke Zhang; +Cc: Andrew Rybchenko, Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 21.11.2

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/23/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

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

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

Thanks.

Kevin

---
From 4cfe56040171e791b021d5490f8fd58c55b088fb Mon Sep 17 00:00:00 2001
From: Ke Zhang <ke1x.zhang@intel.com>
Date: Wed, 8 Jun 2022 15:11:17 +0300
Subject: [PATCH] kni: use dedicated function to set MAC address
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit b99bd4a0aacab47165d045a6aeee88ee74744600 ]

The warning info:
warning: passing argument 1 of ‘memcpy’ discards ‘const’
qualifier from pointer target type

Variable dev_addr is done const intentionally in v5.17 to prevent using
it directly.  See the following Linux kernel changeset for details:

commit adeef3e32146 ("net: constify netdev->dev_addr")

Used helper function was introduced earlier in v5.15.

Fixes: ea6b39b5b847 ("kni: remove ethtool support")

Signed-off-by: Ke Zhang <ke1x.zhang@intel.com>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Ferruh Yigit <ferruh.yigit@xilinx.com>
---
 kernel/linux/kni/compat.h   | 4 ++++
 kernel/linux/kni/kni_misc.c | 9 +++++++--
 kernel/linux/kni/kni_net.c  | 4 ++++
 3 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/kernel/linux/kni/compat.h b/kernel/linux/kni/compat.h
index 0db29a4a6f..3a86d12bbc 100644
--- a/kernel/linux/kni/compat.h
+++ b/kernel/linux/kni/compat.h
@@ -143,4 +143,8 @@
 #endif
 
+#if KERNEL_VERSION(5, 15, 0) <= LINUX_VERSION_CODE
+#define HAVE_ETH_HW_ADDR_SET
+#endif
+
 #if KERNEL_VERSION(5, 18, 0) > LINUX_VERSION_CODE
 #define HAVE_NETIF_RX_NI
diff --git a/kernel/linux/kni/kni_misc.c b/kernel/linux/kni/kni_misc.c
index 38fcd7f4f2..feed12b568 100644
--- a/kernel/linux/kni/kni_misc.c
+++ b/kernel/linux/kni/kni_misc.c
@@ -405,9 +405,14 @@ kni_ioctl_create(struct net *net, uint32_t ioctl_num,
 
 	/* if user has provided a valid mac address */
-	if (is_valid_ether_addr(dev_info.mac_addr))
+	if (is_valid_ether_addr(dev_info.mac_addr)) {
+#ifdef HAVE_ETH_HW_ADDR_SET
+		eth_hw_addr_set(net_dev, dev_info.mac_addr);
+#else
 		memcpy(net_dev->dev_addr, dev_info.mac_addr, ETH_ALEN);
-	else
+#endif
+	} else {
 		/* Assign random MAC address. */
 		eth_hw_addr_random(net_dev);
+	}
 
 	if (dev_info.mtu)
diff --git a/kernel/linux/kni/kni_net.c b/kernel/linux/kni/kni_net.c
index 41805fcabf..779ee3451a 100644
--- a/kernel/linux/kni/kni_net.c
+++ b/kernel/linux/kni/kni_net.c
@@ -784,5 +784,9 @@ kni_net_set_mac(struct net_device *netdev, void *p)
 
 	memcpy(req.mac_addr, addr->sa_data, netdev->addr_len);
+#ifdef HAVE_ETH_HW_ADDR_SET
+	eth_hw_addr_set(netdev, addr->sa_data);
+#else
 	memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
+#endif
 
 	ret = kni_net_process_request(netdev, &req);
-- 
2.34.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-06-20 10:46:28.027675952 +0100
+++ 0011-kni-use-dedicated-function-to-set-MAC-address.patch	2022-06-20 10:46:27.787146838 +0100
@@ -1 +1 @@
-From b99bd4a0aacab47165d045a6aeee88ee74744600 Mon Sep 17 00:00:00 2001
+From 4cfe56040171e791b021d5490f8fd58c55b088fb Mon Sep 17 00:00:00 2001
@@ -8,0 +9,2 @@
+[ upstream commit b99bd4a0aacab47165d045a6aeee88ee74744600 ]
+
@@ -21 +22,0 @@
-Cc: stable@dpdk.org
@@ -46 +47 @@
-index 4f6dd373a3..0c3a86ee35 100644
+index 38fcd7f4f2..feed12b568 100644
@@ -49 +50 @@
-@@ -403,9 +403,14 @@ kni_ioctl_create(struct net *net, uint32_t ioctl_num,
+@@ -405,9 +405,14 @@ kni_ioctl_create(struct net *net, uint32_t ioctl_num,


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

* patch 'crypto/ipsec_mb: fix build with GCC 12' has been queued to stable release 21.11.2
  2022-06-20  9:47 patch 'raw/ifpga: remove virtual devices on close' has been queued to stable release 21.11.2 Kevin Traynor
                   ` (9 preceding siblings ...)
  2022-06-20  9:47 ` patch 'kni: use dedicated function to set " Kevin Traynor
@ 2022-06-20  9:47 ` Kevin Traynor
  2022-06-20  9:47 ` patch 'net/ena: " Kevin Traynor
                   ` (6 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: Kevin Traynor @ 2022-06-20  9:47 UTC (permalink / raw)
  To: David Marchand; +Cc: Stephen Hemminger, dpdk stable

Hi,

FYI, your patch has been queued to stable release 21.11.2

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/23/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

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

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

Thanks.

Kevin

---
From c86456efc916bff6ecb9b6ab9664c9409d1a3fe2 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Wed, 18 May 2022 12:16:48 +0200
Subject: [PATCH] crypto/ipsec_mb: fix build with GCC 12
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit 468f31eb71c4c2aa454841b316766514cabd0f02 ]

GCC 12 raises the following warning:

In function ‘__rte_ring_enqueue_elems_64’,
    inlined from ‘__rte_ring_enqueue_elems’ at
        ../lib/ring/rte_ring_elem_pvt.h:130:3,
    inlined from ‘__rte_ring_do_hts_enqueue_elem’ at
        ../lib/ring/rte_ring_hts_elem_pvt.h:196:3,
    inlined from ‘rte_ring_mp_hts_enqueue_burst_elem’ at
        ../lib/ring/rte_ring_hts.h:110:9,
    inlined from ‘rte_ring_enqueue_burst_elem’ at
        ../lib/ring/rte_ring_elem.h:577:10,
    inlined from ‘rte_ring_enqueue_burst’ at
        ../lib/ring/rte_ring.h:738:9,
    inlined from ‘process_op_bit’ at
        ../drivers/crypto/ipsec_mb/pmd_snow3g.c:425:16,
    inlined from ‘snow3g_pmd_dequeue_burst’ at
        ../drivers/crypto/ipsec_mb/pmd_snow3g.c:484:20:
../lib/ring/rte_ring_elem_pvt.h:68:44: error: array subscript 1 is
        outside array bounds of ‘struct rte_crypto_op[0]’
        [-Werror=array-bounds]
   68 |                         ring[idx + 1] = obj[i + 1];
      |                                         ~~~^~~~~~~
../drivers/crypto/ipsec_mb/pmd_snow3g.c: In function
        ‘snow3g_pmd_dequeue_burst’:
../drivers/crypto/ipsec_mb/pmd_snow3g.c:434:1: note:
        at offset 8 into object ‘op’ of size 8
  434 | snow3g_pmd_dequeue_burst(void *queue_pair,
      | ^~~~~~~~~~~~~~~~~~~~~~~~

Validate that one (exactly) op has been processed or return early.

Fixes: b537abdbee74 ("crypto/snow3g: support bit-level operations")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/crypto/ipsec_mb/pmd_snow3g.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/crypto/ipsec_mb/pmd_snow3g.c b/drivers/crypto/ipsec_mb/pmd_snow3g.c
index ebc9a0b562..9a85f46721 100644
--- a/drivers/crypto/ipsec_mb/pmd_snow3g.c
+++ b/drivers/crypto/ipsec_mb/pmd_snow3g.c
@@ -423,10 +423,11 @@ process_op_bit(struct rte_crypto_op *op, struct snow3g_session *session,
 	}
 
-	enqueued_op = rte_ring_enqueue_burst(qp->ingress_queue,
-			(void **)&op, processed_op, NULL);
+	if (unlikely(processed_op != 1))
+		return 0;
+	enqueued_op = rte_ring_enqueue(qp->ingress_queue, op);
 	qp->stats.enqueued_count += enqueued_op;
 	*accumulated_enqueued_ops += enqueued_op;
 
-	return enqueued_op;
+	return 1;
 }
 
-- 
2.34.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-06-20 10:46:28.047992484 +0100
+++ 0012-crypto-ipsec_mb-fix-build-with-GCC-12.patch	2022-06-20 10:46:27.788146840 +0100
@@ -1 +1 @@
-From 468f31eb71c4c2aa454841b316766514cabd0f02 Mon Sep 17 00:00:00 2001
+From c86456efc916bff6ecb9b6ab9664c9409d1a3fe2 Mon Sep 17 00:00:00 2001
@@ -8,0 +9,2 @@
+[ upstream commit 468f31eb71c4c2aa454841b316766514cabd0f02 ]
+
@@ -41 +42,0 @@
-Cc: stable@dpdk.org


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

* patch 'net/ena: fix build with GCC 12' has been queued to stable release 21.11.2
  2022-06-20  9:47 patch 'raw/ifpga: remove virtual devices on close' has been queued to stable release 21.11.2 Kevin Traynor
                   ` (10 preceding siblings ...)
  2022-06-20  9:47 ` patch 'crypto/ipsec_mb: fix build with GCC 12' " Kevin Traynor
@ 2022-06-20  9:47 ` Kevin Traynor
  2022-06-20  9:47 ` patch 'net/enetfec: " Kevin Traynor
                   ` (5 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: Kevin Traynor @ 2022-06-20  9:47 UTC (permalink / raw)
  To: David Marchand; +Cc: Stephen Hemminger, dpdk stable

Hi,

FYI, your patch has been queued to stable release 21.11.2

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/23/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

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

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

Thanks.

Kevin

---
From 9c1822f59fc41558231b6e67d6feac5a225fcbdb Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Wed, 18 May 2022 12:16:49 +0200
Subject: [PATCH] net/ena: fix build with GCC 12
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit 2449949584667fbb275df1ea5a5ceeead1a65786 ]

GCC 12 raises the following warning:

In file included from ../lib/mempool/rte_mempool.h:46,
                 from ../lib/mbuf/rte_mbuf.h:38,
                 from ../lib/net/rte_ether.h:22,
                 from ../drivers/net/ena/ena_ethdev.h:10,
                 from ../drivers/net/ena/ena_rss.c:6:
../drivers/net/ena/ena_rss.c: In function ‘ena_rss_key_fill’:
../lib/eal/x86/include/rte_memcpy.h:370:9: warning: array subscript 64 is
        outside array bounds of ‘uint8_t[40]’
        {aka ‘unsigned char[40]’} [-Warray-bounds]
  370 | rte_mov32((uint8_t *)dst + 2 * 32, (const uint8_t *)src + 2 * 32);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/net/ena/ena_rss.c:51:24: note: while referencing ‘default_key’
   51 | static uint8_t default_key[ENA_HASH_KEY_SIZE];
      |                ^~~~~~~~~~~

This is a false positive because the copied size is checked against
ENA_HASH_KEY_SIZE in a (build) assert.
Silence this warning by calling memcpy with the minimal size.

Bugzilla ID: 849

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/ena/ena_rss.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ena/ena_rss.c b/drivers/net/ena/ena_rss.c
index be4007e3f3..8193eaf6fc 100644
--- a/drivers/net/ena/ena_rss.c
+++ b/drivers/net/ena/ena_rss.c
@@ -52,13 +52,12 @@ void ena_rss_key_fill(void *key, size_t size)
 	size_t i;
 
-	RTE_ASSERT(size <= ENA_HASH_KEY_SIZE);
-
 	if (!key_generated) {
-		for (i = 0; i < ENA_HASH_KEY_SIZE; ++i)
+		for (i = 0; i < RTE_DIM(default_key); ++i)
 			default_key[i] = rte_rand() & 0xff;
 		key_generated = true;
 	}
 
-	rte_memcpy(key, default_key, size);
+	RTE_ASSERT(size <= sizeof(default_key));
+	rte_memcpy(key, default_key, RTE_MIN(size, sizeof(default_key)));
 }
 
-- 
2.34.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-06-20 10:46:28.067276188 +0100
+++ 0013-net-ena-fix-build-with-GCC-12.patch	2022-06-20 10:46:27.788146840 +0100
@@ -1 +1 @@
-From 2449949584667fbb275df1ea5a5ceeead1a65786 Mon Sep 17 00:00:00 2001
+From 9c1822f59fc41558231b6e67d6feac5a225fcbdb Mon Sep 17 00:00:00 2001
@@ -8,0 +9,2 @@
+[ upstream commit 2449949584667fbb275df1ea5a5ceeead1a65786 ]
+
@@ -31 +32,0 @@
-Cc: stable@dpdk.org
@@ -40 +41 @@
-index b6c4f76e38..b682d01c20 100644
+index be4007e3f3..8193eaf6fc 100644


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

* patch 'net/enetfec: fix build with GCC 12' has been queued to stable release 21.11.2
  2022-06-20  9:47 patch 'raw/ifpga: remove virtual devices on close' has been queued to stable release 21.11.2 Kevin Traynor
                   ` (11 preceding siblings ...)
  2022-06-20  9:47 ` patch 'net/ena: " Kevin Traynor
@ 2022-06-20  9:47 ` Kevin Traynor
  2022-06-20  9:47 ` patch 'net/ice: " Kevin Traynor
                   ` (4 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: Kevin Traynor @ 2022-06-20  9:47 UTC (permalink / raw)
  To: David Marchand; +Cc: Stephen Hemminger, Sachin Saxena, dpdk stable

Hi,

FYI, your patch has been queued to stable release 21.11.2

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/23/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

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

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

Thanks.

Kevin

---
From ac8e3a7546ecf4c0b0a753c1efd8327e3a3e96f1 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Wed, 18 May 2022 12:16:50 +0200
Subject: [PATCH] net/enetfec: fix build with GCC 12
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit 7c3c0d0f290cfc03dc0e75013af8035b450ee114 ]

GCC 12 raises the following warning:

../drivers/net/enetfec/enet_ethdev.c: In function
        ‘enetfec_rx_queue_setup’:
../drivers/net/enetfec/enet_ethdev.c:473:9: error: array
        subscript 1 is
    above array bounds of ‘uint32_t[1]’ {aka ‘unsigned int[1]’}
        [-Werror=array-bounds]
  473 | rte_write32(rte_cpu_to_le_32(fep->bd_addr_p_r[queue_idx]),
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  474 |     (uint8_t *)fep->hw_baseaddr_v + ENETFEC_RD_START(queue_idx));
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../drivers/net/enetfec/enet_ethdev.c:9:
../drivers/net/enetfec/enet_ethdev.h:113:33: note: while referencing
        ‘bd_addr_p_r’
  113 | uint32_t                bd_addr_p_r[ENETFEC_MAX_Q];
      |                                 ^~~~~~~~~~~

This driver properly announces that it only supports 1 rxq.
Silence this warning by adding an explicit check on the queue id.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Sachin Saxena <sachin.saxena@nxp.com>
---
 drivers/net/enetfec/enet_ethdev.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/net/enetfec/enet_ethdev.c b/drivers/net/enetfec/enet_ethdev.c
index 714f8ac7ec..c938e58204 100644
--- a/drivers/net/enetfec/enet_ethdev.c
+++ b/drivers/net/enetfec/enet_ethdev.c
@@ -3,7 +3,10 @@
  */
 
+#include <inttypes.h>
+
 #include <ethdev_vdev.h>
 #include <ethdev_driver.h>
 #include <rte_io.h>
+
 #include "enet_pmd_logs.h"
 #include "enet_ethdev.h"
@@ -455,4 +458,10 @@ enetfec_rx_queue_setup(struct rte_eth_dev *dev,
 	}
 
+	if (queue_idx >= ENETFEC_MAX_Q) {
+		ENETFEC_PMD_ERR("Invalid queue id %" PRIu16 ", max %d\n",
+			queue_idx, ENETFEC_MAX_Q);
+		return -EINVAL;
+	}
+
 	/* allocate receive queue */
 	rxq = rte_zmalloc(NULL, sizeof(*rxq), RTE_CACHE_LINE_SIZE);
-- 
2.34.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-06-20 10:46:28.086561380 +0100
+++ 0014-net-enetfec-fix-build-with-GCC-12.patch	2022-06-20 10:46:27.789146842 +0100
@@ -1 +1 @@
-From 7c3c0d0f290cfc03dc0e75013af8035b450ee114 Mon Sep 17 00:00:00 2001
+From ac8e3a7546ecf4c0b0a753c1efd8327e3a3e96f1 Mon Sep 17 00:00:00 2001
@@ -8,0 +9,2 @@
+[ upstream commit 7c3c0d0f290cfc03dc0e75013af8035b450ee114 ]
+
@@ -29,2 +30,0 @@
-
-Cc: stable@dpdk.org


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

* patch 'net/ice: fix build with GCC 12' has been queued to stable release 21.11.2
  2022-06-20  9:47 patch 'raw/ifpga: remove virtual devices on close' has been queued to stable release 21.11.2 Kevin Traynor
                   ` (12 preceding siblings ...)
  2022-06-20  9:47 ` patch 'net/enetfec: " Kevin Traynor
@ 2022-06-20  9:47 ` Kevin Traynor
  2022-06-20  9:47 ` patch 'vdpa/ifc: " Kevin Traynor
                   ` (3 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: Kevin Traynor @ 2022-06-20  9:47 UTC (permalink / raw)
  To: David Marchand; +Cc: Stephen Hemminger, dpdk stable

Hi,

FYI, your patch has been queued to stable release 21.11.2

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/23/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

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

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

Thanks.

Kevin

---
From ec6a2fa05c425c42071d164c82d46d0f62ff2e1c Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Wed, 18 May 2022 12:16:51 +0200
Subject: [PATCH] net/ice: fix build with GCC 12
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit 20d6a017e148cc1944d85d4c80a0151a5b4c6436 ]

GCC 12 raises the following warning:

In file included from ../lib/mempool/rte_mempool.h:46,
                 from ../lib/mbuf/rte_mbuf.h:38,
                 from ../lib/net/rte_ether.h:22,
                 from ../lib/ethdev/rte_ethdev.h:172,
                 from ../lib/ethdev/ethdev_driver.h:22,
                 from ../lib/ethdev/ethdev_pci.h:17,
                 from ../drivers/net/ice/ice_ethdev.c:6:
../drivers/net/ice/ice_ethdev.c: In function ‘ice_dev_configure’:
../lib/eal/x86/include/rte_memcpy.h:370:9: warning: array subscript 64 is
        outside array bounds of ‘struct ice_aqc_get_set_rss_keys[1]’
        [-Warray-bounds]
  370 | rte_mov32((uint8_t *)dst + 2 * 32, (const uint8_t *)src + 2 * 32);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/net/ice/ice_ethdev.c:3202:41: note: while referencing ‘key’
 3202 |         struct ice_aqc_get_set_rss_keys key;
      |                                         ^~~

Restrict copy to minimum size.

Bugzilla ID: 850

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/ice/ice_ethdev.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index ab3976a319..7df1b4ec19 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -3236,5 +3236,6 @@ static int ice_init_rss(struct ice_pf *pf)
 				   vsi->rss_key_size));
 
-	rte_memcpy(key.standard_rss_key, vsi->rss_key, vsi->rss_key_size);
+	rte_memcpy(key.standard_rss_key, vsi->rss_key,
+		RTE_MIN(sizeof(key.standard_rss_key), vsi->rss_key_size));
 	ret = ice_aq_set_rss_key(hw, vsi->idx, &key);
 	if (ret)
-- 
2.34.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-06-20 10:46:28.106624872 +0100
+++ 0015-net-ice-fix-build-with-GCC-12.patch	2022-06-20 10:46:27.794146852 +0100
@@ -1 +1 @@
-From 20d6a017e148cc1944d85d4c80a0151a5b4c6436 Mon Sep 17 00:00:00 2001
+From ec6a2fa05c425c42071d164c82d46d0f62ff2e1c Mon Sep 17 00:00:00 2001
@@ -8,0 +9,2 @@
+[ upstream commit 20d6a017e148cc1944d85d4c80a0151a5b4c6436 ]
+
@@ -31 +32,0 @@
-Cc: stable@dpdk.org
@@ -40 +41 @@
-index 35ab542e61..4c658ce3dc 100644
+index ab3976a319..7df1b4ec19 100644
@@ -43 +44 @@
-@@ -3283,5 +3283,6 @@ static int ice_init_rss(struct ice_pf *pf)
+@@ -3236,5 +3236,6 @@ static int ice_init_rss(struct ice_pf *pf)


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

* patch 'vdpa/ifc: fix build with GCC 12' has been queued to stable release 21.11.2
  2022-06-20  9:47 patch 'raw/ifpga: remove virtual devices on close' has been queued to stable release 21.11.2 Kevin Traynor
                   ` (13 preceding siblings ...)
  2022-06-20  9:47 ` patch 'net/ice: " Kevin Traynor
@ 2022-06-20  9:47 ` Kevin Traynor
  2022-06-20  9:47 ` patch 'app/flow-perf: " Kevin Traynor
                   ` (2 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: Kevin Traynor @ 2022-06-20  9:47 UTC (permalink / raw)
  To: David Marchand; +Cc: Xiao Wang, Stephen Hemminger, dpdk stable

Hi,

FYI, your patch has been queued to stable release 21.11.2

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/23/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

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

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

Thanks.

Kevin

---
From f85d0fc3975bb20a6cdbbef21408f3d8d00e2a3f Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Wed, 18 May 2022 12:16:54 +0200
Subject: [PATCH] vdpa/ifc: fix build with GCC 12
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit 2a213b794fdd255fde7581a7c9bd034ab39e9b6a ]

GCC 12 raises the following warning:

../drivers/vdpa/ifc/ifcvf_vdpa.c: In function ‘vdpa_enable_vfio_intr’:
../drivers/vdpa/ifc/ifcvf_vdpa.c:383:62: error: writing 4 bytes into a
    region of size 0 [-Werror=stringop-overflow=]
  383 |                         fd_ptr[RTE_INTR_VEC_RXTX_OFFSET + i] = fd;
      |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
../drivers/vdpa/ifc/ifcvf_vdpa.c:348:14: note: at offset 32 into
    destination object ‘irq_set_buf’ of size 32
  348 |         char irq_set_buf[MSIX_IRQ_SET_BUF_LEN];
      |              ^~~~~~~~~~~

Validate number of vrings to avoid out of bound access.

Bugzilla ID: 855

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/vdpa/ifc/ifcvf_vdpa.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c
index 3853c4cf7e..6a915b0d5e 100644
--- a/drivers/vdpa/ifc/ifcvf_vdpa.c
+++ b/drivers/vdpa/ifc/ifcvf_vdpa.c
@@ -357,4 +357,6 @@ vdpa_enable_vfio_intr(struct ifcvf_internal *internal, bool m_rx)
 
 	nr_vring = rte_vhost_get_vring_num(internal->vid);
+	if (nr_vring > IFCVF_MAX_QUEUES * 2)
+		return -1;
 
 	irq_set = (struct vfio_irq_set *)irq_set_buf;
-- 
2.34.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-06-20 10:46:28.129141593 +0100
+++ 0016-vdpa-ifc-fix-build-with-GCC-12.patch	2022-06-20 10:46:27.794146852 +0100
@@ -1 +1 @@
-From 2a213b794fdd255fde7581a7c9bd034ab39e9b6a Mon Sep 17 00:00:00 2001
+From f85d0fc3975bb20a6cdbbef21408f3d8d00e2a3f Mon Sep 17 00:00:00 2001
@@ -8,0 +9,2 @@
+[ upstream commit 2a213b794fdd255fde7581a7c9bd034ab39e9b6a ]
+
@@ -24 +25,0 @@
-Cc: stable@dpdk.org
@@ -34 +35 @@
-index 40a18b2507..8bc971cb12 100644
+index 3853c4cf7e..6a915b0d5e 100644
@@ -37 +38 @@
-@@ -389,4 +389,6 @@ vdpa_enable_vfio_intr(struct ifcvf_internal *internal, bool m_rx)
+@@ -357,4 +357,6 @@ vdpa_enable_vfio_intr(struct ifcvf_internal *internal, bool m_rx)


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

* patch 'app/flow-perf: fix build with GCC 12' has been queued to stable release 21.11.2
  2022-06-20  9:47 patch 'raw/ifpga: remove virtual devices on close' has been queued to stable release 21.11.2 Kevin Traynor
                   ` (14 preceding siblings ...)
  2022-06-20  9:47 ` patch 'vdpa/ifc: " Kevin Traynor
@ 2022-06-20  9:47 ` Kevin Traynor
  2022-06-20  9:47 ` patch 'dma/skeleton: fix index returned when no memcpy completed' " Kevin Traynor
  2022-06-20  9:47 ` patch 'dma/hisilicon: fix includes in header file' " Kevin Traynor
  17 siblings, 0 replies; 19+ messages in thread
From: Kevin Traynor @ 2022-06-20  9:47 UTC (permalink / raw)
  To: David Marchand; +Cc: Bruce Richardson, Stephen Hemminger, dpdk stable

Hi,

FYI, your patch has been queued to stable release 21.11.2

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/23/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

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

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

Thanks.

Kevin

---
From 675b5bdf2c1434493f508f6cf909e33ed0e019b5 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Wed, 18 May 2022 12:16:56 +0200
Subject: [PATCH] app/flow-perf: fix build with GCC 12
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit 5fc2eece8d4530988e5681fdc8a35e14d69b2a6f ]

GCC 12 raises the following warning:

../app/test-flow-perf/main.c: In function ‘start_forwarding’:
../app/test-flow-perf/main.c:1737:28: error: ‘sprintf’ may write a
    terminating nul past the end of the destination
    [-Werror=format-overflow=]
 1737 |         sprintf(p[i++], "%d", (int)n);
      |                            ^
In function ‘pretty_number’,
    inlined from ‘packet_per_second_stats’ at
        ../app/test-flow-perf/main.c:1792:4,
    inlined from ‘start_forwarding’ at
        ../app/test-flow-perf/main.c:1831:3:
[...]

We can simplify this code and rely on libc integer formatting via
this system locales.

Bugzilla ID: 856

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
---
 app/test-flow-perf/main.c | 48 ++++++++-------------------------------
 1 file changed, 9 insertions(+), 39 deletions(-)

diff --git a/app/test-flow-perf/main.c b/app/test-flow-perf/main.c
index 56d43734e3..f375097028 100644
--- a/app/test-flow-perf/main.c
+++ b/app/test-flow-perf/main.c
@@ -17,4 +17,5 @@
  */
 
+#include <locale.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -1714,34 +1715,4 @@ do_tx(struct lcore_info *li, uint16_t cnt, uint16_t tx_port,
 }
 
-/*
- * Method to convert numbers into pretty numbers that easy
- * to read. The design here is to add comma after each three
- * digits and set all of this inside buffer.
- *
- * For example if n = 1799321, the output will be
- * 1,799,321 after this method which is easier to read.
- */
-static char *
-pretty_number(uint64_t n, char *buf)
-{
-	char p[6][4];
-	int i = 0;
-	int off = 0;
-
-	while (n > 1000) {
-		sprintf(p[i], "%03d", (int)(n % 1000));
-		n /= 1000;
-		i += 1;
-	}
-
-	sprintf(p[i++], "%d", (int)n);
-
-	while (i--)
-		off += sprintf(buf + off, "%s,", p[i]);
-	buf[strlen(buf) - 1] = '\0';
-
-	return buf;
-}
-
 static void
 packet_per_second_stats(void)
@@ -1765,5 +1736,4 @@ packet_per_second_stats(void)
 		uint64_t total_tx_drops = 0;
 		uint64_t tx_delta, rx_delta, drops_delta;
-		char buf[3][32];
 		int nr_valid_core = 0;
 
@@ -1790,8 +1760,6 @@ packet_per_second_stats(void)
 			rx_delta    = li->rx_pkts  - oli->rx_pkts;
 			drops_delta = li->tx_drops - oli->tx_drops;
-			printf("%6d %16s %16s %16s\n", i,
-				pretty_number(tx_delta,    buf[0]),
-				pretty_number(drops_delta, buf[1]),
-				pretty_number(rx_delta,    buf[2]));
+			printf("%6d %'16"PRId64" %'16"PRId64" %'16"PRId64"\n",
+				i, tx_delta, drops_delta, rx_delta);
 
 			total_tx_pkts  += tx_delta;
@@ -1804,8 +1772,7 @@ packet_per_second_stats(void)
 
 		if (nr_valid_core > 1) {
-			printf("%6s %16s %16s %16s\n", "total",
-				pretty_number(total_tx_pkts,  buf[0]),
-				pretty_number(total_tx_drops, buf[1]),
-				pretty_number(total_rx_pkts,  buf[2]));
+			printf("%6s %'16"PRId64" %'16"PRId64" %'16"PRId64"\n",
+				"total", total_tx_pkts, total_tx_drops,
+				total_rx_pkts);
 			nr_lines += 1;
 		}
@@ -2140,4 +2107,7 @@ main(int argc, char **argv)
 		args_parse(argc, argv);
 
+	/* For more fancy, localised integer formatting. */
+	setlocale(LC_NUMERIC, "");
+
 	init_port();
 
-- 
2.34.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-06-20 10:46:28.149300271 +0100
+++ 0017-app-flow-perf-fix-build-with-GCC-12.patch	2022-06-20 10:46:27.796146856 +0100
@@ -1 +1 @@
-From 5fc2eece8d4530988e5681fdc8a35e14d69b2a6f Mon Sep 17 00:00:00 2001
+From 675b5bdf2c1434493f508f6cf909e33ed0e019b5 Mon Sep 17 00:00:00 2001
@@ -8,0 +9,2 @@
+[ upstream commit 5fc2eece8d4530988e5681fdc8a35e14d69b2a6f ]
+
@@ -28 +29,0 @@
-Cc: stable@dpdk.org


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

* patch 'dma/skeleton: fix index returned when no memcpy completed' has been queued to stable release 21.11.2
  2022-06-20  9:47 patch 'raw/ifpga: remove virtual devices on close' has been queued to stable release 21.11.2 Kevin Traynor
                   ` (15 preceding siblings ...)
  2022-06-20  9:47 ` patch 'app/flow-perf: " Kevin Traynor
@ 2022-06-20  9:47 ` Kevin Traynor
  2022-06-20  9:47 ` patch 'dma/hisilicon: fix includes in header file' " Kevin Traynor
  17 siblings, 0 replies; 19+ messages in thread
From: Kevin Traynor @ 2022-06-20  9:47 UTC (permalink / raw)
  To: Chengwen Feng; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 21.11.2

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/23/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

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

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

Thanks.

Kevin

---
From e027f40cd22e85c1790a12d8441c8659025fc228 Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen@huawei.com>
Date: Wed, 8 Jun 2022 16:50:05 +0800
Subject: [PATCH] dma/skeleton: fix index returned when no memcpy completed

[ upstream commit 618a40a0c97f4e80b05d2dce4d63eecc6210a242 ]

If no memcopy request is completed, the ring_idx of the last completed
operation need returned by last_idx parameter. This patch fixes it.

Fixes: 05d5fc66a269 ("dma/skeleton: introduce skeleton driver")

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
---
 drivers/dma/skeleton/skeleton_dmadev.c | 17 ++++++++++++++---
 drivers/dma/skeleton/skeleton_dmadev.h |  1 +
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/drivers/dma/skeleton/skeleton_dmadev.c b/drivers/dma/skeleton/skeleton_dmadev.c
index 81cbdd286e..6b0bb14e2c 100644
--- a/drivers/dma/skeleton/skeleton_dmadev.c
+++ b/drivers/dma/skeleton/skeleton_dmadev.c
@@ -119,4 +119,5 @@ skeldma_start(struct rte_dma_dev *dev)
 	fflush_ring(hw, hw->desc_completed);
 	hw->ridx = 0;
+	hw->last_ridx = hw->ridx - 1;
 	hw->submitted_count = 0;
 	hw->zero_req_count = 0;
@@ -323,7 +324,9 @@ skeldma_dump(const struct rte_dma_dev *dev, FILE *f)
 	(void)fprintf(f,
 		"    next_ring_idx: %u\n"
+		"    last_ring_idx: %u\n"
 		"    submitted_count: %" PRIu64 "\n"
 		"    completed_count: %" PRIu64 "\n",
-		hw->ridx, hw->submitted_count, hw->completed_count);
+		hw->ridx, hw->last_ridx,
+		hw->submitted_count, hw->completed_count);
 
 	return 0;
@@ -399,9 +402,13 @@ skeldma_completed(void *dev_private,
 	while (index < count) {
 		(void)rte_ring_dequeue(hw->desc_completed, (void **)&desc);
-		if (index == count - 1)
+		if (index == count - 1) {
+			hw->last_ridx = desc->ridx;
 			*last_idx = desc->ridx;
+		}
 		index++;
 		(void)rte_ring_enqueue(hw->desc_empty, (void *)desc);
 	}
+	if (unlikely(count == 0))
+		*last_idx = hw->last_ridx;
 
 	return count;
@@ -423,9 +430,13 @@ skeldma_completed_status(void *dev_private,
 	while (index < count) {
 		(void)rte_ring_dequeue(hw->desc_completed, (void **)&desc);
-		if (index == count - 1)
+		if (index == count - 1) {
+			hw->last_ridx = desc->ridx;
 			*last_idx = desc->ridx;
+		}
 		status[index++] = RTE_DMA_STATUS_SUCCESSFUL;
 		(void)rte_ring_enqueue(hw->desc_empty, (void *)desc);
 	}
+	if (unlikely(count == 0))
+		*last_idx = hw->last_ridx;
 
 	return count;
diff --git a/drivers/dma/skeleton/skeleton_dmadev.h b/drivers/dma/skeleton/skeleton_dmadev.h
index 91eb5460fc..6f89400480 100644
--- a/drivers/dma/skeleton/skeleton_dmadev.h
+++ b/drivers/dma/skeleton/skeleton_dmadev.h
@@ -51,4 +51,5 @@ struct skeldma_hw {
 	char cache1 __rte_cache_aligned;
 	uint16_t ridx;  /* ring idx */
+	uint16_t last_ridx;
 	uint64_t submitted_count;
 
-- 
2.34.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-06-20 10:46:28.169434815 +0100
+++ 0018-dma-skeleton-fix-index-returned-when-no-memcpy-compl.patch	2022-06-20 10:46:27.796146856 +0100
@@ -1 +1 @@
-From 618a40a0c97f4e80b05d2dce4d63eecc6210a242 Mon Sep 17 00:00:00 2001
+From e027f40cd22e85c1790a12d8441c8659025fc228 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 618a40a0c97f4e80b05d2dce4d63eecc6210a242 ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org


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

* patch 'dma/hisilicon: fix includes in header file' has been queued to stable release 21.11.2
  2022-06-20  9:47 patch 'raw/ifpga: remove virtual devices on close' has been queued to stable release 21.11.2 Kevin Traynor
                   ` (16 preceding siblings ...)
  2022-06-20  9:47 ` patch 'dma/skeleton: fix index returned when no memcpy completed' " Kevin Traynor
@ 2022-06-20  9:47 ` Kevin Traynor
  17 siblings, 0 replies; 19+ messages in thread
From: Kevin Traynor @ 2022-06-20  9:47 UTC (permalink / raw)
  To: Min Hu (Connor); +Cc: Chengwen Feng, dpdk stable

Hi,

FYI, your patch has been queued to stable release 21.11.2

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/23/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

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

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

Thanks.

Kevin

---
From 8e8886a0e995f698fee349c12a455649b5b41250 Mon Sep 17 00:00:00 2001
From: "Min Hu (Connor)" <humin29@huawei.com>
Date: Tue, 14 Jun 2022 17:33:19 +0800
Subject: [PATCH] dma/hisilicon: fix includes in header file

[ upstream commit 7342e612052ae3ec875ae018548324d29abfa9c2 ]

Header files should be self contained. This patch fixed it.

Fixes: 9e16317a38f9 ("dma/hisilicon: add probing")

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
---
 drivers/dma/hisilicon/hisi_dmadev.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/dma/hisilicon/hisi_dmadev.h b/drivers/dma/hisilicon/hisi_dmadev.h
index 12e209c86e..f06c851825 100644
--- a/drivers/dma/hisilicon/hisi_dmadev.h
+++ b/drivers/dma/hisilicon/hisi_dmadev.h
@@ -8,4 +8,6 @@
 #include <rte_byteorder.h>
 #include <rte_common.h>
+#include <rte_memzone.h>
+#include <rte_dmadev_pmd.h>
 
 #define BIT(x)	(1ul << (x))
-- 
2.34.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-06-20 10:46:28.189242595 +0100
+++ 0019-dma-hisilicon-fix-includes-in-header-file.patch	2022-06-20 10:46:27.797146858 +0100
@@ -1 +1 @@
-From 7342e612052ae3ec875ae018548324d29abfa9c2 Mon Sep 17 00:00:00 2001
+From 8e8886a0e995f698fee349c12a455649b5b41250 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 7342e612052ae3ec875ae018548324d29abfa9c2 ]
+
@@ -9 +10,0 @@
-Cc: stable@dpdk.org
@@ -18 +19 @@
-index deb1357eea..5a17f9f69e 100644
+index 12e209c86e..f06c851825 100644


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

end of thread, other threads:[~2022-06-20  9:48 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-20  9:47 patch 'raw/ifpga: remove virtual devices on close' has been queued to stable release 21.11.2 Kevin Traynor
2022-06-20  9:47 ` patch 'raw/ifpga: unregister interrupt " Kevin Traynor
2022-06-20  9:47 ` patch 'bus/fslmc: fix VFIO setup' " Kevin Traynor
2022-06-20  9:47 ` patch 'doc: fix formatting and link in BPF library guide' " Kevin Traynor
2022-06-20  9:47 ` patch 'dma/idxd: fix error code for PCI device commands' " Kevin Traynor
2022-06-20  9:47 ` patch 'app/testpmd: fix packet segment allocation' " Kevin Traynor
2022-06-20  9:47 ` patch 'app/testpmd: fix multicast address pool leak' " Kevin Traynor
2022-06-20  9:47 ` patch 'net/failsafe: fix device freeing' " Kevin Traynor
2022-06-20  9:47 ` patch 'net/tap: " Kevin Traynor
2022-06-20  9:47 ` patch 'kni: use dedicated function to set random MAC address' " Kevin Traynor
2022-06-20  9:47 ` patch 'kni: use dedicated function to set " Kevin Traynor
2022-06-20  9:47 ` patch 'crypto/ipsec_mb: fix build with GCC 12' " Kevin Traynor
2022-06-20  9:47 ` patch 'net/ena: " Kevin Traynor
2022-06-20  9:47 ` patch 'net/enetfec: " Kevin Traynor
2022-06-20  9:47 ` patch 'net/ice: " Kevin Traynor
2022-06-20  9:47 ` patch 'vdpa/ifc: " Kevin Traynor
2022-06-20  9:47 ` patch 'app/flow-perf: " Kevin Traynor
2022-06-20  9:47 ` patch 'dma/skeleton: fix index returned when no memcpy completed' " Kevin Traynor
2022-06-20  9:47 ` patch 'dma/hisilicon: fix includes in header file' " Kevin Traynor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).