DPDK usage discussions
 help / color / mirror / Atom feed
* [dpdk-users] Cannot Bind eth0 to vfio-pci Driver
@ 2018-12-06  5:41 Ramzah Rehman
  2018-12-11 16:20 ` Stephen Hemminger
  0 siblings, 1 reply; 5+ messages in thread
From: Ramzah Rehman @ 2018-12-06  5:41 UTC (permalink / raw)
  To: users

I am trying to bind an interface eth0 to vfio driver. I have made sure
iommu is enabled in grub and kernel. I have loaded the module vfio-pci. Ran
following commands

#modprobe vfio-pci
#chmod a+x /dev/vfio
#chmod 0666 /dev/vfio/*
#export DPDK_DIR=/usr/src/dpdk-stable-17.11.4
#sudo $DPDK_DIR/usertools/dpdk-devbind.py --bind=vfio-pci 02:01.0

I got following error:

Error: bind failed for 0000:02:01.0 - Cannot bind to driver vfio-pci

I checked the error in dmesg:

Got :

[ 1815.793823] vfio-pci: probe of 0000:02:01.0 failed with error -22

let me know the reason.

Best Regards,
Ramzah Rehman

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

* Re: [dpdk-users] Cannot Bind eth0 to vfio-pci Driver
  2018-12-06  5:41 [dpdk-users] Cannot Bind eth0 to vfio-pci Driver Ramzah Rehman
@ 2018-12-11 16:20 ` Stephen Hemminger
  0 siblings, 0 replies; 5+ messages in thread
From: Stephen Hemminger @ 2018-12-11 16:20 UTC (permalink / raw)
  To: Ramzah Rehman; +Cc: users

On Thu, 6 Dec 2018 10:41:26 +0500
Ramzah Rehman <ramzahrehman@gmail.com> wrote:

> I am trying to bind an interface eth0 to vfio driver. I have made sure
> iommu is enabled in grub and kernel. I have loaded the module vfio-pci. Ran
> following commands
> 
> #modprobe vfio-pci
> #chmod a+x /dev/vfio
> #chmod 0666 /dev/vfio/*
> #export DPDK_DIR=/usr/src/dpdk-stable-17.11.4
> #sudo $DPDK_DIR/usertools/dpdk-devbind.py --bind=vfio-pci 02:01.0
> 
> I got following error:
> 
> Error: bind failed for 0000:02:01.0 - Cannot bind to driver vfio-pci
> 
> I checked the error in dmesg:
> 
> Got :
> 
> [ 1815.793823] vfio-pci: probe of 0000:02:01.0 failed with error -22
> 
> let me know the reason.
> 
> Best Regards,
> Ramzah Rehman

Check other threads. For VFIO to work you need at a minimum:
	* Hardware with IOMMU
	* VT-d enabled in BIOS
	* Device on PCI not sharing IOMMU-group

See vfio.txt in Linux kernel documentation for a full explanation.
https://www.kernel.org/doc/Documentation/vfio.txt

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

* Re: [dpdk-users] Cannot Bind eth0 to vfio-pci Driver
  2018-12-10  3:49 Ramzah Rehman
  2018-12-10  5:28 ` Murali Krishna
@ 2018-12-10  9:10 ` Ido Shamay
  1 sibling, 0 replies; 5+ messages in thread
From: Ido Shamay @ 2018-12-10  9:10 UTC (permalink / raw)
  To: ramzahrehman; +Cc: users

What is lspci output for this device?
Looks like the device isn't supported by vfio-pcio (maybe it's a
bridge or a card-bus).

-22 is EINVAL, and from vfio-pci code the only relevant return of this
error from probe flow looks like:

if (pdev->hdr_type != PCI_HEADER_TYPE_NORMAL)
    return -EINVAL;

