From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 76FB76CD6 for ; Wed, 14 Sep 2016 00:50:32 +0200 (CEST) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga101.fm.intel.com with ESMTP; 13 Sep 2016 15:50:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,330,1470726000"; d="scan'208";a="8449717" Received: from irsmsx153.ger.corp.intel.com ([163.33.192.75]) by orsmga004.jf.intel.com with ESMTP; 13 Sep 2016 15:50:30 -0700 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.167]) by IRSMSX153.ger.corp.intel.com ([169.254.9.62]) with mapi id 14.03.0248.002; Tue, 13 Sep 2016 23:50:29 +0100 From: "De Lara Guarch, Pablo" To: "Breen, Eoin" , "Jain, Deepak K" , "Trahe, Fiona" , "Griffin, John" CC: "dev@dpdk.org" , "Breen, Eoin" Thread-Topic: [dpdk-dev] [PATCH v2] tools: add crypto device details Thread-Index: AQHR/tcAYIBNQhfbzUK2Tw3Q/SnQEKB4I70g Date: Tue, 13 Sep 2016 22:50:29 +0000 Message-ID: References: <1472119499-70304-1-git-send-email-eoin.breen@intel.com> <1472133122-77377-1-git-send-email-eoin.breen@intel.com> In-Reply-To: <1472133122-77377-1-git-send-email-eoin.breen@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMmMxNThlNGQtMGM0ZC00N2FiLThiYjItMTM5OWRkOGMzNDhhIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IlE1YmM0a29LWmpPT3cxRGlTYVlNRVRQMG1jcEdFVmZvS2poRzFPR1wvc1J3PSJ9 x-ctpclassification: CTP_IC x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2] tools: add crypto device details 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: Tue, 13 Sep 2016 22:50:33 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Eoin Breen > Sent: Thursday, August 25, 2016 6:52 AM > To: Jain, Deepak K; Trahe, Fiona; Griffin, John > Cc: dev@dpdk.org; Breen, Eoin > Subject: [dpdk-dev] [PATCH v2] tools: add crypto device details >=20 > Adding the support to bind/unbind crypto devices with > dpdk-devbind.py script, as now it is not restricted > to network devices anymore. >=20 > Signed-off-by: Eoin Breen > --- > Changes since v1: > * Resolved coding issues >=20 > tools/dpdk-devbind.py | 107 > ++++++++++++++++++++++++++++++++++++++++++++++---- > 1 file changed, 99 insertions(+), 8 deletions(-) >=20 > diff --git a/tools/dpdk-devbind.py b/tools/dpdk-devbind.py > index b69ca2a..c7576b9 100755 > --- a/tools/dpdk-devbind.py > +++ b/tools/dpdk-devbind.py ... > + # check what is the interface if any for an ssh connection if > + # any to this host, so we can mark it later. > + ssh_if =3D [] > + route =3D check_output(["ip", "-o", "route"]) > + # filter out all lines for 169.254 routes > + route =3D "\n".join(filter(lambda ln: not ln.startswith("169.254"), > + route.decode().splitlines())) > + rt_info =3D route.split() > + for i in range(len(rt_info) - 1): > + if rt_info[i] =3D=3D "dev": > + ssh_if.append(rt_info[i+1]) This is relevant only to network devices, so it should not be included here= . > + > + # based on the basic info, get extended text details > + for d in devices.keys(): > + # get additional info and add it to existing data > + devices[d] =3D devices[d].copy() > + devices[d].update(get_pci_device_details(d).items()) > + > + for _if in ssh_if: > + if _if in devices[d]["Interface"].split(","): > + devices[d]["Ssh_if"] =3D True > + devices[d]["Active"] =3D "*Active*" > + break Same here. > + > + # add igb_uio to list of supporting modules if needed > + if "Module_str" in devices[d]: > + for driver in dpdk_drivers: > + if driver not in devices[d]["Module_str"]: > + devices[d]["Module_str"] =3D \ > + devices[d]["Module_str"] + ",%s" % driver > + else: > + devices[d]["Module_str"] =3D ",".join(dpdk_drivers) > + > + # make sure the driver and module strings do not have any duplic= ates > + if has_driver(d): > + modules =3D devices[d]["Module_str"].split(",") > + if devices[d]["Driver_str"] in modules: > + modules.remove(devices[d]["Driver_str"]) > + devices[d]["Module_str"] =3D ",".join(modules) > + > + > def dev_id_from_dev_name(dev_name): > '''Take a device "name" - a string passed in by user to identify a N= IC > device, and determine the device id - i.e. the domain:bus:slot.func = - for > @@ -480,15 +546,16 @@ def show_status(): > dpdk_drv =3D [] > no_drv =3D [] >=20 > - # split our list of devices into the three categories above > + # split our list of network devices into the three categories above > for d in devices.keys(): > - if not has_driver(d): > - no_drv.append(devices[d]) > - continue > - if devices[d]["Driver_str"] in dpdk_drivers: > - dpdk_drv.append(devices[d]) > - else: > - kernel_drv.append(devices[d]) > + if (NETWORK_BASE_CLASS in devices[d]["Class"]): > + if not has_driver(d): > + no_drv.append(devices[d]) > + continue > + if devices[d]["Driver_str"] in dpdk_drivers: > + dpdk_drv.append(devices[d]) > + else: > + kernel_drv.append(devices[d]) >=20 > # print each category separately, so we can clearly see what's used = by > DPDK > display_devices("Network devices using DPDK-compatible driver", > dpdk_drv, > @@ -498,6 +565,28 @@ def show_status(): > "unused=3D%(Module_str)s %(Active)s") > display_devices("Other network devices", no_drv, > "unused=3D%(Module_str)s") >=20 > + # split our list of crypto devices into the three categories above > + kernel_drv =3D [] > + dpdk_drv =3D [] > + no_drv =3D [] > + > + for d in devices.keys(): > + if (CRYPTO_BASE_CLASS in devices[d]["Class"]): > + if not has_driver(d): > + no_drv.append(devices[d]) > + continue > + if devices[d]["Driver_str"] in dpdk_drivers: > + dpdk_drv.append(devices[d]) > + else: > + kernel_drv.append(devices[d]) > + > + display_devices("Crypto devices using DPDK-compatible driver", > dpdk_drv, > + "drv=3D%(Driver_str)s unused=3D%(Module_str)s") > + display_devices("Crypto devices using kernel driver", kernel_drv, > + "if=3D%(Interface)s drv=3D%(Driver_str)s " > + "unused=3D%(Module_str)s %(Active)s") > + display_devices("Other crypto devices", no_drv, > "unused=3D%(Module_str)s") > + >=20 > def parse_args(): > '''Parses the command-line arguments given by the user and takes the > @@ -562,6 +651,7 @@ def do_arg_actions(): > if status_flag: > if b_flag is not None: > get_nic_details() # refresh if we have changed anything > + get_crypto_details() # refresh if we have changed anything > show_status() >=20 >=20 > @@ -570,6 +660,7 @@ def main(): > parse_args() > check_modules() > get_nic_details() > + get_crypto_details() > do_arg_actions() >=20 > if __name__ =3D=3D "__main__": > -- > 2.5.5 >=20