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 4877BA04CC; Mon, 21 Sep 2020 13:36:47 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1C9B41D8CC; Mon, 21 Sep 2020 13:36:46 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id A61FD1D8C9 for ; Mon, 21 Sep 2020 13:36:43 +0200 (CEST) IronPort-SDR: M1ijh1RRsC5VnwCVuCl3v8tquWvMNfrj06Ad6N2uw+DrxbNWl6QdEHso/BS+T7wD715461IEZo 3GJXRbRx5dHw== X-IronPort-AV: E=McAfee;i="6000,8403,9750"; a="148015523" X-IronPort-AV: E=Sophos;i="5.77,286,1596524400"; d="scan'208";a="148015523" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Sep 2020 04:36:38 -0700 IronPort-SDR: ZzW0QEmxmH89bTZXYPLnTlfvtcsa/8xH9eYZ7cUIkVbTwuN+Tg1mnK5sR4G8WIPbx7/m3AfV4Q Z67/EkjnNNhQ== X-IronPort-AV: E=Sophos;i="5.77,286,1596524400"; d="scan'208";a="485406416" Received: from aburakov-mobl.ger.corp.intel.com (HELO [10.213.248.121]) ([10.213.248.121]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Sep 2020 04:36:37 -0700 To: Sarosh Arif Cc: Bruce Richardson , dev@dpdk.org References: <20200917091723.GD1568@bricha3-MOBL.ger.corp.intel.com> <20200917102204.GE1568@bricha3-MOBL.ger.corp.intel.com> <8fa1aae5-617c-64a7-a647-fd2508e0f662@intel.com> From: "Burakov, Anatoly" Message-ID: <46cecc05-81d3-2933-dc8f-6c6671e219f2@intel.com> Date: Mon, 21 Sep 2020 12:36:35 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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 21-Sep-20 12:10 PM, Sarosh Arif wrote: > 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". Does dmesg | tail indicate anything? >> >> 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 -- Thanks, Anatoly