From mboxrd@z Thu Jan 1 00:00:00 1970 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) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=kSl2NgSgRWFT+m4e27Ytmngh0LpZ7BDFGMyJOdwT9ng=; b=XRw1498qWM5CFSC52XGvaj/hD8rtZfvyPEg8ZVqGkyHhp5agGdkMj9vKpsO6FSVmXh SWJpszUaocvXHY9t4xUd6tYc4wb2KkbrRJ7fWZVp203YfqFrmk9H6ZLqK1NzrYI9fsdu zXRossSeg+ndBeyGugTBDWKKUXEBsQPzsyEy1/wcmTS9fRQOiZ1qYIV4p3jYbCPRsPFk Q6krztAngxp2pPJe8c71Yq02L+0O7iJRM2SUCUm3bQM6GhFJ1L0/a8lZ9EzwfX3QnoQ3 LdJWKlbHfSNhy89qmgtX1x7ecEMRqcS8gsWhz9nHQpJi/10RIW6jrTVWgA3I9/Q4ZrI8 5ikQ== X-Gm-Message-State: ALoCoQlOpBVoV4R7MtHwbyx26MiI7m00U5IGqUHhG7/KihtpH6AxrS8Oq8HAVZtCb/ntPTgUfYcp X-Received: by 10.70.95.198 with SMTP id dm6mr80935782pdb.53.1435964323976; Fri, 03 Jul 2015 15:58:43 -0700 (PDT) Received: from uryu.home.lan (cpe-72-130-168-110.hawaii.res.rr.com. [72.130.168.110]) by mx.google.com with ESMTPSA id om10sm10147617pbb.58.2015.07.03.15.58.42 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Jul 2015 15:58:43 -0700 (PDT) Date: Fri, 3 Jul 2015 12:58:39 -1000 From: Stephen Hemminger To: Prathap T Message-ID: <20150703125839.52d652c7@uryu.home.lan> In-Reply-To: References: X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: dev@dpdk.org Subject: Re: [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 22:58:45 -0000 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.