From: Jingjing Wu Date: Mon, 16 Oct 2017 01:58:13 +0000 (+0800) Subject: igb_uio: fix build with kernel <= 3.17 X-Git-Tag: spdx-start~1289 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=6b9ed026a8704b9e5ee5da7997617ef7cc82e114;p=dpdk.git igb_uio: fix build with kernel <= 3.17 Compile fails when kernel version is <= 3.17 with error: "dereferencing pointer to incomplete type". This is because struct uio_device definition is not exposed in kernel earlier than 3.17. This patch fixes it by using pointer of rte_uio_pci_dev as dev_id instead of uio_device for irq device handler. Fixes: 5f6ff30dc507 ("igb_uio: fix interrupt enablement after FLR in VM") Cc: stable@dpdk.org Signed-off-by: Jingjing Wu Reviewed-by: Jianfeng Tan --- diff --git a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c index 3884448ad4..f7ef82554e 100644 --- a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c +++ b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c @@ -209,9 +209,8 @@ igbuio_pci_irqcontrol(struct uio_info *info, s32 irq_state) static irqreturn_t igbuio_pci_irqhandler(int irq, void *dev_id) { - struct uio_device *idev = (struct uio_device *)dev_id; - struct uio_info *info = idev->info; - struct rte_uio_pci_dev *udev = info->priv; + struct rte_uio_pci_dev *udev = (struct rte_uio_pci_dev *)dev_id; + struct uio_info *info = &udev->info; /* Legacy mode need to mask in hardware */ if (udev->mode == RTE_INTR_MODE_LEGACY && @@ -299,7 +298,7 @@ igbuio_pci_enable_interrupts(struct rte_uio_pci_dev *udev) if (udev->info.irq != UIO_IRQ_NONE) err = request_irq(udev->info.irq, igbuio_pci_irqhandler, udev->info.irq_flags, udev->info.name, - udev->info.uio_dev); + udev); dev_info(&udev->pdev->dev, "uio device registered with irq %lx\n", udev->info.irq); @@ -310,7 +309,7 @@ static void igbuio_pci_disable_interrupts(struct rte_uio_pci_dev *udev) { if (udev->info.irq) { - free_irq(udev->info.irq, udev->info.uio_dev); + free_irq(udev->info.irq, udev); udev->info.irq = 0; }