DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] bus/pci: set intr_handle type for secondary processes
@ 2018-09-27 12:30 Alejandro Lucero
  2018-10-18 16:26 ` Burakov, Anatoly
  0 siblings, 1 reply; 5+ messages in thread
From: Alejandro Lucero @ 2018-09-27 12:30 UTC (permalink / raw)
  To: dev

Invoking rte_pci_read/write_config functions requires device with
a intr_handle type for using VFIO or UIO driver related functions.

Secondary processes rely on primary processes for device initialization
so they do not usually require using these functions. However, some PMDs,
like NFP PMD, require using these functions even for secondary processes.

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
---
 drivers/bus/pci/linux/pci_vfio.c | 2 ++
 drivers/bus/pci/pci_common_uio.c | 6 ++++++
 2 files changed, 8 insertions(+)

diff --git a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci_vfio.c
index 686386d..19f5d8e 100644
--- a/drivers/bus/pci/linux/pci_vfio.c
+++ b/drivers/bus/pci/linux/pci_vfio.c
@@ -545,7 +545,9 @@
 
 	struct pci_map *maps;
 
+	/* This is required for using rte_pci_read/write_config */
 	dev->intr_handle.fd = -1;
+	dev->intr_handle.type = RTE_INTR_HANDLE_VFIO_MSIX;
 
 	/* store PCI address string */
 	snprintf(pci_addr, sizeof(pci_addr), PCI_PRI_FMT,
diff --git a/drivers/bus/pci/pci_common_uio.c b/drivers/bus/pci/pci_common_uio.c
index 54bc20b..6dba4e1 100644
--- a/drivers/bus/pci/pci_common_uio.c
+++ b/drivers/bus/pci/pci_common_uio.c
@@ -31,6 +31,12 @@
 	struct mapped_pci_res_list *uio_res_list =
 			RTE_TAILQ_CAST(rte_uio_tailq.head, mapped_pci_res_list);
 
+	/* This is required for using rte_pci_read/write_config */
+	if (dev->kdrv == RTE_KDRV_IGB_UIO)
+		dev->intr_handle.type = RTE_INTR_HANDLE_UIO;
+	else
+		dev->intr_handle.type = RTE_INTR_HANDLE_UIO_INTX;
+
 	TAILQ_FOREACH(uio_res, uio_res_list, next) {
 
 		/* skip this element if it doesn't match our PCI address */
-- 
1.9.1

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

end of thread, other threads:[~2018-10-19 14:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-27 12:30 [dpdk-dev] [PATCH] bus/pci: set intr_handle type for secondary processes Alejandro Lucero
2018-10-18 16:26 ` Burakov, Anatoly
2018-10-18 16:41   ` Alejandro Lucero
2018-10-19  8:02     ` Burakov, Anatoly
2018-10-19 14:57       ` Alejandro Lucero

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).