* [dts] [PATCH V1 0/1] framework/pktgen_base: fix rfc2544 dichotomy warm up and return value fix rfc2544 dichotomy warm up and return value.
@ 2020-01-02 8:20 yufengmx
2020-01-02 8:20 ` [dts] [PATCH V1 1/1] framework/pktgen_base: fix rfc2544 dichotomy warm up and yufengmx
0 siblings, 1 reply; 3+ messages in thread
From: yufengmx @ 2020-01-02 8:20 UTC (permalink / raw)
To: dts, yinan.wang, lihongx.ma, lijuan.tu; +Cc: yufengmx
yufengmx (1):
framework/pktgen_base: fix rfc2544 dichotomy warm up and return value
framework/pktgen_base.py | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
--
2.21.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* [dts] [PATCH V1 1/1] framework/pktgen_base: fix rfc2544 dichotomy warm up and
2020-01-02 8:20 [dts] [PATCH V1 0/1] framework/pktgen_base: fix rfc2544 dichotomy warm up and return value fix rfc2544 dichotomy warm up and return value yufengmx
@ 2020-01-02 8:20 ` yufengmx
2020-01-03 3:04 ` Tu, Lijuan
0 siblings, 1 reply; 3+ messages in thread
From: yufengmx @ 2020-01-02 8:20 UTC (permalink / raw)
To: dts, yinan.wang, lihongx.ma, lijuan.tu; +Cc: yufengmx
return value
fix rfc2544 dichotomy warm up and return value.
Signed-off-by: yufengmx <yufengx.mo@intel.com>
---
framework/pktgen_base.py | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/framework/pktgen_base.py b/framework/pktgen_base.py
index 75c3036..5e51b1a 100644
--- a/framework/pktgen_base.py
+++ b/framework/pktgen_base.py
@@ -167,7 +167,6 @@ class PacketGenerator(object):
self._start_transmission(stream_ids, options)
time.sleep(delay)
self._stop_transmission(stream_ids)
- self._clear_streams()
def __get_single_throughput_statistic(self, stream_ids):
bps_rx = []
@@ -495,7 +494,10 @@ class PacketGenerator(object):
# start warm up traffic
delay = options.get('delay')
_options = {'duration': duration}
- self.__warm_up_pktgen(stream_ids, _options, delay)
+ if delay:
+ self._prepare_transmission(stream_ids=stream_ids)
+ self.__warm_up_pktgen(stream_ids, _options, delay)
+ self._clear_streams()
# traffic parameters for dichotomy algorithm
loss_rate_table = []
hit_result = None
@@ -527,16 +529,18 @@ class PacketGenerator(object):
self._set_stream_rate_percent(rate)
if not hit_result:
- msg = ('expected permit loss rate <{0}>'
+ msg = ('expected permit loss rate <{0}> '
'not between rate {1} and rate {2}').format(
permit_loss_rate, max_rate, min_rate)
self.logger.error(msg)
self.logger.info(pformat(loss_rate_table))
+ ret_value = 0, result[0][1], result[0][2]
else:
self.logger.debug(pformat(loss_rate_table))
+ ret_value = rate, hit_result[0][1], hit_result[0][2]
self.logger.info("zero loss rate is %f" % rate)
- return hit_result
+ return ret_value
def measure(self, stream_ids, traffic_opt):
'''
--
2.21.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dts] [PATCH V1 1/1] framework/pktgen_base: fix rfc2544 dichotomy warm up and
2020-01-02 8:20 ` [dts] [PATCH V1 1/1] framework/pktgen_base: fix rfc2544 dichotomy warm up and yufengmx
@ 2020-01-03 3:04 ` Tu, Lijuan
0 siblings, 0 replies; 3+ messages in thread
From: Tu, Lijuan @ 2020-01-03 3:04 UTC (permalink / raw)
To: Mo, YufengX, dts, Wang, Yinan, Ma, LihongX
applied
> -----Original Message-----
> From: Mo, YufengX
> Sent: Thursday, January 2, 2020 4:21 PM
> To: dts@dpdk.org; Wang, Yinan <yinan.wang@intel.com>; Ma, LihongX
> <lihongx.ma@intel.com>; Tu, Lijuan <lijuan.tu@intel.com>
> Cc: Mo, YufengX <yufengx.mo@intel.com>
> Subject: [dts][PATCH V1 1/1] framework/pktgen_base: fix rfc2544 dichotomy
> warm up and
>
> return value
>
> fix rfc2544 dichotomy warm up and return value.
>
> Signed-off-by: yufengmx <yufengx.mo@intel.com>
> ---
> framework/pktgen_base.py | 12 ++++++++----
> 1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/framework/pktgen_base.py b/framework/pktgen_base.py index
> 75c3036..5e51b1a 100644
> --- a/framework/pktgen_base.py
> +++ b/framework/pktgen_base.py
> @@ -167,7 +167,6 @@ class PacketGenerator(object):
> self._start_transmission(stream_ids, options)
> time.sleep(delay)
> self._stop_transmission(stream_ids)
> - self._clear_streams()
>
> def __get_single_throughput_statistic(self, stream_ids):
> bps_rx = []
> @@ -495,7 +494,10 @@ class PacketGenerator(object):
> # start warm up traffic
> delay = options.get('delay')
> _options = {'duration': duration}
> - self.__warm_up_pktgen(stream_ids, _options, delay)
> + if delay:
> + self._prepare_transmission(stream_ids=stream_ids)
> + self.__warm_up_pktgen(stream_ids, _options, delay)
> + self._clear_streams()
> # traffic parameters for dichotomy algorithm
> loss_rate_table = []
> hit_result = None
> @@ -527,16 +529,18 @@ class PacketGenerator(object):
> self._set_stream_rate_percent(rate)
>
> if not hit_result:
> - msg = ('expected permit loss rate <{0}>'
> + msg = ('expected permit loss rate <{0}> '
> 'not between rate {1} and rate {2}').format(
> permit_loss_rate, max_rate, min_rate)
> self.logger.error(msg)
> self.logger.info(pformat(loss_rate_table))
> + ret_value = 0, result[0][1], result[0][2]
> else:
> self.logger.debug(pformat(loss_rate_table))
> + ret_value = rate, hit_result[0][1], hit_result[0][2]
> self.logger.info("zero loss rate is %f" % rate)
>
> - return hit_result
> + return ret_value
>
> def measure(self, stream_ids, traffic_opt):
> '''
> --
> 2.21.0
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-01-03 3:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-02 8:20 [dts] [PATCH V1 0/1] framework/pktgen_base: fix rfc2544 dichotomy warm up and return value fix rfc2544 dichotomy warm up and return value yufengmx
2020-01-02 8:20 ` [dts] [PATCH V1 1/1] framework/pktgen_base: fix rfc2544 dichotomy warm up and yufengmx
2020-01-03 3:04 ` Tu, Lijuan
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).