On Mon, Dec 10, 2018 at 5:49 AM Ramzah Rehman <ramzahrehman@gmail.com> wrote:
>
> I am trying to bind an interface eth0 to vfio driver. I have made sure
> iommu is enabled in grub and kernel. I have loaded the module vfio-pci. Ran
> following commands
>
> #modprobe vfio-pci
> #chmod a+x /dev/vfio
> #chmod 0666 /dev/vfio/*
> #export DPDK_DIR=/usr/src/dpdk-stable-17.11.4
> #sudo $DPDK_DIR/usertools/dpdk-devbind.py --bind=vfio-pci 02:01.0
>
> I got following error:
>
> Error: bind failed for 0000:02:01.0 - Cannot bind to driver vfio-pci
>
> I checked the error in dmesg:
>
> Got :
>
> [ 1815.793823] vfio-pci: probe of 0000:02:01.0 failed with error -22
>
> let me know the reason.
>
> Best Regards,
> Ramzah Rehman



-- 
Ido

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

* Re: [dpdk-users] Cannot Bind eth0 to vfio-pci Driver
  2018-12-10  3:49 Ramzah Rehman
@ 2018-12-10  5:28 ` Murali Krishna
  2018-12-10  9:10 ` Ido Shamay
  1 sibling, 0 replies; 5+ messages in thread
From: Murali Krishna @ 2018-12-10  5:28 UTC (permalink / raw)
  To: Ramzah Rehman; +Cc: users

I encountered same issue. I was able to bind devices to vfio-pci after
enabling VT-d in system bios. Check if this helps.

Regards,
Murali

-----Original Message-----
From: users [mailto:users-bounces@dpdk.org] On Behalf Of Ramzah Rehman
Sent: Monday, December 10, 2018 9:19 AM
To: users@dpdk.org
Subject: [dpdk-users] Cannot Bind eth0 to vfio-pci Driver

I am trying to bind an interface eth0 to vfio driver. I have made sure
iommu is enabled in grub and kernel. I have loaded the module vfio-pci. Ran
following commands

#modprobe vfio-pci
#chmod a+x /dev/vfio
#chmod 0666 /dev/vfio/*
#export DPDK_DIR=/usr/src/dpdk-stable-17.11.4
#sudo $DPDK_DIR/usertools/dpdk-devbind.py --bind=vfio-pci 02:01.0

I got following error:

Error: bind failed for 0000:02:01.0 - Cannot bind to driver vfio-pci

I checked the error in dmesg:

Got :

[ 1815.793823] vfio-pci: probe of 0000:02:01.0 failed with error -22

let me know the reason.

Best Regards,
Ramzah Rehman

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

* [dpdk-users] Cannot Bind eth0 to vfio-pci Driver
@ 2018-12-10  3:49 Ramzah Rehman
  2018-12-10  5:28 ` Murali Krishna
  2018-12-10  9:10 ` Ido Shamay
  0 siblings, 2 replies; 5+ messages in thread
From: Ramzah Rehman @ 2018-12-10  3:49 UTC (permalink / raw)
  To: users

I am trying to bind an interface eth0 to vfio driver. I have made sure
iommu is enabled in grub and kernel. I have loaded the module vfio-pci. Ran
following commands

#modprobe vfio-pci
#chmod a+x /dev/vfio
#chmod 0666 /dev/vfio/*
#export DPDK_DIR=/usr/src/dpdk-stable-17.11.4
#sudo $DPDK_DIR/usertools/dpdk-devbind.py --bind=vfio-pci 02:01.0

I got following error:

Error: bind failed for 0000:02:01.0 - Cannot bind to driver vfio-pci

I checked the error in dmesg:

Got :

[ 1815.793823] vfio-pci: probe of 0000:02:01.0 failed with error -22

let me know the reason.

Best Regards,
Ramzah Rehman

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

end of thread, other threads:[~2018-12-11 16:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-06  5:41 [dpdk-users] Cannot Bind eth0 to vfio-pci Driver Ramzah Rehman
2018-12-11 16:20 ` Stephen Hemminger
2018-12-10  3:49 Ramzah Rehman
2018-12-10  5:28 ` Murali Krishna
2018-12-10  9:10 ` Ido Shamay

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