From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from netronome.com (host-79-78-33-110.static.as9105.net [79.78.33.110]) by dpdk.org (Postfix) with ESMTP id 590E81B452 for ; Thu, 27 Sep 2018 14:31:38 +0200 (CEST) Received: from netronome.com (localhost [127.0.0.1]) by netronome.com (8.14.4/8.14.4/Debian-4.1ubuntu1) with ESMTP id w8RCUObT024211 for ; Thu, 27 Sep 2018 13:30:24 +0100 Received: (from alucero@localhost) by netronome.com (8.14.4/8.14.4/Submit) id w8RCUOkR024210 for dev@dpdk.org; Thu, 27 Sep 2018 13:30:24 +0100 From: Alejandro Lucero To: dev@dpdk.org Date: Thu, 27 Sep 2018 13:30:24 +0100 Message-Id: <1538051424-24172-1-git-send-email-alejandro.lucero@netronome.com> X-Mailer: git-send-email 1.9.1 Subject: [dpdk-dev] [PATCH] bus/pci: set intr_handle type for secondary processes X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Sep 2018 12:31:38 -0000 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 --- 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