From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id C86221B228 for ; Thu, 12 Oct 2017 12:50:15 +0200 (CEST) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Oct 2017 03:50:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,365,1503385200"; d="scan'208";a="137764591" Received: from irsmsx103.ger.corp.intel.com ([163.33.3.157]) by orsmga004.jf.intel.com with ESMTP; 12 Oct 2017 03:50:13 -0700 Received: from irsmsx101.ger.corp.intel.com ([169.254.1.22]) by IRSMSX103.ger.corp.intel.com ([169.254.3.49]) with mapi id 14.03.0319.002; Thu, 12 Oct 2017 11:50:12 +0100 From: "Kavanagh, Mark B" To: Markus Theil , "dev@dpdk.org" CC: "Yigit, Ferruh" , "stephen@networkplumber.org" Thread-Topic: [dpdk-dev] [PATCH v7 5/6] igb_uio: use kernel functions for masking MSI-X Thread-Index: AQHTJj9Sr/t+X+cdH0+r/sscHbQh9KLgQX/Q Date: Thu, 12 Oct 2017 10:50:13 +0000 Message-ID: References: <1503336825-7700-1-git-send-email-markus.theil@tu-ilmenau.de> <1504613046-7259-1-git-send-email-markus.theil@tu-ilmenau.de> <1504613046-7259-5-git-send-email-markus.theil@tu-ilmenau.de> In-Reply-To: <1504613046-7259-5-git-send-email-markus.theil@tu-ilmenau.de> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMDMwOGFkMTItZWJhMS00MGQ5LWFkMDQtNTdmMmJhNzllMTVjIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IlpVUFB6Y1FUNFJjTFUrOEwyeHVNMVJTYmwxa0JXWGpuXC90TklyVlVoSmcwPSJ9 dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v7 5/6] igb_uio: use kernel functions for masking MSI-X 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, 12 Oct 2017 10:50:16 -0000 Hi, This commit renders igb_uio unusable on Fedora 20, kernel version 3.19.8-10= 0.fc20.x86_64. During the build (make -j 20), a warning is issued for igb_uio regarding a = missing symbol (pci_msi_unmask): WARNING: "pci_msi_unmask_irq" [/home//x86_64-native-linuxapp-gcc= /build/lib/librte_eal/linuxapp/igb_uio/igb_uio.ko] undefined! WARNING: "pci_msi_mask_irq" [/home//x86_64-native-linuxapp-gcc/b= uild/lib/librte_eal/linuxapp/igb_uio/igb_uio.ko] undefined! Subsequently, the module is may not be loaded on account of same. (from dmesg):=20 [673425.712110] igb_uio: Unknown symbol pci_msi_unmask_irq (err 0) [673425.712124] igb_uio: Unknown symbol pci_msi_mask_irq (err 0) Thanks, Mark >-----Original Message----- >From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Markus Theil >Sent: Tuesday, September 5, 2017 1:04 PM >To: dev@dpdk.org >Cc: Yigit, Ferruh ; stephen@networkplumber.org; Ma= rkus >Theil >Subject: [dpdk-dev] [PATCH v7 5/6] igb_uio: use kernel functions for maski= ng >MSI-X > >This patch removes the custom MSI-X mask/unmask code and >uses already existing kernel functions. > >Signed-off-by: Markus Theil >--- > lib/librte_eal/linuxapp/igb_uio/compat.h | 26 +++++----------- > lib/librte_eal/linuxapp/igb_uio/igb_uio.c | 51 ++++++++++++--------------= ---- >- > 2 files changed, 28 insertions(+), 49 deletions(-) > >diff --git a/lib/librte_eal/linuxapp/igb_uio/compat.h >b/lib/librte_eal/linuxapp/igb_uio/compat.h >index 3825933..67a7ab3 100644 >--- a/lib/librte_eal/linuxapp/igb_uio/compat.h >+++ b/lib/librte_eal/linuxapp/igb_uio/compat.h >@@ -15,24 +15,6 @@ > #define HAVE_PTE_MASK_PAGE_IOMAP > #endif > >-#ifndef PCI_MSIX_ENTRY_SIZE >-#define PCI_MSIX_ENTRY_SIZE 16 >-#define PCI_MSIX_ENTRY_LOWER_ADDR 0 >-#define PCI_MSIX_ENTRY_UPPER_ADDR 4 >-#define PCI_MSIX_ENTRY_DATA 8 >-#define PCI_MSIX_ENTRY_VECTOR_CTRL 12 >-#define PCI_MSIX_ENTRY_CTRL_MASKBIT 1 >-#endif >- >-/* >- * for kernels < 2.6.38 and backported patch that moves MSI-X entry >definition >- * to pci_regs.h Those kernels has PCI_MSIX_ENTRY_SIZE defined but not >- * PCI_MSIX_ENTRY_CTRL_MASKBIT >- */ >-#ifndef PCI_MSIX_ENTRY_CTRL_MASKBIT >-#define PCI_MSIX_ENTRY_CTRL_MASKBIT 1 >-#endif >- > #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34) && \ > (!(defined(RHEL_RELEASE_CODE) && \ > RHEL_RELEASE_CODE >=3D RHEL_RELEASE_VERSION(5, 9))) >@@ -127,3 +109,11 @@ static bool pci_check_and_mask_intx(struct pci_dev *p= dev) > #if LINUX_VERSION_CODE >=3D KERNEL_VERSION(4, 8, 0) > #define HAVE_ALLOC_IRQ_VECTORS 1 > #endif >+ >+#if LINUX_VERSION_CODE >=3D KERNEL_VERSION(3, 19, 0) >+#define HAVE_PCI_MSI_MASK_IRQ 1 >+#endif >+ >+#if LINUX_VERSION_CODE >=3D KERNEL_VERSION(2, 6, 37) >+#define HAVE_IRQ_DATA 1 >+#endif >diff --git a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c >b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c >index c570eed..e4ef817 100644 >--- a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c >+++ b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c >@@ -91,27 +91,6 @@ static struct attribute *dev_attrs[] =3D { > static const struct attribute_group dev_attr_grp =3D { > .attrs =3D dev_attrs, > }; >-/* >- * It masks the msix on/off of generating MSI-X messages. >- */ >-static void >-igbuio_msix_mask_irq(struct msi_desc *desc, int32_t state) >-{ >- u32 mask_bits =3D desc->masked; >- unsigned offset =3D desc->msi_attrib.entry_nr * PCI_MSIX_ENTRY_SIZE + >- PCI_MSIX_ENTRY_VECTOR_CTRL; >- >- if (state !=3D 0) >- mask_bits &=3D ~PCI_MSIX_ENTRY_CTRL_MASKBIT; >- else >- mask_bits |=3D PCI_MSIX_ENTRY_CTRL_MASKBIT; >- >- if (mask_bits !=3D desc->masked) { >- writel(mask_bits, desc->mask_base + offset); >- readl(desc->mask_base); >- desc->masked =3D mask_bits; >- } >-} > > /** > * This is the irqcontrol callback to be registered to uio_info. >@@ -132,21 +111,31 @@ igbuio_pci_irqcontrol(struct uio_info *info, s32 >irq_state) > struct rte_uio_pci_dev *udev =3D info->priv; > struct pci_dev *pdev =3D udev->pdev; > >- pci_cfg_access_lock(pdev); >- if (udev->mode =3D=3D RTE_INTR_MODE_LEGACY) >- pci_intx(pdev, !!irq_state); >+#ifdef HAVE_IRQ_DATA >+ struct irq_data *irq =3D irq_get_irq_data(udev->info.irq); >+#else >+ unsigned int irq =3D udev->info.irq; >+#endif > >- else if (udev->mode =3D=3D RTE_INTR_MODE_MSIX) { >- struct msi_desc *desc; >+ pci_cfg_access_lock(pdev); > >-#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0)) >- list_for_each_entry(desc, &pdev->msi_list, list) >- igbuio_msix_mask_irq(desc, irq_state); >+ if (udev->mode =3D=3D RTE_INTR_MODE_MSIX) { >+#ifdef HAVE_PCI_MSI_MASK_IRQ >+ if (irq_state =3D=3D 1) >+ pci_msi_unmask_irq(irq); >+ else >+ pci_msi_mask_irq(irq); > #else >- list_for_each_entry(desc, &pdev->dev.msi_list, list) >- igbuio_msix_mask_irq(desc, irq_state); >+ if (irq_state =3D=3D 1) >+ unmask_msi_irq(irq); >+ else >+ mask_msi_irq(irq); > #endif > } >+ >+ if (udev->mode =3D=3D RTE_INTR_MODE_LEGACY) >+ pci_intx(pdev, !!irq_state); >+ > pci_cfg_access_unlock(pdev); > > return 0; >-- >2.7.4