From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-00103a01.pphosted.com (mx0b-00103a01.pphosted.com [67.231.152.227]) by dpdk.org (Postfix) with ESMTP id 3C3664CE4 for ; Fri, 2 Sep 2016 14:57:19 +0200 (CEST) Received: from pps.filterd (m0002317.ppops.net [127.0.0.1]) by mx0b-00103a01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u82Ct1Bp018704; Fri, 2 Sep 2016 08:57:18 -0400 Received: from vawvcgsie2k1302.ciena.com (lin1-118-36-36.ciena.com [63.118.36.36]) by mx0b-00103a01.pphosted.com with ESMTP id 25373g6qxv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Fri, 02 Sep 2016 08:57:18 -0400 Received: from VAWVMDMAIL01.ciena.com (10.4.156.37) by VAWVCGSIE2K1302.ciena.com (10.4.62.16) with Microsoft SMTP Server (TLS) id 15.0.1104.5; Fri, 2 Sep 2016 08:57:11 -0400 Received: from ONWVEXCHHT04.ciena.com (10.128.6.44) by VAWVMDMAIL01.ciena.com (10.4.156.37) with Microsoft SMTP Server (TLS) id 15.0.1104.5; Fri, 2 Sep 2016 08:57:11 -0400 Received: from ONWVEXCHMB04.ciena.com ([::1]) by ONWVEXCHHT04.ciena.com ([::1]) with mapi; Fri, 2 Sep 2016 08:57:10 -0400 From: "Mussar, Gary" To: "Mcnamara, John" , "Dey, Souvik" , Stephen Hemminger CC: "nhorman@tuxdriver.com" , "dev@dpdk.org" Date: Fri, 2 Sep 2016 08:57:10 -0400 Thread-Topic: [dpdk-dev] [PATCH v1] dpdk-devbind.py: Virtio interface issue. Thread-Index: AQHR/ngeGndZGSeU0k6WZg29Av3v16BbVrIAgACNPoCABB0MgIAEgKqAgAG0UhA= Message-ID: References: <20160825022546.96468-1-sodey@sonusnet.com> <20160826085500.5691e07d@xeon-e3> In-Reply-To: Accept-Language: en-US, en-CA Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US, en-CA x-tm-as-product-ver: SMEX-10.0.0.1412-7.000.1014-22550.006 x-tm-as-result: No--40.214600-8.000000-31 x-tm-as-user-approved-sender: No x-tm-as-user-blocked-sender: No Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-09-02_04:, , signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 impostorscore=0 lowpriorityscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1609020172 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: Fri, 02 Sep 2016 12:57:19 -0000 I will get a proper patch sent hopefully today. Gary -----Original Message----- From: Mcnamara, John [mailto:john.mcnamara@intel.com]=20 Sent: Thursday, September 01, 2016 7:00 AM To: Mussar, Gary; Dey, Souvik; Stephen Hemminger Cc: nhorman@tuxdriver.com; dev@dpdk.org Subject: RE: [dpdk-dev] [PATCH v1] dpdk-devbind.py: Virtio interface issue. > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Mussar, Gary > Sent: Monday, August 29, 2016 4:10 PM > To: Dey, Souvik ; Stephen Hemminger=20 > > Cc: nhorman@tuxdriver.com; dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v1] dpdk-devbind.py: Virtio interface=20 > issue. >=20 > We did this slightly differently. This is 100% python and is a bit=20 > more general. We search for the first "net" directory under the=20 > specific device directory. >=20 > ------------------------------------------- > --- tools/dpdk-devbind.py 2016-08-29 11:02:35.594202888 -0400 > +++ ../dpdk/tools/dpdk-devbind.py 2016-08-29 11:00:34.897677233 -0400 > @@ -221,11 +221,11 @@ > name =3D name.strip(":") + "_str" > device[name] =3D value > # check for a unix interface name > - sys_path =3D "/sys/bus/pci/devices/%s/net/" % dev_id > - if exists(sys_path): > - device["Interface"] =3D ",".join(os.listdir(sys_path)) > - else: > - device["Interface"] =3D "" > + device["Interface"] =3D "" > + for base, dirs, files in os.walk("/sys/bus/pci/devices/%s/" % > dev_id): > + if "net" in dirs: > + device["Interface"] =3D > ",".join(os.listdir(os.path.join(base,"net"))) > + break > # check if a port is used for ssh connection > device["Ssh_if"] =3D False > device["Active"] =3D "" > ------------------------------------------- Hi Gary, That looks like a cleaner solution. Could you submit that as a patch. Souvik, could you test this patch and confirm it fixes your issue. Gary, if you submit a patch could you make a few minor changes: > + device["Interface"] =3D "" > + for base, dirs, files in os.walk("/sys/bus/pci/devices/%s/" % dev_id= ): > + =20 If "files" is unused, and it looks like it is, then replace it with "_". > + device["Interface"] =3D=20 > + ",".join(os.listdir(os.path.join(base,"net"))) There is a space required after "," for PEP8 compliance. John