From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id E6642A04CC; Mon, 21 Sep 2020 13:10:51 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A6EE91D917; Mon, 21 Sep 2020 13:10:50 +0200 (CEST) Received: from mail-oi1-f194.google.com (mail-oi1-f194.google.com [209.85.167.194]) by dpdk.org (Postfix) with ESMTP id 0EB881D916 for ; Mon, 21 Sep 2020 13:10:49 +0200 (CEST) Received: by mail-oi1-f194.google.com with SMTP id n2so16498634oij.1 for ; Mon, 21 Sep 2020 04:10:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=emumba-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=mAV4lcVbJat5/18pSKOnVvSknR34UCo+9FVMdybwX4I=; b=QfEWP3QSsJ1rvukHM3X2rzCgsI6LbfdrnDzAZpIcdvJBr3XeKnYt6YS3jefV+q0tN3 WF4KTUYnPyXBoC57LU703d21L5gkMxeWyt8WIl6zxZMCvpiLPfipFRbAKt17kBUUqk/O x9N83uoZFS1Ssm6jH5PcAD0IwowyS1fx/BWNkZ/DL2sTQl0PU/6VrGtR3DG2SeQzHaIh ikZgNmkmZuB5KmYUlF0Z8VXd6jsJa/e1prGGUyjIU73vsZZ1WX2+5HrInHhSc+oSBeQ4 6hq/pyDqvWuH+tk4YOUmV/Vy6hyN9u0jxf3EDvSJvgNmb4d8p0vLr68t9HNUto/zc7IY RVDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=mAV4lcVbJat5/18pSKOnVvSknR34UCo+9FVMdybwX4I=; b=WFYIg2By5OLsNcDMd4UKDGgWdHC11VXGl6agHl4OrV0S3TXhzzwLfkNA5mucs5+zlD xFI82tHOwYQ6x3tJJNOc/GjP//AZ5NP96GfmME0MP34t8AR4SWW9VTL9t6Js/DayifHf JdwqQsBNNRtpCby3weBs5Ze3G8SLl+a9kvrVEwQxRL41MGePBNFUFT53a4LyGZQ1CbpL rj4dH+h1T1Q70iqPvoBaVULPWKRZBenc7P7/FfpCpdf4VDH5UdSY6zWRyb2b7P2vKuJp x7AxpxKOfMP08ZYaaSpxLca3so13fsulUq0z94UZZQ7egGenwNh+ekocH8qNYkdsYdKj oC9A== X-Gm-Message-State: AOAM531+xqLfAxWBtkd42H3OrtvxfcihWFBAGIK/NVLpPqpZCap0AYhE xKD0G7ZDedaBNl24zye61l45ulwfo5lsu9Aa9Y5ppw== X-Google-Smtp-Source: ABdhPJwffDTyvN7VjmiWotUrmVVzdg2mWLGPdyx7R1yM6NcotM1UJ68b1wje5KqgT3t0Vt4T2NHcMWjG+aOtCNiCcUE= X-Received: by 2002:aca:446:: with SMTP id 67mr17950482oie.171.1600686648216; Mon, 21 Sep 2020 04:10:48 -0700 (PDT) MIME-Version: 1.0 References: <20200917091723.GD1568@bricha3-MOBL.ger.corp.intel.com> <20200917102204.GE1568@bricha3-MOBL.ger.corp.intel.com> <8fa1aae5-617c-64a7-a647-fd2508e0f662@intel.com> In-Reply-To: <8fa1aae5-617c-64a7-a647-fd2508e0f662@intel.com> From: Sarosh Arif Date: Mon, 21 Sep 2020 16:10:12 +0500 Message-ID: To: "Burakov, Anatoly" Cc: Bruce Richardson , dev@dpdk.org Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] unable to bind to vfio-pci X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Thu, Sep 17, 2020 at 4:50 PM Burakov, Anatoly wrote: > > On 17-Sep-20 11:22 AM, Bruce Richardson wrote: > > On Thu, Sep 17, 2020 at 02:21:27PM +0500, Sarosh Arif wrote: > >> On Thu, Sep 17, 2020 at 2:17 PM Bruce Richardson > >> wrote: > >>> > >>> On Thu, Sep 17, 2020 at 11:52:58AM +0500, Sarosh Arif wrote: > >>>> I have been trying to bind to vfio-pci using usertools/dpdk-devbind.py > >>>> but am unable to do so. The reason behind this is that I am unable to > >>>> write in /sys/bus/pci/drivers/vfio-pci/bind. Upon searching solutions > >>>> I tried a couple of things such as setting iommu=pt and intel_iommu=on > >>>> and ensured vt-d is enabled. > >>>> Along with this I have made sure that the vfio-pci module is correctly > >>>> loaded. I have also tried > >>>> > >>>> chmod 666 /sys/bus/pci/drivers/vfio-pci/bind > >>>> > >>>> So that I have permissions to write in this file. > >>>> > >>>> The error I get when I use usertools/dpdk-devbind.py to bind is this: > >>>> Error: bind failed for 0000:b7:00.1 - Cannot bind to driver vfio-pci > >>>> > >>>> The details of 0000:b7:00.1 are as follows: > >>>> Ethernet Connection X722 for 10GBASE-T 37d2' if=eno6 drv=i40e > >>>> > >>>> I have also unbinded The pci bridge to which 0000:b7:00.1 was connected. > >>>> > >>>> What more can be done to resolve this? > >>>> > >>> Since you describe changing permissions on the "bind" file, are you trying > >>> to run dpdk-devbind.py as a non-root user? Does it work as root? > >> I am running it as a root user. It does not work as a root user. > > > > One possible problem that it could be, is that you will need to ensure that > > any other ports on the same device are either similarly bound to vfio-pci > > or not bound to any driver. You can't have e.g. a 2-port X722 NIC where one > > port is bound to the kernel driver, while another is bound to vfio in > > userspace. > > I unbinded all other ports from the kernel driver yet I could not bind to vfio. The problem seems to be the inability to write in /sys/bus/pci/drivers/vfio-pci/bind and /sys/bus/pci/drivers/vfio-pci/new_id. When I manually try to echo in these files I get "Permission denied". > > I don't think this would result in a bind error; rather, you'd see the > IOMMU group as non-viable when attempting to use it with VFIO, but the > binding itself should succeed. > > -- > Thanks, > Anatoly