patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Kevin Traynor <ktraynor@redhat.com>
To: Wei Huang <wei.huang@intel.com>
Cc: Tianfei Zhang <tianfei.zhang@intel.com>,
	Rosen Xu <rosen.xu@intel.com>, dpdk stable <stable@dpdk.org>
Subject: patch 'raw/ifpga: unregister interrupt on close' has been queued to stable release 21.11.2
Date: Mon, 20 Jun 2022 10:47:35 +0100	[thread overview]
Message-ID: <20220620094752.1027299-2-ktraynor@redhat.com> (raw)
In-Reply-To: <20220620094752.1027299-1-ktraynor@redhat.com>

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)


  reply	other threads:[~2022-06-20  9:48 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-20  9:47 patch 'raw/ifpga: remove virtual devices " Kevin Traynor
2022-06-20  9:47 ` Kevin Traynor [this message]
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

Reply instructions:

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

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

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

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

  git send-email \
    --in-reply-to=20220620094752.1027299-2-ktraynor@redhat.com \
    --to=ktraynor@redhat.com \
    --cc=rosen.xu@intel.com \
    --cc=stable@dpdk.org \
    --cc=tianfei.zhang@intel.com \
    --cc=wei.huang@intel.com \
    /path/to/YOUR_REPLY

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

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