From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 510E441D4F; Thu, 23 Feb 2023 10:00:07 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2B04B43105; Thu, 23 Feb 2023 10:00:07 +0100 (CET) Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) by mails.dpdk.org (Postfix) with ESMTP id 97DF740E0F for ; Tue, 21 Feb 2023 17:00:27 +0100 (CET) Received: by mail-pl1-f180.google.com with SMTP id e9so500776plh.2 for ; Tue, 21 Feb 2023 08:00:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=fHbTtfrAMTVwRLVy2cCvzzSK79em2WB00M+j6uGS3Q0=; b=maVSw+fktEKsvGcHb0ixJdyMPdruoGgPTKRuXfwTpPj0G1vueD/9T3hobAV0X56zaP EKn22ajLbTLtLlGuTVhjPB7VYW22tSamqyaizd2ZXE415L46nB9gZbbw5IhyCC81QOQp RNnNQcQA1xJKxejCCroBeURjXlR1s99wYUEF2DVUX+i4ZSFzpD/q9p7s616lgjm/x1dq Jvf4Y+7gMVu4YvsAN1EQICN5l8f2RGpcdram2LVwRdLKaxdhfGi8Mk9xU28OqQtAbtNe 1R3YQFajxYg4SBYEz+XoQf28qzYM6ZQoacQpbgEecRpd7vAXlsoi+kMt6C2G3azLLZ5e zI1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=fHbTtfrAMTVwRLVy2cCvzzSK79em2WB00M+j6uGS3Q0=; b=Zz4uEBEpBtP+oQbUfyqWRhMFZ+i6wQERPBgol0xm5IC8xm0ABqsP9bihUOuA4GaC2a Ip5zaq1VzI2wnsyrkbM7aP0bjxh4StvuXlmzstFsQBMtvhcb8510Q5gGLZeO4KvUlSkd bcx21FH3v0CxnHOfMqcD2q3yGWUWyqsq2UvMrPAZqPY1jLxShz12O+q9TFCcUW6oVsmT N/U3joarjctnfMObGS/WwElMcKo835h6jwaZ8/lKQqAVePnV9warghM7WekhFLY75swR 0jR7vGsyNGwU/mMjAK/trGiWfkzcKYWHOgIJnyv0FiZcNtm6EJhG7V3AZCr9/YbobWID IpEQ== X-Gm-Message-State: AO0yUKUrCohkoUsNxkdZfHPlnPU+ae0TjmykSGmIJ8XLDJkzuozufMmM VlkDIsLjOKhOIYzE2j9mL8X+kH8dLTp5m7gdlPfGXyRXIyDtrw== X-Google-Smtp-Source: AK7set82Ol1vLkQ+sEbFNBqqs5jAxxA7MnUVedeH+NvAiFKAy3lvBAtLlfqM2XUXNkrpd1AP2MOLlJyBMtuGy/cpydY= X-Received: by 2002:a17:90a:e7cc:b0:236:6dea:8794 with SMTP id kb12-20020a17090ae7cc00b002366dea8794mr3080422pjb.22.1676995226501; Tue, 21 Feb 2023 08:00:26 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Nagendra Prabhu A T Date: Tue, 21 Feb 2023 21:30:15 +0530 Message-ID: Subject: Re: unable to bind to vfio-pci To: Bruce Richardson Cc: anatoly.burakov@intel.com, dev@dpdk.org Content-Type: multipart/alternative; boundary="000000000000c40add05f537e03c" X-Mailman-Approved-At: Thu, 23 Feb 2023 10:00:05 +0100 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org --000000000000c40add05f537e03c Content-Type: text/plain; charset="UTF-8" HI Bruce, Thanks for your reply. I have removed the binding of all other ports. So , i can confirm that #2 is taken care of. I tried using a different driver "uio_pci_generic". I still see the same issue for that driver as well. The problem seems to be because the write operation is not happening in "bind" file. Infact tried doing the following step manually. That also failed echo sh -c 0000:51:00.0 > /sys/bus/pci/drivers/uio_pci_generic/bind bash: echo: write error: No such device I have required permission for the file. I tried doing with "sudo" I dont have selinux running So not sure whats blocking me. Infact , even "cat /sys/bus/pci/drivers/uio_pci_generic/bind" is failing Can you please help. Thanks Nagendra Thanks Nagendra On Tue, Feb 21, 2023 at 8:15 PM Bruce Richardson wrote: > On Tue, Feb 21, 2023 at 08:05:20PM +0530, Nagendra Prabhu A T wrote: > > Hi All, > > I am trying to bind vfio-pci using dpdk-devbind.py, But i am seeing > teh > > following error : > > root@nat-kvm:/usr/src/dpdk-22.11/usertools# dpdk-devbind.py > > --bind=vfio-pci 0000:51:00.0 Error: bind failed for 0000:51:00.0 - > > Cannot bind to driver vfio-pci: [Errno 22] Invalid argument > > root@nat-kvm:/usr/src/dpdk-22.11/usertools# > > I see that Sarosh has faced the same issue earlier. I saw the mail > > thread and followed all the steps mentioned there. But it dint help. > > Can you please help. > > An error like that I would attribute to one of two possible likely causes. > [There may be other causes, but these two come to mind immediately]. > > 1. No IOMMU available for use. In this case you need to enable no-iommu > mode for VFIO and see if that works. > 2. You have other ports on the same card bound to a kernel driver. You > cannot use one port bound to the kernel (and therefore using IOMMU > mappings for the kernel), while another port on the same card is bound > to userspace vfio (and therefore looking for userspace IOMMU mappings). > If this is the case, you need to unbind the other port from the kernel, > and leave it unbound or else also bound to vfio. It's possible that > no-iommu mode may help here too, but I have never tested that. > > Regards, > /Bruce > --000000000000c40add05f537e03c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
HI Bruc= e,

