* [dts] [next][PATCH]framework/pktgen: fix redundant accounting for multiple streams.
@ 2018-06-11 12:14 Lijuan Tu
2018-06-14 16:52 ` Lijuan Tu
0 siblings, 1 reply; 2+ messages in thread
From: Lijuan Tu @ 2018-06-11 12:14 UTC (permalink / raw)
To: dts; +Cc: Lijuan Tu
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [dts] [next][PATCH]framework/pktgen: fix redundant accounting for multiple streams.
2018-06-11 12:14 [dts] [next][PATCH]framework/pktgen: fix redundant accounting for multiple streams Lijuan Tu
@ 2018-06-14 16:52 ` Lijuan Tu
0 siblings, 0 replies; 2+ messages in thread
From: Lijuan Tu @ 2018-06-14 16:52 UTC (permalink / raw)
To: dts
Applied, thanks
On 2018年06月11日 20:14, Lijuan Tu wrote:
> 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
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-06-14 8:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-11 12:14 [dts] [next][PATCH]framework/pktgen: fix redundant accounting for multiple streams Lijuan Tu
2018-06-14 16:52 ` Lijuan Tu
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).