From: Lijuan Tu <lijuan.tu@intel.com>
To: dts@dpdk.org
Cc: Lijuan Tu <lijuan.tu@intel.com>
Subject: [dts] [next][PATCH]framework/pktgen: fix redundant accounting for multiple streams.
Date: Mon, 11 Jun 2018 20:14:30 +0800 [thread overview]
Message-ID: <1528719270-5007-1-git-send-email-lijuan.tu@intel.com> (raw)
Signed-off-by: Lijuan Tu <lijuan.tu@intel.com>
---
framework/pktgen.py | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/framework/pktgen.py b/framework/pktgen.py
index 8611038..5294ff8 100644
--- a/framework/pktgen.py
+++ b/framework/pktgen.py
@@ -162,14 +162,16 @@ class PacketGenerator(object):
self._start_transmission(stream_ids)
time.sleep(delay)
+ used_rx_port = []
for stream_id in stream_ids:
- rxbps_rates, rxpps_rates = self._retrieve_port_statistic(stream_id)
-
- bps_rx.append(rxbps_rates)
- pps_rx.append(rxpps_rates)
- self._stop_transmission(stream_id)
- bps_rx_total = self._summary_statistic(bps_rx)
- pps_rx_total = self._summary_statistic(pps_rx)
+ if self.__streams[stream_id]['rx_port'] not in used_rx_port:
+ rxbps_rates, rxpps_rates = self._retrieve_port_statistic(stream_id)
+ used_rx_port.append(self.__streams[stream_id]['rx_port'])
+ bps_rx.append(rxbps_rates)
+ pps_rx.append(rxpps_rates)
+ self._stop_transmission(stream_id)
+ bps_rx_total = self._summary_statistic(bps_rx)
+ pps_rx_total = self._summary_statistic(pps_rx)
print "throughput: pps_rx %f, bps_rx %f" % (pps_rx_total, bps_rx_total)
@@ -367,7 +369,9 @@ class TrexPacketGenerator(PacketGenerator):
vm = self.create_vm(ip_src_range, ip_dst_range, action=ip['action'], step=step_temp[3])
- stl_stream = self.trex_streampacket(self.trex_pkt_builder(pkt=pcap_file, vm=vm), mode=self.trex_tx_count(percentage=100))
+ stl_stream = self.trex_stream(
+ packet=self.trex_pkt_builder(pkt=pcap_file, vm=vm),
+ mode=self.trex_tx_count(percentage=100))
self._transmit_streams[stream_id] = stl_stream
--
1.8.3.1
next reply other threads:[~2018-06-11 3:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-11 12:14 Lijuan Tu [this message]
2018-06-14 16:52 ` Lijuan Tu
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=1528719270-5007-1-git-send-email-lijuan.tu@intel.com \
--to=lijuan.tu@intel.com \
--cc=dts@dpdk.org \
/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).