From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0058.outbound.protection.outlook.com [104.47.40.58]) by dpdk.org (Postfix) with ESMTP id B336A19F5 for ; Fri, 2 Sep 2016 00:08:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=SonusNetworks.onmicrosoft.com; s=selector1-sonusnet-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=I2cJIzQldiaKNBGVVNqk3RoxJOQS3Ih3mz7XNtdGcG8=; b=NvYMUvssOYzUJScAN1YP3F4GHtVEk8cmt/rTBb8fgIidoaOAaDZP1/ADvAIJ3dpCOsjUo5BsA1UOupaODNuznTV6v2RvbwCsI7ZkcLm3bf7NTxJx49+KMzf7o29NIGdUqdwB1qtTm1Fg+pU56yTQ1wXZiYDJDMO8ws6piWj3Xnk= Received: from BN6PR03MB2740.namprd03.prod.outlook.com (10.173.144.135) by BN6PR03MB2740.namprd03.prod.outlook.com (10.173.144.135) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.587.13; Thu, 1 Sep 2016 22:08:53 +0000 Received: from BN6PR03MB2740.namprd03.prod.outlook.com ([10.173.144.135]) by BN6PR03MB2740.namprd03.prod.outlook.com ([10.173.144.135]) with mapi id 15.01.0587.018; Thu, 1 Sep 2016 22:08:53 +0000 From: "Dey, Souvik" To: "Mcnamara, John" , "Mussar, Gary" , Stephen Hemminger CC: "nhorman@tuxdriver.com" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v1] dpdk-devbind.py: Virtio interface issue. Thread-Index: AQHR/ngJrYBSlPHhJUWN6RhK2Yt0WKBbZ3YAgACM9VCABBxAUIAEclAAgAC6uPA= Date: Thu, 1 Sep 2016 22:08:53 +0000 Message-ID: References: <20160825022546.96468-1-sodey@sonusnet.com> <20160826085500.5691e07d@xeon-e3> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=sodey@sonusnet.com; x-originating-ip: [2601:191:8300:9cda:7c36:36bc:42e3:43e4] x-ms-office365-filtering-correlation-id: 2c680add-626e-4bf7-0067-08d3d2b48fdf x-microsoft-exchange-diagnostics: 1; BN6PR03MB2740; 6:Pm7rjPyKSLIuX3uNaBYmCdktv7a+O3zQfC4g+cXYMfSFqkV+ykBAxaCeuUiQcKLd56DsuklcTxdDMaBGNinI9ay7ov72gmfPvgfUp+stoIp5W7tXOSMm+LQx5P65VtsXAiCeqa+n0FZr+qlC5n3BBiT4lUfHQ5E2zBQ8uB4jnHXZQfh7hgJZDGGZQMR9HvuLKk0uT2AlmW7sh8Y9YZYtQv6LfdJ0auZgVOOE0vzAnHYFbA2vMNTETs3a2Jf7VzXcSnOjY2O2UFPUiT8nCmykNndiVAhX3seUxHTOvkrgPto=; 5:nPnfuiQ7X0BDD08m21qnOJ03+mlmD0QvRGDHH70HWqyf5rG0b8IXxCFtoquSzTj41C/GQzQQU8hK4O3QbqTEa6oJArr790FDjqaCysRRK2SUeT2JpPYmsMrJ9Vu8cWOOX8oYEfR9V0TfrmRNg+4CeQ==; 24:pGEP/Q73ChX2ZgMfOPf0ygbyluGbYTdX3Kypc84lDfgIUKUoKrkK6/NtabbHJYDuKXGMnp7JZV6bnXjfFMDbfsyiiqCUiWvqIZ8emT8ucO8=; 7:a8wJeWQ+7sqoyDtxewKVeD2qe7lQXydp0htV9plffSQwB0tl9d4MdaA1qAgBv1zn4MVNwSSCu7cROmCYWNxhbk8eLNecy38Im9SGJi79UCTa7hElClymFZuCj1ktFtA5Nq2yYbqyRBTqWg8eE5TvrIdMcFAtn2i4fL0bP6FToaKDdB0Aa0w59RnHy2kjibRkWyuTs6058ZgNO7NrLjML0Jb/tbvaHHUaqHtuQqY7gD2NJI8FIeBgwAXEXY7LUrvi x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN6PR03MB2740; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(788757137089)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001); SRVR:BN6PR03MB2740; BCL:0; PCL:0; RULEID:; SRVR:BN6PR03MB2740; x-forefront-prvs: 0052308DC6 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(7916002)(199003)(377454003)(377424004)(189002)(13464003)(19580405001)(76576001)(2906002)(106116001)(2900100001)(2950100001)(105586002)(33656002)(87936001)(4326007)(8676002)(81156014)(81166006)(99286002)(92566002)(8936002)(86362001)(5002640100001)(19580395003)(10400500002)(3280700002)(101416001)(189998001)(9686002)(54356999)(106356001)(586003)(3660700001)(102836003)(6116002)(7696003)(50986999)(76176999)(5001770100001)(7846002)(97736004)(93886004)(74316002)(7736002)(5660300001)(122556002)(77096005)(11100500001)(305945005)(68736007)(3826002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR03MB2740; H:BN6PR03MB2740.namprd03.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; received-spf: None (protection.outlook.com: sonusnet.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: sonusnet.com X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Sep 2016 22:08:53.6332 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 29a671dc-ed7e-4a54-b1e5-8da1eb495dc3 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR03MB2740 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, 01 Sep 2016 22:08:57 -0000 Yes this patch definitely solves my issue too.=20 -----Original Message----- From: Mcnamara, John [mailto:john.mcnamara@intel.com]=20 Sent: Thursday, September 1, 2016 7:00 AM To: Mussar, Gary ; Dey, Souvik ; Ste= phen 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