patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Kevin Traynor <ktraynor@redhat.com>
To: Romain Delhomel <romain.delhomel@6wind.com>
Cc: Hemant Agrawal <hemant.agrawal@nxp.com>, dpdk stable <stable@dpdk.org>
Subject: patch 'bus/fslmc: fix VFIO setup' has been queued to stable release 21.11.2
Date: Mon, 20 Jun 2022 10:47:36 +0100	[thread overview]
Message-ID: <20220620094752.1027299-3-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/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)


  parent 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 on close' " Kevin Traynor
2022-06-20  9:47 ` patch 'raw/ifpga: unregister interrupt " Kevin Traynor
2022-06-20  9:47 ` Kevin Traynor [this message]
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-3-ktraynor@redhat.com \
    --to=ktraynor@redhat.com \
    --cc=hemant.agrawal@nxp.com \
    --cc=romain.delhomel@6wind.com \
    --cc=stable@dpdk.org \
    /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).