From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id EEB8437A4 for ; Fri, 9 Sep 2016 03:29:21 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga105.fm.intel.com with ESMTP; 08 Sep 2016 18:29:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,303,1470726000"; d="scan'208";a="1053405407" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga002.fm.intel.com with ESMTP; 08 Sep 2016 18:29:23 -0700 Received: from fmsmsx153.amr.corp.intel.com (10.18.125.6) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 8 Sep 2016 18:29:20 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by FMSMSX153.amr.corp.intel.com (10.18.125.6) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 8 Sep 2016 18:28:17 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.102]) by shsmsx102.ccr.corp.intel.com ([169.254.2.109]) with mapi id 14.03.0248.002; Fri, 9 Sep 2016 09:28:15 +0800 From: "Liu, Yong" To: "Xu, GangX" , "dts@dpdk.org" CC: "Xu, GangX" Thread-Topic: [dts] [PATCH V3] modify pci prefix error on freebsd V3 Thread-Index: AQHSCa+Pb+soyNrwu0SeoTA46Ee1QKBwXz+A Date: Fri, 9 Sep 2016 01:28:15 +0000 Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E6022F26D@SHSMSX103.ccr.corp.intel.com> References: <1473324947-8753-1-git-send-email-gangx.xu@intel.com> In-Reply-To: <1473324947-8753-1-git-send-email-gangx.xu@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYjRjOTYyYmQtMmQzNS00NmE4LTk1OTYtNDhmZWRjM2E5YTllIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6InlIcGNaYlhaUUc0TklBT3ZTVUNLK05jaWtOSElqenZwaWJjN3QzNHUwdWs9In0= x-ctpclassification: CTP_IC 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: [dts] [PATCH V3] modify pci prefix error on freebsd V3 X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Sep 2016 01:29:22 -0000 Thanks for fix FreeBSD issue. Applied into master branch. > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of xu,gang > Sent: Thursday, September 08, 2016 4:56 PM > To: dts@dpdk.org > Cc: Xu, GangX > Subject: [dts] [PATCH V3] modify pci prefix error on freebsd V3 >=20 > Signed-off-by: xu,gang > --- > framework/crb.py | 2 +- > framework/dut.py | 14 +++++++------- > nics/net_device.py | 17 +++++++++-------- > 3 files changed, 17 insertions(+), 16 deletions(-) >=20 > diff --git a/framework/crb.py b/framework/crb.py > index 066bb3f..51946f5 100644 > --- a/framework/crb.py > +++ b/framework/crb.py > @@ -281,7 +281,7 @@ class Crb(object): > return None > return match.group(1) >=20 > - def get_pci_dev_driver_freebsd(self, bus_id, devfun_id): > + def get_pci_dev_driver_freebsd(self, domain_id, bus_id, devfun_id): > """ > Get the driver of specified pci device. > """ > diff --git a/framework/dut.py b/framework/dut.py > index 2f4e53a..86923d1 100644 > --- a/framework/dut.py > +++ b/framework/dut.py > @@ -229,10 +229,7 @@ class Dut(Crb): > """ > After all execution done, some special nic like fm10k should be > stop > """ > - for port in self.ports_info: > - pci_bus =3D port['pci'] > - pci_id =3D port['type'] > - # get device driver > + for (pci_bus, pci_id) in self.pci_devices_info: > driver =3D settings.get_nic_driver(pci_id) > if driver is not None: > # unbind device driver > @@ -718,15 +715,18 @@ class Dut(Crb): > self.ports_info =3D [] >=20 > skipped =3D RED('Skipped: Unknown/not selected') > - > + > for (pci_bus, pci_id) in self.pci_devices_info: >=20 > if not dts.accepted_nic(pci_id): > self.logger.info("DUT: [%s %s] %s" % (pci_bus, pci_id, > skipped)) > continue > - > - port =3D GetNicObj(self, pci_bus, '') > + addr_array =3D pci_bus.split(':') > + domain_id =3D addr_array[0] > + bus_id =3D addr_array[1] > + devfun_id =3D addr_array[2] > + port =3D GetNicObj(self, domain_id, bus_id, devfun_id) > intf =3D port.get_interface_name() >=20 > macaddr =3D port.get_mac_addr() > diff --git a/nics/net_device.py b/nics/net_device.py > index 897ceb9..be25ab7 100644 > --- a/nics/net_device.py > +++ b/nics/net_device.py > @@ -136,7 +136,7 @@ class NetDevice(object): > socket =3D -1 > return socket >=20 > - def get_nic_socket_freebsd(self, bus_id, devfun_id): > + def get_nic_socket_freebsd(self, domain_id, bus_id, devfun_id): > NotImplemented >=20 > @nic_has_driver > @@ -200,7 +200,7 @@ class NetDevice(object): > domain_id, bus_id, devfun_id) > return self.__send_expect(command, '# ') >=20 > - def get_interface_name_freebsd(self, bus_id, devfun_id, driver): > + def get_interface_name_freebsd(self, domain_id, bus_id, devfun_id, > driver): > """ > Get interface name of specified pci device on Freebsd. > """ > @@ -212,14 +212,15 @@ class NetDevice(object): > get_interface_name_freebsd =3D getattr(self, >=20 > 'get_interface_name_freebsd_%s' % generic_driver) >=20 > - return get_interface_name_freebsd(bus_id, devfun_id) > + return get_interface_name_freebsd(domain_id, bus_id, devfun_id) >=20 > - def get_interface_name_freebsd_generic(self, bus_id, devfun_id): > + def get_interface_name_freebsd_generic(self, domain_id, bus_id, > devfun_id): > """ > Get the interface name by the default way on freebsd. > """ > + pci_str =3D "%s:%s:%s" % (domain_id, bus_id, devfun_id) > out =3D self.__send_expect("pciconf -l", "# ") > - rexp =3D r"(\w*)@pci0:%s" % bus_id > + rexp =3D r"(\w*)@pci0:%s" % pci_str > pattern =3D re.compile(rexp) > match =3D pattern.findall(out) > if len(match) =3D=3D 0: > @@ -307,7 +308,7 @@ class NetDevice(object): > (domain_id, bus_id, devfun_id, virtio, intf)) > return self.__send_expect(command, '# ') >=20 > - def get_mac_addr_freebsd(self, intf, bus_id, devfun_id, driver): > + def get_mac_addr_freebsd(self, intf, domain_id, bus_id, devfun_id, > driver): > """ > Get mac address of specified pci device on Freebsd. > """ > @@ -323,9 +324,9 @@ class NetDevice(object): > 'get_mac_addr_freebsd_%s' % > generic_driver) >=20 > - return get_mac_addr_freebsd(intf, bus_id, devfun_id) > + return get_mac_addr_freebsd(intf, domain_id, bus_id, devfun_id) >=20 > - def get_mac_addr_freebsd_generic(self, intf, bus_id, devfun_id): > + def get_mac_addr_freebsd_generic(self, intf, domain_id, bus_id, > devfun_id): > """ > Get the MAC by the default way on Freebsd. > """ > -- > 1.9.3