From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f180.google.com (mail-wi0-f180.google.com [209.85.212.180]) by dpdk.org (Postfix) with ESMTP id 9B3D75A44 for ; Fri, 3 Jul 2015 12:07:40 +0200 (CEST) Received: by wiar9 with SMTP id r9so126330640wia.1 for ; Fri, 03 Jul 2015 03:07:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=IWIiBYvtkW/jVHae7PxdNl6MvE1ckXSYS+ciIWTTp/g=; b=pNLQ4nvbyfX45vek+7loQ+YyWAUWViRNP/+U+yzbYkCu0G/Hdn5DC1a+RtubrVFhms QBeHOUc5cTjT2fAt4XiHELLJpWx57oj1Rw6k+9pf/eOzkEea5IwKlO34v4fYi2om/4Nk P9/0SCzpQPmWwXg6zorMLr7XpHwzjRBSVH5a01UfSl7lhI9UNiSXC2/AHTLJHN+bEgan NJWlkuaUVQQXKZEAKTpfz7OreKcukFPkfkzeAvH3S64iXDOIkLq2AUFoXEtuuVUqKdSw /8cN8VrzJC6UbgmW0Qpv3kMuyYto346WIU8ZdtKJb4ZroVBWxkq9Uf1zimQn/irXsXRr sMJg== MIME-Version: 1.0 X-Received: by 10.194.176.165 with SMTP id cj5mr67767400wjc.72.1435918060170; Fri, 03 Jul 2015 03:07:40 -0700 (PDT) Received: by 10.28.20.12 with HTTP; Fri, 3 Jul 2015 03:07:40 -0700 (PDT) Date: Fri, 3 Jul 2015 15:37:40 +0530 Message-ID: From: Prathap T To: dev@dpdk.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [dpdk-dev] UIO RTE_INTR_MODE_NONE issue. X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2015 10:07:40 -0000 Hi: If INTX fails, igb_uio falls back to running without IRQ ( refer to the implementation in igbuio_pci_probe). On QEMU 0.12.0, the INTX seems to have broken, and the intr_mode falls to RTE_INTR_MODE_NONE However this sets the udev->info.irq =3D 0; Setting of udev->info.irq to =E2=80=980=E2=80=99 does not work on *2.6.36 = and lower kernels*, because the UIO_IRQ_NONE is defined as #define UIO_IRQ_NONE -2 Because the udev->info.irq is set to =E2=80=980=E2=80=99, on *2.6.36 and b= elow* implementation, the *__uio_register_device* invokes request_irq if (idev->info->irq >=3D 0) { ret =3D request_irq(idev->info->irq, uio_interrupt, and it fails with the following dump IRQ handler type mismatch for IRQ 0 current handler: timer Pid: 3106, comm: dpdk_nic_bind.p Not tainted 2.6.32-504.23.4.el6.x86_64 #1 Call Trace: [] ? __setup_irq+0x382/0x3c0 [] ? uio_interrupt+0x0/0x48 [uio] [] ? request_threaded_irq+0x133/0x230 [] ? __uio_register_device+0x553/0x610 [uio] [] ? igbuio_pci_probe+0x3a7/0x4a0 [igb_uio] [] ? kobject_get+0x1a/0x30 [] ? local_pci_probe+0x17/0x20 [] ? pci_device_probe+0x101/0x120 [] ? driver_sysfs_add+0x62/0x90 [] ? driver_probe_device+0x9c/0x3e0 [] ? driver_bind+0xca/0x110 [] ? drv_attr_store+0x2c/0x30 [] ? sysfs_write_file+0xe5/0x170 [] ? vfs_write+0xb8/0x1a0 [] ? sys_write+0x51/0x90 [] ? system_call_fastpath+0x16/0x1b igb_uio 0000:00:03.0: PCI INT A disabled igb_uio: probe of 0000:00:03.0 failed with error -16 On kernel *2.6.37* and above, the definition is, #define UIO_IRQ_NONE 0 And the check is, if (info->irq && (info->irq !=3D UIO_IRQ_CUSTOM)) { ret =3D request_irq(info->irq, uio_interrupt, info->irq_flags, info->name, idev); So to handle the =E2=80=98RTE_INTR_MODE_NONE=E2=80=99 in these different ke= rnel versions, We are proposing the following change to the code in igbuio_pci_probe function, case RTE_INTR_MODE_NONE: udev->mode =3D RTE_INTR_MODE_NONE; #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 37) udev->info.irq =3D -2; #else udev->info.irq =3D 0; #endif Please let me know your opinion. If it is correct, we will go ahead and generate a patch for review. Regards, Prathap