From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 143452931 for ; Thu, 25 Aug 2016 11:51:18 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP; 25 Aug 2016 02:51:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,575,1464678000"; d="scan'208";a="870889210" Received: from irsmsx153.ger.corp.intel.com ([163.33.192.75]) by orsmga003.jf.intel.com with ESMTP; 25 Aug 2016 02:51:16 -0700 Received: from irsmsx103.ger.corp.intel.com ([169.254.3.204]) by IRSMSX153.ger.corp.intel.com ([169.254.9.206]) with mapi id 14.03.0248.002; Thu, 25 Aug 2016 10:51:15 +0100 From: "Mcnamara, John" To: souvikdey33 , "nhorman@tuxdriver.com" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v1] dpdk-devbind.py: Virtio interface issue. Thread-Index: AQHR/ngeGndZGSeU0k6WZg29Av3v16BZaofg Date: Thu, 25 Aug 2016 09:51:14 +0000 Message-ID: References: <20160825022546.96468-1-sodey@sonusnet.com> In-Reply-To: <20160825022546.96468-1-sodey@sonusnet.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNjRhMWUzMTAtMzQ1My00Y2FlLWJiZDctZjFhNGJiNWM5MWM1IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6Ik9IOHRrbHFCcGFhTDF6Qzc0b00za2NoK0VRdkQrSWZMSWlMdmM5OXhqSkU9In0= x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v1] dpdk-devbind.py: Virtio interface 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: Thu, 25 Aug 2016 09:51:19 -0000 Hi, Welcome to DPDK and thanks for the contribution. It looks like a useful fix= . Since you are a new contributor the user guide on "Contributing Code to DPD= K" explains some of the steps involved: http://dpdk.org/doc/guides/contributing/patches.html Some comments below. > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of souvikdey33 > Sent: Thursday, August 25, 2016 3:26 AM > To: nhorman@tuxdriver.com; dev@dpdk.org > Cc: souvikdey33 > Subject: [dpdk-dev] [PATCH v1] dpdk-devbind.py: Virtio interface issue. As you will see in the guide above the subject line should be lowercase and shouldn't end with a full stop. Also, the prefix would be better as "tools"= .=20 Something like this: tools: fix issue with virtio interfaces The word fix on the command line normally means you should add a "Fixes" li= ne to the body but in this case the issue was probably always there (or at lea= st since virtio support was added) so you can probably omit it. >=20 > This change is required to have the interface name for virtio interfaces. > When we execute the status command the for virtio inerfaces we get Sample > output without the change: > 0000:00:04.0 'Virtio network device' if=3D drv=3Dvirtio-pci > unused=3Dvirtio_pci,igb_uio Though for other drivers this works. > Sample output with the change: > 0000:00:04.0 'Virtio network device' if=3Deth0 drv=3Dvirtio-pci > unused=3Dvirtio_pci,igb_uio >=20 > souvikdey33 (1): > Signed-off-by: souvikdey33 You should add your real name to the sign off. > diff --git a/tools/dpdk-devbind.py b/tools/dpdk-devbind.py index > b69ca2a..9829e25 100755 > --- a/tools/dpdk-devbind.py > +++ b/tools/dpdk-devbind.py > @@ -36,6 +36,8 @@ import sys > import os > import getopt > import subprocess > +import commands The commands module is deprecated in Python 2 and removed in Python 3. Python 2 and 3 should both be supported by the DPDK tools. In which case you can use subprocess.check_output(), or similar, instead. =20 > + > from os.path import exists, abspath, dirname, basename >=20 > # The PCI base class for NETWORK devices @@ -222,8 +224,15 @@ def > get_pci_device_details(dev_id): > device[name] =3D value > # check for a unix interface name > sys_path =3D "/sys/bus/pci/devices/%s/net/" % dev_id > + #The path for virtio devices are different. Get the correct path. > + virtio =3D "/sys/bus/pci/devices/%s/" % dev_id This space/tab indentation gives a Python error. > + cmd =3D " ls %s | grep 'virt' " %virtio > + virtio =3D commands.getoutput(cmd) > + virtio_sys_path =3D "/sys/bus/pci/devices/%s/%s/net/" % > +(dev_id,virtio) > if exists(sys_path): > device["Interface"] =3D ",".join(os.listdir(sys_path)) > + elif exists(virt_path): > + device["Interface"] =3D ",".join(os.listdir(virtio_sys_path)) > else: > device["Interface"] =3D "" > # check if a port is used for ssh connection There a number of small Python formatting issues in the patch. The DPDK Pyt= hon code follows the pep8 guidelines: http://dpdk.org/doc/guides/contributing/coding_style.html#python-code Here are the warnings: $ pep8 tools/dpdk-devbind.py=20 tools/dpdk-devbind.py:227:5: E265 block comment should start with '# ' tools/dpdk-devbind.py:228:1: E101 indentation contains mixed spaces an= d tabs tools/dpdk-devbind.py:228:1: W191 indentation contains tabs tools/dpdk-devbind.py:228:2: E113 unexpected indentation tools/dpdk-devbind.py:229:1: E101 indentation contains mixed spaces an= d tabs tools/dpdk-devbind.py:229:36: E225 missing whitespace around operator tools/dpdk-devbind.py:231:66: E231 missing whitespace after ',' Could you fix those issues and submit a V2 of the patch. Thanks. John