DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] igb_uio: fix compile error
@ 2017-10-16  1:58 Jingjing Wu
  2017-10-16 10:10 ` Tan, Jianfeng
  0 siblings, 1 reply; 3+ messages in thread
From: Jingjing Wu @ 2017-10-16  1:58 UTC (permalink / raw)
  To: jianfeng.tan; +Cc: dev, jingjing.wu

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

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
---
 lib/librte_eal/linuxapp/igb_uio/igb_uio.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c
index 3884448..f7ef825 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;
 	}
 
-- 
2.7.4

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

* Re: [dpdk-dev] [PATCH] igb_uio: fix compile error
  2017-10-16  1:58 [dpdk-dev] [PATCH] igb_uio: fix compile error Jingjing Wu
@ 2017-10-16 10:10 ` Tan, Jianfeng
  2017-10-16 10:59   ` Thomas Monjalon
  0 siblings, 1 reply; 3+ messages in thread
From: Tan, Jianfeng @ 2017-10-16 10:10 UTC (permalink / raw)
  To: Wu, Jingjing; +Cc: dev



> -----Original Message-----
> From: Wu, Jingjing
> Sent: Monday, October 16, 2017 9:58 AM
> To: Tan, Jianfeng
> Cc: dev@dpdk.org; Wu, Jingjing
> Subject: [PATCH] igb_uio: fix compile error
> 
> 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")
> 
> Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>


Yes, we don't have to use struct uio_device as the cookie; what we need is struct uio_info for notification.

Reviewed-by: Jianfeng Tan <jianfeng.tan@intel.com>

Thanks,
Jianfeng

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

* Re: [dpdk-dev] [PATCH] igb_uio: fix compile error
  2017-10-16 10:10 ` Tan, Jianfeng
@ 2017-10-16 10:59   ` Thomas Monjalon
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2017-10-16 10:59 UTC (permalink / raw)
  To: Wu, Jingjing; +Cc: dev, Tan, Jianfeng

16/10/2017 12:10, Tan, Jianfeng:
> From: Wu, Jingjing
> > 
> > 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")
> > 
> > Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
> 
> 
> Yes, we don't have to use struct uio_device as the cookie; what we need is struct uio_info for notification.
> 
> Reviewed-by: Jianfeng Tan <jianfeng.tan@intel.com>

Applied, thanks

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

end of thread, other threads:[~2017-10-16 10:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-16  1:58 [dpdk-dev] [PATCH] igb_uio: fix compile error Jingjing Wu
2017-10-16 10:10 ` Tan, Jianfeng
2017-10-16 10:59   ` Thomas Monjalon

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