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 EC472DE4 for ; Wed, 8 Jul 2015 09:25:59 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 08 Jul 2015 00:25:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,430,1432623600"; d="scan'208";a="742785270" Received: from pgsmsx102.gar.corp.intel.com ([10.221.44.80]) by fmsmga001.fm.intel.com with ESMTP; 08 Jul 2015 00:25:59 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by PGSMSX102.gar.corp.intel.com (10.221.44.80) with Microsoft SMTP Server (TLS) id 14.3.224.2; Wed, 8 Jul 2015 15:24:05 +0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.246]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.46]) with mapi id 14.03.0224.002; Wed, 8 Jul 2015 15:24:03 +0800 From: "Qiu, Michael" To: "Liu, Yong" , "dts@dpdk.org" Thread-Topic: [dts] [PATCH] fix bug that unbound device then run dts will show wrong interface Thread-Index: AQHQuUYD1Hi1mJshbky2DxWhqGZ9Vw== Date: Wed, 8 Jul 2015 07:24:03 +0000 Message-ID: <533710CFB86FA344BFBF2D6802E60286046B28A3@SHSMSX101.ccr.corp.intel.com> References: <1436336319-6925-1-git-send-email-yong.liu@intel.com> Accept-Language: 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:26:00 -0000 On 7/8/2015 2:19 PM, Yong Liu wrote:=0A= > From: Marvin Liu =0A= >=0A= > Previously net device interface name only captured in initialization proc= ess.=0A= > Now every time call get interface function will update it.=0A= >=0A= > Signed-off-by: Marvin Liu =0A= >=0A= > diff --git a/framework/net_device.py b/framework/net_device.py=0A= > index f8ad098..a187d27 100644=0A= > --- a/framework/net_device.py=0A= > +++ b/framework/net_device.py=0A= > @@ -59,7 +59,7 @@ class NetDevice(object):=0A= > =0A= > if self.nic_is_pf():=0A= > self.default_vf_driver =3D ''=0A= > - self.intf_name =3D self.get_interface_name()=0A= > + self.get_interface_name()=0A= > self.socket =3D self.get_nic_socket()=0A= > =0A= > def __send_expect(self, cmds, expected, timeout=3DTIMEOUT, alt_sessi= on=3DTrue):=0A= > @@ -126,11 +126,18 @@ class NetDevice(object):=0A= > def get_interface_name(self):=0A= > """=0A= > Get interface name of specified pci device.=0A= > + Cal this function will update intf_name everytime=0A= > """=0A= > get_interface_name =3D getattr(=0A= > self, 'get_interface_name_%s' %=0A= > self.__get_os_type())=0A= > - return get_interface_name(self.bus_id, self.devfun_id, self.curr= ent_driver)=0A= > + out =3D get_interface_name(self.bus_id, self.devfun_id, self.cur= rent_driver)=0A= > + if "No such file or directory up" in out:=0A= > + self.intf_name =3D 'N/A'=0A= > + else:=0A= > + self.intf_name =3D out=0A= > +=0A= > + return self.intf_name=0A= > =0A= > def get_interface_name_linux(self, bus_id, devfun_id, driver):=0A= > """=0A= > @@ -197,7 +204,11 @@ class NetDevice(object):=0A= > Get mac address of specified pci device.=0A= > """=0A= > get_mac_addr =3D getattr(self, 'get_mac_addr_%s' % self.__get_os= _type())=0A= > - return get_mac_addr(self.intf_name, self.bus_id, self.devfun_id,= self.current_driver)=0A= > + out =3D get_mac_addr(self.intf_name, self.bus_id, self.devfun_id= , self.current_driver)=0A= > + if "No such file or directory up" in out:=0A= =0A= Here does "up" need?=0A= =0A= > + return 'N/A'=0A= > + else:=0A= > + return out=0A= > =0A= > def get_mac_addr_linux(self, intf, bus_id, devfun_id, driver):=0A= > """=0A= =0A=