test suite reviews and discussions
 help / color / Atom feed
* [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, back to index

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

test suite reviews and discussions

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/dts/0 dts/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dts dts/ http://inbox.dpdk.org/dts \
		dts@dpdk.org
	public-inbox-index dts


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dts


AGPL code for this site: git clone https://public-inbox.org/ public-inbox