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 A2EC45A5E for ; Wed, 8 Jul 2015 09:35:57 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP; 08 Jul 2015 00:35:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,430,1432623600"; d="scan'208";a="760428071" Received: from pgsmsx108.gar.corp.intel.com ([10.221.44.103]) by orsmga002.jf.intel.com with ESMTP; 08 Jul 2015 00:35:55 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by PGSMSX108.gar.corp.intel.com (10.221.44.103) with Microsoft SMTP Server (TLS) id 14.3.224.2; Wed, 8 Jul 2015 15:35:53 +0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.46]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.129]) with mapi id 14.03.0224.002; Wed, 8 Jul 2015 15:35:52 +0800 From: "Liu, Yong" To: "Qiu, Michael" , "dts@dpdk.org" Thread-Topic: [dts] [PATCH] fix bug that unbound device then run dts will show wrong interface Thread-Index: AQHQuU8RYZNzbNL51EmLexdHdetgR53RLqUQ Date: Wed, 8 Jul 2015 07:35:52 +0000 Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E10E5B3BA@SHSMSX103.ccr.corp.intel.com> References: <1436336319-6925-1-git-send-email-yong.liu@intel.com> <533710CFB86FA344BFBF2D6802E60286046B28A3@SHSMSX101.ccr.corp.intel.com> In-Reply-To: <533710CFB86FA344BFBF2D6802E60286046B28A3@SHSMSX101.ccr.corp.intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: 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] fix bug that unbound device then run dts will show wrong interface 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: Wed, 08 Jul 2015 07:35:58 -0000 Thanks, not need 'up' string, will send out V2 patch. > -----Original Message----- > From: Qiu, Michael > Sent: Wednesday, July 08, 2015 3:24 PM > To: Liu, Yong; dts@dpdk.org > Subject: Re: [dts] [PATCH] fix bug that unbound device then run dts will > show wrong interface >=20 > On 7/8/2015 2:19 PM, Yong Liu wrote: > > From: Marvin Liu > > > > Previously net device interface name only captured in initialization > process. > > Now every time call get interface function will update it. > > > > Signed-off-by: Marvin Liu > > > > diff --git a/framework/net_device.py b/framework/net_device.py > > index f8ad098..a187d27 100644 > > --- a/framework/net_device.py > > +++ b/framework/net_device.py > > @@ -59,7 +59,7 @@ class NetDevice(object): > > > > if self.nic_is_pf(): > > self.default_vf_driver =3D '' > > - self.intf_name =3D self.get_interface_name() > > + self.get_interface_name() > > self.socket =3D self.get_nic_socket() > > > > def __send_expect(self, cmds, expected, timeout=3DTIMEOUT, > alt_session=3DTrue): > > @@ -126,11 +126,18 @@ class NetDevice(object): > > def get_interface_name(self): > > """ > > Get interface name of specified pci device. > > + Cal this function will update intf_name everytime > > """ > > get_interface_name =3D getattr( > > self, 'get_interface_name_%s' % > > self.__get_os_type()) > > - return get_interface_name(self.bus_id, self.devfun_id, > self.current_driver) > > + out =3D get_interface_name(self.bus_id, self.devfun_id, > self.current_driver) > > + if "No such file or directory up" in out: > > + self.intf_name =3D 'N/A' > > + else: > > + self.intf_name =3D out > > + > > + return self.intf_name > > > > def get_interface_name_linux(self, bus_id, devfun_id, driver): > > """ > > @@ -197,7 +204,11 @@ class NetDevice(object): > > Get mac address of specified pci device. > > """ > > get_mac_addr =3D getattr(self, 'get_mac_addr_%s' % > self.__get_os_type()) > > - return get_mac_addr(self.intf_name, self.bus_id, self.devfun_i= d, > self.current_driver) > > + out =3D get_mac_addr(self.intf_name, self.bus_id, self.devfun_= id, > self.current_driver) > > + if "No such file or directory up" in out: >=20 > Here does "up" need? >=20 > > + return 'N/A' > > + else: > > + return out > > > > def get_mac_addr_linux(self, intf, bus_id, devfun_id, driver): > > """