From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 0651E5683 for ; Wed, 4 Mar 2015 12:32:05 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP; 04 Mar 2015 03:27:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,687,1418112000"; d="scan'208";a="686697559" Received: from kmsmsx151.gar.corp.intel.com ([172.21.73.86]) by fmsmga002.fm.intel.com with ESMTP; 04 Mar 2015 03:32:04 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by KMSMSX151.gar.corp.intel.com (172.21.73.86) with Microsoft SMTP Server (TLS) id 14.3.195.1; Wed, 4 Mar 2015 19:32:01 +0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.192]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.197]) with mapi id 14.03.0195.001; Wed, 4 Mar 2015 19:31:59 +0800 From: "Qiu, Michael" To: "Ouyang, Changchun" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v2] tools/dpdk_nic_bind: Fix can't bind virtio-pci issue Thread-Index: AQHQVibXTfjSHwHfbk2KJc4S20mpFw== Date: Wed, 4 Mar 2015 11:31:59 +0000 Message-ID: <533710CFB86FA344BFBF2D6802E60286CEE857@SHSMSX101.ccr.corp.intel.com> References: <1424926669-14202-1-git-send-email-changchun.ouyang@intel.com> <1425437735-20673-1-git-send-email-changchun.ouyang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2] tools/dpdk_nic_bind: Fix can't bind virtio-pci 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: Wed, 04 Mar 2015 11:32:06 -0000 On 3/4/2015 10:56 AM, Ouyang Changchun wrote:=0A= > The dpdk_nic_bind script will not allow ports to be bound or unbound if n= one of the=0A= > kernel modules supported by DPDK is loaded. This patch relaxes this restr= iction by=0A= > checking if a DPDK module is actually requested. The example below illust= rates this=0A= > problem:=0A= >=0A= > In virtio test, on the guest=0A= > 1. Bind virtio port to igb_uio driver;=0A= > 2. Remove igb_uio module;=0A= > 3. Bind virtio port to virtio-pci driver, it fails and reports:=0A= > "Error - no supported modules are loaded"=0A= >=0A= > The script should check the to-be-bound driver flag, if it is dpdk driver= (igb_uio, vfio etc),=0A= > and the corresponding module is not loaded, then exit, otherwise, just re= port a warning,=0A= > and continue to bind the non-dpdk driver(like virtio-pci) to dev.=0A= >=0A= > Signed-off-by: Changchun Ouyang =0A= > ---=0A= >=0A= > Changes in v2:=0A= > -- Update the description.=0A= >=0A= > tools/dpdk_nic_bind.py | 7 +++++--=0A= > 1 file changed, 5 insertions(+), 2 deletions(-)=0A= >=0A= > diff --git a/tools/dpdk_nic_bind.py b/tools/dpdk_nic_bind.py=0A= > index 2483056..8523f82 100755=0A= > --- a/tools/dpdk_nic_bind.py=0A= > +++ b/tools/dpdk_nic_bind.py=0A= > @@ -175,8 +175,11 @@ def check_modules():=0A= > =0A= > # check if we have at least one loaded module=0A= > if True not in [mod["Found"] for mod in mods] and b_flag is not None= :=0A= > - print "Error - no supported modules are loaded"=0A= > - sys.exit(1)=0A= > + if b_flag in dpdk_drivers:=0A= > + print "Error - no supported modules(DPDK driver) are loaded"= =0A= > + sys.exit(1)=0A= > + else:=0A= > + print "Warning - no supported modules(DPDK driver) are loade= d"=0A= > =0A= > # change DPDK driver list to only contain drivers that are loaded=0A= > dpdk_drivers =3D [mod["Name"] for mod in mods if mod["Found"]]=0A= Acked-by: Michael Qiu =0A=