From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1bon0142.outbound.protection.outlook.com [157.56.111.142]) by dpdk.org (Postfix) with ESMTP id 1CA43106B for ; Thu, 2 Jul 2015 05:23:50 +0200 (CEST) Received: from BY2PR0801MB1607.namprd08.prod.outlook.com (10.163.157.149) by BY2PR0801MB1574.namprd08.prod.outlook.com (10.163.157.140) with Microsoft SMTP Server (TLS) id 15.1.201.16; Thu, 2 Jul 2015 03:23:48 +0000 Received: from BY2PR0801MB1606.namprd08.prod.outlook.com (10.163.157.148) by BY2PR0801MB1607.namprd08.prod.outlook.com (10.163.157.149) with Microsoft SMTP Server (TLS) id 15.1.201.16; Thu, 2 Jul 2015 03:23:43 +0000 Received: from BY2PR0801MB1606.namprd08.prod.outlook.com ([10.163.157.148]) by BY2PR0801MB1606.namprd08.prod.outlook.com ([10.163.157.148]) with mapi id 15.01.0201.000; Thu, 2 Jul 2015 03:23:43 +0000 From: Prathap Thammanna To: "dev@dpdk.org" Thread-Topic: UIO RTE_INTR_MODE_NONE issue. Thread-Index: AdC0dnleYe96m9coSceMRZQUbfEU9w== Date: Thu, 2 Jul 2015 03:23:42 +0000 Message-ID: Accept-Language: en-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dpdk.org; dkim=none (message not signed) header.d=none; x-originating-ip: [117.216.232.7] x-microsoft-exchange-diagnostics: 1; BY2PR0801MB1607; 5:BCbMiPAr7JkkdSRJwJJ3Gm7wzbAzKtgLKJNxpv5vs1Ud0ccWeAvQb8gmt/t1EMgwIC1LGEtgshfdNTcKvI3bO4EBkjirVYZQqKKDWKZXSJ0mQokR/i6ut/+E1fpk0tW0ofF+aUGkUSsdsTdgnxObxQ==; 24:hYMvUdWFW2qYC2ha6wK6BdePofc+f0CQRLARfr0WRrDiO46rQysgkgM6Xva/4bYEfLEGVoJsZkKcnpmqNTEc6wNp77//YRxtWxUHKuZsuSE=; 20:smfZPmGEl7vaf+vhQK03YsD2sAfvVN3OtvqtU7jp2yiywdSTTFSXVNRGeJpD8HF1uzyTfFfxOJ1P8NNwD1Okpw== x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:; SRVR:BY2PR0801MB1607; UriScan:; BCL:0; PCL:0; RULEID:; SRVR:BY2PR0801MB1574; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(108003899814671); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:BY2PR0801MB1607; BCL:0; PCL:0; RULEID:; SRVR:BY2PR0801MB1607; x-forefront-prvs: 06259BA5A2 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6009001)(40100003)(16236675004)(33656002)(76576001)(5002640100001)(122556002)(2501003)(575784001)(19625215002)(86362001)(87936001)(74316001)(77096005)(92566002)(2900100001)(5001960100002)(107886002)(110136002)(66066001)(189998001)(46102003)(15975445007)(19300405004)(450100001)(102836002)(54356999)(2351001)(2656002)(229853001)(5003600100002)(19580395003)(62966003)(99286002)(77156002)(50986999); DIR:OUT; SFP:1102; SCL:1; SRVR:BY2PR0801MB1607; H:BY2PR0801MB1606.namprd08.prod.outlook.com; FPR:; SPF:None; MLV:sfv; LANG:en; MIME-Version: 1.0 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Jul 2015 03:23:42.9522 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: d05e4a96-dcd9-4c15-a71a-9c868da4f308 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR0801MB1607 X-Microsoft-Exchange-Diagnostics: 1; BY2PR0801MB1574; 2:NKIIjm0q6C8OM87ibbCsZSM9flfXhwwelxnJ3U4bmEBsIhzCv0EBlDf3sc1G3Mzk; 3:uo4KKIC3wzMYlNCJmRFmNEiyl+SRTQj1NvIHSb4dSazdqGqL3qgoQqNX5xBAmeSjTXFeu4dJm2/oinS1AJcNG1/kogmbIT5Do4UiahZs9r0gnactC2CKhRfuwS5v2KlhnZSLkYjgjCfebYM2OFUQyA==; 25:hWWxYEKQBsBVvdeBQJAcl+TW8EVNnsCC8qNDNxdSckC5KNiotFITPJYcPyWnhW8YEB+dl0edKYjsvj1h6c1fglblUQmyTJjzL40eZxLvAYSECmTFfWBE7GK3V9kSdtrw7M8M2Gk0hL1k664iTD3kWtND2oO2zWy33tmtQgpJXDagkLcZQxCoYtUs+/43sH2Qx4w8usaGGKbQ2PS3WHIwdxUdgEfrFzXokZxOt2TZ0rpaT3N+kHG2zi4+E5F3bWAY0zQuJDbNCf9Pz0tymaPOFg==; 23:VpPdPf47QGILPjF2gqiLHrweK/r5LXyK059vFIqLh5zjd3CJiRRJh4tN2TZIlxS4iMvAx0L7Nw+8kj1mYpftrgsOBt94t5uwJGHm3LnD42vWcagLC8r7Xu9pJ3FSIBpMR7Q1pKFrR5WCfhzymifzk3hrk/d7olIJVL50niwvgM661HqQ4QATi9lTi51RIRtxfYDSFxgcYiB16GlbKkJoULH0VkOB9yfm8kM7AcdzWHgp/fD6xYoKbdkR7WShgndC X-OriginatorOrg: radisys.com X-Mailman-Approved-At: Fri, 03 Jul 2015 09:39:47 +0200 Content-Type: text/plain; charset="us-ascii" 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: Thu, 02 Jul 2015 03:23:50 -0000 Hi: If INTX fails, igb_uio falls back to running without IRQ ( refer to the imp= lementation in igbuio_pci_probe). On QEMU 0.12.0, the INTX seems to have broken, and the intr_mode falls to R= TE_INTR_MODE_NONE However this sets the udev->info.irq =3D 0; Setting of udev->info.irq to '0' 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 '0', on 2.6.36 and below implementati= on, 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 'RTE_INTR_MODE_NONE' in these different kernel versions, We are proposing the following change to the code in igbuio_pci_probe funct= ion, 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 us know your opinion. If it is correct, we will go ahead and ge= nerate a patch for review. Regards, Prathap