From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: UIO RTE_INTR_MODE_NONE issue. Date: Fri, 3 Jul 2015 12:58:39 -1000 Message-ID: <20150703125839.52d652c7@uryu.home.lan> References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: dev@dpdk.org To: Prathap T Return-path: Received: from mail-pa0-f47.google.com (mail-pa0-f47.google.com [209.85.220.47]) by dpdk.org (Postfix) with ESMTP id C0582683D for ; Sat, 4 Jul 2015 00:58:44 +0200 (CEST) Received: by pacws9 with SMTP id ws9so63803396pac.0 for ; Fri, 03 Jul 2015 15:58:44 -0700 (PDT) In-Reply-To: List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Fri, 3 Jul 2015 15:37:40 +0530 Prathap T wrote: > Hi: >=20 >=20 >=20 > If INTX fails, igb_uio falls back to running without IRQ ( refer to the > implementation in igbuio_pci_probe). >=20 > On QEMU 0.12.0, the INTX seems to have broken, and the intr_mode falls to > RTE_INTR_MODE_NONE >=20 > However this sets the udev->info.irq =3D 0; >=20 >=20 >=20 > Setting of udev->info.irq to =E2=80=980=E2=80=99 does not work on *2.6.3= 6 and lower > kernels*, because the UIO_IRQ_NONE is defined as >=20 >=20 >=20 > #define UIO_IRQ_NONE -2 >=20 >=20 >=20 > Because the udev->info.irq is set to =E2=80=980=E2=80=99, on *2.6.36 and= below* > implementation, the *__uio_register_device* invokes request_irq >=20 >=20 >=20 > if (idev->info->irq >=3D 0) { > ret =3D request_irq(idev->info->irq, uio_interrupt, >=20 > and it fails with the following dump >=20 >=20 >=20 > IRQ handler type mismatch for IRQ 0 >=20 > current handler: timer >=20 > Pid: 3106, comm: dpdk_nic_bind.p Not tainted 2.6.32-504.23.4.el6.x86_64 #1 >=20 > Call Trace: >=20 > [] ? __setup_irq+0x382/0x3c0 >=20 > [] ? uio_interrupt+0x0/0x48 [uio] >=20 > [] ? request_threaded_irq+0x133/0x230 >=20 > [] ? __uio_register_device+0x553/0x610 [uio] >=20 > [] ? igbuio_pci_probe+0x3a7/0x4a0 [igb_uio] >=20 > [] ? kobject_get+0x1a/0x30 >=20 > [] ? local_pci_probe+0x17/0x20 >=20 > [] ? pci_device_probe+0x101/0x120 >=20 > [] ? driver_sysfs_add+0x62/0x90 >=20 > [] ? driver_probe_device+0x9c/0x3e0 >=20 > [] ? driver_bind+0xca/0x110 >=20 > [] ? drv_attr_store+0x2c/0x30 >=20 > [] ? sysfs_write_file+0xe5/0x170 >=20 > [] ? vfs_write+0xb8/0x1a0 >=20 > [] ? sys_write+0x51/0x90 >=20 > [] ? system_call_fastpath+0x16/0x1b >=20 > igb_uio 0000:00:03.0: PCI INT A disabled >=20 > igb_uio: probe of 0000:00:03.0 failed with error -16 >=20 >=20 >=20 > On kernel *2.6.37* and above, the definition is, >=20 >=20 >=20 > #define UIO_IRQ_NONE 0 >=20 >=20 >=20 > And the check is, >=20 >=20 >=20 > if (info->irq && (info->irq !=3D UIO_IRQ_CUSTOM)) { > ret =3D request_irq(info->irq, uio_interrupt, > info->irq_flags, info->name, idev); >=20 >=20 >=20 > So to handle the =E2=80=98RTE_INTR_MODE_NONE=E2=80=99 in these different = kernel versions, >=20 > We are proposing the following change to the code in igbuio_pci_probe > function, >=20 >=20 >=20 > case RTE_INTR_MODE_NONE: >=20 > udev->mode =3D RTE_INTR_MODE_NONE; >=20 > #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 37) >=20 > udev->info.irq =3D -2; >=20 > #else >=20 > udev->info.irq =3D 0; >=20 > #endif Why not use existing UIO_IRQ_NONE which is defined already. PS: The DPDK needs to get all its drivers upstream. Supporting multiple ker= nel versions is a long term maintance nightmare. Look at KNI if you want an example of h= ow much of a nuisance this is. PPS: With DPDK 2.2 it would be good to move the minimum kernel version up t= o 3.0 since that is what current stable distro's are using.