From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 748ABA0613 for ; Mon, 23 Sep 2019 08:59:29 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6B7631B994; Mon, 23 Sep 2019 08:59:29 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 00B334C90 for ; Mon, 23 Sep 2019 08:59:27 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Sep 2019 23:59:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,539,1559545200"; d="scan'208";a="203064436" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga001.fm.intel.com with ESMTP; 22 Sep 2019 23:59:27 -0700 Received: from fmsmsx605.amr.corp.intel.com (10.18.126.85) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 22 Sep 2019 23:59:26 -0700 Received: from fmsmsx605.amr.corp.intel.com (10.18.126.85) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Sun, 22 Sep 2019 23:59:26 -0700 Received: from shsmsx153.ccr.corp.intel.com (10.239.6.53) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Sun, 22 Sep 2019 23:59:25 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.113]) by SHSMSX153.ccr.corp.intel.com ([169.254.12.235]) with mapi id 14.03.0439.000; Mon, 23 Sep 2019 14:57:57 +0800 From: "Mo, YufengX" To: "dts@dpdk.org" , "Li, WenjieX A" , "Chen, Zhaoyan" , "Tu, Lijuan" Thread-Topic: [dts][PATCH V2 5/7] framework/pktgen_ixia: fix internal bug Thread-Index: AQHVcdsFsqnfMzkLL06rqsG4vuwlBqc41LvQ Date: Mon, 23 Sep 2019 06:57:57 +0000 Message-ID: References: <20190923065040.8251-1-yufengx.mo@intel.com> <20190923065040.8251-6-yufengx.mo@intel.com> In-Reply-To: <20190923065040.8251-6-yufengx.mo@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 V2 5/7] framework/pktgen_ixia: fix internal bug 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: , Errors-To: dts-bounces@dpdk.org Sender: "dts" Tested by Mo, YufengX > -----Original Message----- > From: Mo, YufengX > Sent: Monday, September 23, 2019 2:51 PM > To: dts@dpdk.org; Li, WenjieX A ; Chen, Zhaoyan <= zhaoyan.chen@intel.com>; Tu, Lijuan > Cc: Mo, YufengX > Subject: [dts][PATCH V2 5/7] framework/pktgen_ixia: fix internal bug >=20 >=20 > *. set part of information logger display to debug level. > *. set PacketGenerator class logger as Ixia class logger. > *. remove un-used libs import. >=20 > Signed-off-by: yufengmx > --- > framework/pktgen_ixia.py | 39 +++++++++++++++++++-------------------- > 1 file changed, 19 insertions(+), 20 deletions(-) >=20 > diff --git a/framework/pktgen_ixia.py b/framework/pktgen_ixia.py > index d324263..69f858e 100644 > --- a/framework/pktgen_ixia.py > +++ b/framework/pktgen_ixia.py > @@ -36,7 +36,6 @@ from pprint import pformat >=20 > from ssh_connection import SSHConnection > from settings import SCAPY2IXIA > -from logger import getLogger > from utils import (convert_int2ip, convert_ip2int, > convert_mac2long, convert_mac2str) >=20 > @@ -52,15 +51,15 @@ class Ixia(SSHConnection): > IXIA performance measurement class. > """ >=20 > - def __init__(self, tester, ixiaPorts): > + def __init__(self, tester, ixiaPorts, logger): > self.tester =3D tester > self.NAME =3D PKTGEN_IXIA > - self.logger =3D getLogger(self.NAME) > super(Ixia, self).__init__( > self.get_ip_address(), > self.NAME, > self.tester.get_username(), > self.get_password()) > + self.logger =3D logger > super(Ixia, self).init_log(self.logger) >=20 > self.tcl_cmds =3D [] > @@ -79,8 +78,8 @@ class Ixia(SSHConnection): > else: > self.enable100g =3D 'disable' >=20 > - self.logger.info(self.ixiaVersion) > - self.logger.info(self.ports) > + self.logger.debug(self.ixiaVersion) > + self.logger.debug(self.ports) >=20 > self.tclServerIP =3D ixiaPorts[ixiaRef]["IP"] >=20 > @@ -758,7 +757,7 @@ class Ixia(SSHConnection): > sendNumber +=3D self.get_frames_sent() > time.sleep(0.5) >=20 > - self.logger.info("send :%f" % sendNumber) > + self.logger.debug("send :%f" % sendNumber) >=20 > assert sendNumber !=3D 0 >=20 > @@ -766,7 +765,7 @@ class Ixia(SSHConnection): > for port in rxPortlist: > self.stat_get_stat_all_stats(port) > revNumber +=3D self.get_frames_received() > - self.logger.info("rev :%f" % revNumber) > + self.logger.debug("rev :%f" % revNumber) >=20 > return float(sendNumber - revNumber) / sendNumber, sendNumber, r= evNumber >=20 > @@ -943,8 +942,8 @@ class Ixia(SSHConnection): > out =3D self.send_expect("stat cget -oversize", '%', 10) > oversize +=3D int(out.strip()) >=20 > - self.logger.info("Rate: %f Mpps" % (rate * 1.0 / 1000000)) > - self.logger.info("Mbps rate: %f Mbps" % (bpsRate * 1.0 / 1000000= )) > + self.logger.debug("Rate: %f Mpps" % (rate * 1.0 / 1000000)) > + self.logger.debug("Mbps rate: %f Mbps" % (bpsRate * 1.0 / 100000= 0)) >=20 > self.hook_transmission_func() >=20 > @@ -1233,7 +1232,7 @@ class Ixia(SSHConnection): > self.stat_get_stat_all_stats(port) > txPackets =3D self.get_frames_sent() > rxPackets +=3D self.get_frames_received() > - self.logger.info("Received packets :%s" % rxPackets) > + self.logger.debug("Received packets :%s" % rxPackets) >=20 > return rxPackets >=20 > @@ -1399,7 +1398,7 @@ class IxiaPacketGenerator(PacketGenerator): >=20 > def _connect(self, tester, conf): > # initialize ixia class > - self._conn =3D Ixia(tester, conf) > + self._conn =3D Ixia(tester, conf, self.logger) > for p in self._conn.get_ports(): > self._ports.append(p) >=20 > @@ -1445,7 +1444,7 @@ class IxiaPacketGenerator(PacketGenerator): > ''' > for name, _port_obj in self._conn.ports.iteritems(): > _pci =3D _port_obj.info['pci_addr'] > - self.logger.info((_pci, pci)) > + self.logger.debug((_pci, pci)) > if _pci =3D=3D pci: > return True > else: > @@ -1535,8 +1534,8 @@ class IxiaPacketGenerator(PacketGenerator): > "Tx Port %d stats: " % (tx_port_id), > "tx_port: %d, tx_bps: %f, tx_pps: %f " % ( > tx_port_id, tx_bps, tx_pps)] > - self.logger.info(pformat(port_stats)) > - self.logger.info(os.linesep.join(msg)) > + self.logger.debug(pformat(port_stats)) > + self.logger.debug(os.linesep.join(msg)) > # rx bps/pps > rx_port_id =3D stream["rx_port"] > port_stats =3D stats.get(rx_port_id) > @@ -1550,8 +1549,8 @@ class IxiaPacketGenerator(PacketGenerator): > "rx_port: %d, rx_bps: %f, rx_pps: %f" % ( > rx_port_id, rx_bps, rx_pps)] >=20 > - self.logger.info(pformat(port_stats)) > - self.logger.info(os.linesep.join(msg)) > + self.logger.debug(pformat(port_stats)) > + self.logger.debug(os.linesep.join(msg)) >=20 > return rx_bps, rx_pps >=20 > @@ -1566,13 +1565,13 @@ class IxiaPacketGenerator(PacketGenerator): > self.logger.error(msg) > return None > msg =3D "Tx Port %d stats: " % (port_id) > - self.logger.info(msg) > + self.logger.debug(msg) > opackets =3D port_stats["opackets"] > # rx packet > port_id =3D stream.get("rx_port") > port_stats =3D stats[port_id] > msg =3D "Rx Port %d stats: " % (port_id) > - self.logger.info(msg) > + self.logger.debug(msg) > ipackets =3D port_stats["ipackets"] >=20 > return opackets, ipackets > @@ -1699,8 +1698,8 @@ class IxiaPacketGenerator(PacketGenerator): > ''' ixia traffic statistics ''' > stats =3D self._conn.get_stats(self._traffic_ports, mode) > stream =3D self._get_stream(stream_id) > - self.logger.info(pformat(stream)) > - self.logger.info(pformat(stats)) > + self.logger.debug(pformat(stream)) > + self.logger.debug(pformat(stats)) > if mode =3D=3D 'throughput': > return self._throughput_stats(stream, stats) > elif mode =3D=3D 'loss': > -- > 2.21.0