patch 'raw/ifpga: fix free function mismatch in interrupt config' has been queued to stable release 21.11.9

Kevin Traynor ktraynor at redhat.com
Wed Nov 27 18:17:22 CET 2024


Hi,

FYI, your patch has been queued to stable release 21.11.9

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 12/02/24. So please
shout if anyone has objections.

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

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

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

Thanks.

Kevin

---
>From de0b999d7b60f5c2d91ece77778eb76cc9962448 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen at networkplumber.org>
Date: Tue, 8 Oct 2024 09:47:18 -0700
Subject: [PATCH] raw/ifpga: fix free function mismatch in interrupt config
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit d891a597895bb65db42404440660f82092780750 ]

The raw ifpga driver redefines malloc to be opae_malloc
and free to be opae_free; which is a bad idea.

This leads to case where interrupt efd array is allocated with calloc()
and then passed to rte_free.
The workaround is to allocate the array with rte_calloc() instead.

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

Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
Acked-by: Morten Brørup <mb at smartsharesystems.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev at huawei.com>
Acked-by: Wathsala Vithanage <wathsala.vithanage at arm.com>
---
 drivers/raw/ifpga/ifpga_rawdev.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/raw/ifpga/ifpga_rawdev.c b/drivers/raw/ifpga/ifpga_rawdev.c
index cb0427157a..8df09e0cde 100644
--- a/drivers/raw/ifpga/ifpga_rawdev.c
+++ b/drivers/raw/ifpga/ifpga_rawdev.c
@@ -1496,5 +1496,5 @@ ifpga_register_msix_irq(struct ifpga_rawdev *dev, int port_id,
 		nb_intr = rte_intr_nb_intr_get(*intr_handle);
 
-		intr_efds = calloc(nb_intr, sizeof(int));
+		intr_efds = rte_calloc("ifpga_efds", nb_intr, sizeof(int), 0);
 		if (!intr_efds)
 			return -ENOMEM;
@@ -1505,5 +1505,5 @@ ifpga_register_msix_irq(struct ifpga_rawdev *dev, int port_id,
 		ret = opae_acc_set_irq(acc, vec_start, count, intr_efds);
 		if (ret) {
-			free(intr_efds);
+			rte_free(intr_efds);
 			return -EINVAL;
 		}
@@ -1514,5 +1514,5 @@ ifpga_register_msix_irq(struct ifpga_rawdev *dev, int port_id,
 			handler, (void *)arg);
 	if (ret) {
-		free(intr_efds);
+		rte_free(intr_efds);
 		return -EINVAL;
 	}
@@ -1520,5 +1520,5 @@ ifpga_register_msix_irq(struct ifpga_rawdev *dev, int port_id,
 	IFPGA_RAWDEV_PMD_INFO("success register %s interrupt\n", name);
 
-	free(intr_efds);
+	rte_free(intr_efds);
 	return 0;
 }
-- 
2.47.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-11-27 17:17:38.800743910 +0000
+++ 0015-raw-ifpga-fix-free-function-mismatch-in-interrupt-co.patch	2024-11-27 17:17:38.171269093 +0000
@@ -1 +1 @@
-From d891a597895bb65db42404440660f82092780750 Mon Sep 17 00:00:00 2001
+From de0b999d7b60f5c2d91ece77778eb76cc9962448 Mon Sep 17 00:00:00 2001
@@ -8,0 +9,2 @@
+[ upstream commit d891a597895bb65db42404440660f82092780750 ]
+
@@ -17 +18,0 @@
-Cc: stable at dpdk.org
@@ -28 +29 @@
-index 113a22b0a7..5b9b596435 100644
+index cb0427157a..8df09e0cde 100644
@@ -31 +32 @@
-@@ -1500,5 +1500,5 @@ ifpga_register_msix_irq(struct ifpga_rawdev *dev, int port_id,
+@@ -1496,5 +1496,5 @@ ifpga_register_msix_irq(struct ifpga_rawdev *dev, int port_id,
@@ -38 +39 @@
-@@ -1509,5 +1509,5 @@ ifpga_register_msix_irq(struct ifpga_rawdev *dev, int port_id,
+@@ -1505,5 +1505,5 @@ ifpga_register_msix_irq(struct ifpga_rawdev *dev, int port_id,
@@ -45 +46 @@
-@@ -1518,5 +1518,5 @@ ifpga_register_msix_irq(struct ifpga_rawdev *dev, int port_id,
+@@ -1514,5 +1514,5 @@ ifpga_register_msix_irq(struct ifpga_rawdev *dev, int port_id,
@@ -52,2 +53,2 @@
-@@ -1524,5 +1524,5 @@ ifpga_register_msix_irq(struct ifpga_rawdev *dev, int port_id,
- 	IFPGA_RAWDEV_PMD_INFO("success register %s interrupt", name);
+@@ -1520,5 +1520,5 @@ ifpga_register_msix_irq(struct ifpga_rawdev *dev, int port_id,
+ 	IFPGA_RAWDEV_PMD_INFO("success register %s interrupt\n", name);



More information about the stable mailing list