Thanks for your reply.

I hav= e removed the binding=C2=A0of all other ports. So , i can confirm that #2 i= s taken care of.

I tried using a different=C2=A0dr= iver "uio_pci_generic". I sti= ll see the same issue for that driver as well.

The problem seems to be because the write operation is not happenin= g=C2=A0in "bind" file.

Infact= tried doing the following step manually. That also failed

echo sh -c 0000:51:00.0 > /sys/bus/pci/drivers/uio_p= ci_generic/bind bash: echo: write error: No such device

I have re= quired permission for the file.
I tried doing with "sudo"
I dont have selinux running

So not sure whats=C2=A0blocking me. Infact , even "cat= =C2=A0/sys/bus/pci/drivers/uio_p= ci_generic/bind" is failing

Can yo= u please help.

Thanks
= Nagendra

Thanks
Nagendr= a

On Tue, Feb 21, 2023 at 8:15 PM Bruce Richa= rdson <bruce.richardson@in= tel.com> wrote:
On Tue, Feb 21, 2023 at 08:05:20PM +0530, Nagendra Prabhu A T wrote:=
>=C2=A0 =C2=A0 Hi All,
>=C2=A0 =C2=A0 I am trying to bind vfio-pci using dpdk-devbind.py, But i= am seeing teh
>=C2=A0 =C2=A0 following error :
>=C2=A0 =C2=A0 root@nat-kvm:/usr/src/dpdk-22.11/usertools# dpdk-devbind.= py
>=C2=A0 =C2=A0 --bind=3Dvfio-pci 0000:51:00.0 Error: bind failed for 000= 0:51:00.0 -
>=C2=A0 =C2=A0 Cannot bind to driver vfio-pci: [Errno 22] Invalid argume= nt
>=C2=A0 =C2=A0 root@nat-kvm:/usr/src/dpdk-22.11/usertools#
>=C2=A0 =C2=A0 I see that Sarosh has faced the same issue earlier. I saw= the mail
>=C2=A0 =C2=A0 thread and followed all the steps mentioned there. But it= dint help.
>=C2=A0 =C2=A0 Can you please help.

An error like that I would attribute to one of two possible likely causes.<= br> [There may be other causes, but these two come to mind immediately].

1. No IOMMU available for use. In this case you need to enable no-iommu
=C2=A0 =C2=A0mode for VFIO and see if that works.
2. You have other ports on the same card bound to a kernel driver. You
=C2=A0 =C2=A0cannot use one port bound to the kernel (and therefore using I= OMMU
=C2=A0 =C2=A0mappings for the kernel), while another port on the same card = is bound
=C2=A0 =C2=A0to userspace vfio (and therefore looking for userspace IOMMU m= appings).
=C2=A0 =C2=A0If this is the case, you need to unbind the other port from th= e kernel,
=C2=A0 =C2=A0and leave it unbound or else also bound to vfio. It's poss= ible that
=C2=A0 =C2=A0no-iommu mode may help here too, but I have never tested that.=

Regards,
/Bruce
--000000000000c40add05f537e03c--