From: yufengmx <yufengx.mo@intel.com>
To: dts@dpdk.org, wenjiex.a.li@intel.com, zhaoyan.chen@intel.com,
lijuan.tu@intel.com
Cc: yufengmx <yufengx.mo@intel.com>
Subject: [dts] [PATCH V2 5/7] framework/pktgen_ixia: fix internal bug
Date: Mon, 23 Sep 2019 14:50:38 +0800 [thread overview]
Message-ID: <20190923065040.8251-6-yufengx.mo@intel.com> (raw)
In-Reply-To: <20190923065040.8251-1-yufengx.mo@intel.com>
*. set part of information logger display to debug level.
*. set PacketGenerator class logger as Ixia class logger.
*. remove un-used libs import.
Signed-off-by: yufengmx <yufengx.mo@intel.com>
---
framework/pktgen_ixia.py | 39 +++++++++++++++++++--------------------
1 file changed, 19 insertions(+), 20 deletions(-)
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
from ssh_connection import SSHConnection
from settings import SCAPY2IXIA
-from logger import getLogger
from utils import (convert_int2ip, convert_ip2int,
convert_mac2long, convert_mac2str)
@@ -52,15 +51,15 @@ class Ixia(SSHConnection):
IXIA performance measurement class.
"""
- def __init__(self, tester, ixiaPorts):
+ def __init__(self, tester, ixiaPorts, logger):
self.tester = tester
self.NAME = PKTGEN_IXIA
- self.logger = getLogger(self.NAME)
super(Ixia, self).__init__(
self.get_ip_address(),
self.NAME,
self.tester.get_username(),
self.get_password())
+ self.logger = logger
super(Ixia, self).init_log(self.logger)
self.tcl_cmds = []
@@ -79,8 +78,8 @@ class Ixia(SSHConnection):
else:
self.enable100g = 'disable'
- self.logger.info(self.ixiaVersion)
- self.logger.info(self.ports)
+ self.logger.debug(self.ixiaVersion)
+ self.logger.debug(self.ports)
self.tclServerIP = ixiaPorts[ixiaRef]["IP"]
@@ -758,7 +757,7 @@ class Ixia(SSHConnection):
sendNumber += self.get_frames_sent()
time.sleep(0.5)
- self.logger.info("send :%f" % sendNumber)
+ self.logger.debug("send :%f" % sendNumber)
assert sendNumber != 0
@@ -766,7 +765,7 @@ class Ixia(SSHConnection):
for port in rxPortlist:
self.stat_get_stat_all_stats(port)
revNumber += self.get_frames_received()
- self.logger.info("rev :%f" % revNumber)
+ self.logger.debug("rev :%f" % revNumber)
return float(sendNumber - revNumber) / sendNumber, sendNumber, revNumber
@@ -943,8 +942,8 @@ class Ixia(SSHConnection):
out = self.send_expect("stat cget -oversize", '%', 10)
oversize += int(out.strip())
- 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 / 1000000))
self.hook_transmission_func()
@@ -1233,7 +1232,7 @@ class Ixia(SSHConnection):
self.stat_get_stat_all_stats(port)
txPackets = self.get_frames_sent()
rxPackets += self.get_frames_received()
- self.logger.info("Received packets :%s" % rxPackets)
+ self.logger.debug("Received packets :%s" % rxPackets)
return rxPackets
@@ -1399,7 +1398,7 @@ class IxiaPacketGenerator(PacketGenerator):
def _connect(self, tester, conf):
# initialize ixia class
- self._conn = Ixia(tester, conf)
+ self._conn = Ixia(tester, conf, self.logger)
for p in self._conn.get_ports():
self._ports.append(p)
@@ -1445,7 +1444,7 @@ class IxiaPacketGenerator(PacketGenerator):
'''
for name, _port_obj in self._conn.ports.iteritems():
_pci = _port_obj.info['pci_addr']
- self.logger.info((_pci, pci))
+ self.logger.debug((_pci, pci))
if _pci == 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 = stream["rx_port"]
port_stats = 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)]
- 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))
return rx_bps, rx_pps
@@ -1566,13 +1565,13 @@ class IxiaPacketGenerator(PacketGenerator):
self.logger.error(msg)
return None
msg = "Tx Port %d stats: " % (port_id)
- self.logger.info(msg)
+ self.logger.debug(msg)
opackets = port_stats["opackets"]
# rx packet
port_id = stream.get("rx_port")
port_stats = stats[port_id]
msg = "Rx Port %d stats: " % (port_id)
- self.logger.info(msg)
+ self.logger.debug(msg)
ipackets = port_stats["ipackets"]
return opackets, ipackets
@@ -1699,8 +1698,8 @@ class IxiaPacketGenerator(PacketGenerator):
''' ixia traffic statistics '''
stats = self._conn.get_stats(self._traffic_ports, mode)
stream = 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 == 'throughput':
return self._throughput_stats(stream, stats)
elif mode == 'loss':
--
2.21.0
next prev parent reply other threads:[~2019-09-23 6:49 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-23 6:50 [dts] [PATCH V2 0/7] dts/pktgen: fix internal bugs yufengmx
2019-09-23 6:50 ` [dts] [PATCH V2 1/7] framework/logger: add pktgen logger and remove duplicate yufengmx
2019-09-23 6:58 ` Mo, YufengX
2019-09-23 6:50 ` [dts] [PATCH V2 2/7] framework/dut: fix logger quit issue yufengmx
2019-09-23 6:58 ` Mo, YufengX
2019-09-23 6:50 ` [dts] [PATCH V2 3/7] framework/tester: " yufengmx
2019-09-23 6:58 ` Mo, YufengX
2019-09-23 6:50 ` [dts] [PATCH V2 4/7] framework/pktgen_base: fix internal bug yufengmx
2019-09-23 6:58 ` Mo, YufengX
2019-09-23 6:50 ` yufengmx [this message]
2019-09-23 6:57 ` [dts] [PATCH V2 5/7] framework/pktgen_ixia: " Mo, YufengX
2019-09-23 6:50 ` [dts] [PATCH V2 6/7] framework/pktgen_trex: " yufengmx
2019-09-23 6:57 ` Mo, YufengX
2019-09-23 6:50 ` [dts] [PATCH V2 7/7] framework/pktgen: " yufengmx
2019-09-23 6:57 ` Mo, YufengX
2019-09-23 6:58 ` [dts] [PATCH V2 0/7] dts/pktgen: fix internal bugs Mo, YufengX
2019-09-24 9:14 ` Tu, Lijuan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190923065040.8251-6-yufengx.mo@intel.com \
--to=yufengx.mo@intel.com \
--cc=dts@dpdk.org \
--cc=lijuan.tu@intel.com \
--cc=wenjiex.a.li@intel.com \
--cc=zhaoyan.chen@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).