test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH V1 0/1] dts/pktgen: fix rfc2544 rate percent bug
@ 2019-09-26  7:23 yufengmx
  2019-09-26  7:23 ` [dts] [PATCH V1 1/1] " yufengmx
  0 siblings, 1 reply; 4+ messages in thread
From: yufengmx @ 2019-09-26  7:23 UTC (permalink / raw)
  To: dts, yinan.wang, lihongx.ma; +Cc: zhaoyan.chen, yufengmx

 When do rfc2544, streams rate percent should be set a new rate percent and 
 stream attached on port should be cleared. 
 

yufengmx (1):
  dts/pktgen: fix rfc2544 rate percent bug

 framework/pktgen_base.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

-- 
2.21.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [dts] [PATCH V1 1/1] dts/pktgen: fix rfc2544 rate percent bug
  2019-09-26  7:23 [dts] [PATCH V1 0/1] dts/pktgen: fix rfc2544 rate percent bug yufengmx
@ 2019-09-26  7:23 ` yufengmx
  2019-09-26  7:25   ` Ma, LihongX
  2019-10-12  5:50   ` Tu, Lijuan
  0 siblings, 2 replies; 4+ messages in thread
From: yufengmx @ 2019-09-26  7:23 UTC (permalink / raw)
  To: dts, yinan.wang, lihongx.ma; +Cc: zhaoyan.chen, yufengmx


When do rfc2544, streams rate percent should be set a new rate percent and
stream attached on port should be cleared.

Signed-off-by: yufengmx <yufengx.mo@intel.com>
---
 framework/pktgen_base.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/framework/pktgen_base.py b/framework/pktgen_base.py
index cd541b0..7855f6f 100644
--- a/framework/pktgen_base.py
+++ b/framework/pktgen_base.py
@@ -145,14 +145,14 @@ class PacketGenerator(object):
         if not self.__streams:
             return
         for stream in self.__streams:
-            stream['rate'] = rate_percent
+            stream['options']['stream_config']['rate'] = rate_percent
 
     def _set_stream_pps(self, pps):
         ''' set all streams' pps '''
         if not self.__streams:
             return
         for stream in self.__streams:
-            stream['pps'] = pps
+            stream['options']['stream_config']['pps'] = pps
 
     def reset_streams(self):
         self.__streams = []
@@ -265,12 +265,15 @@ class PacketGenerator(object):
             tx_num, rx_num = result.values()[0][1:]
             return rate_percent, tx_num, rx_num
         _options = deepcopy(options)
+        if 'rate' in _options:
+            _options.pop('rate')
         while not status and rate_percent > 0:
             rate_percent = rate_percent - rate_step
             if rate_percent <= 0:
                 msg = "rfc2544 run under zero rate"
                 self.logger.warning(msg)
                 break
+            self._clear_streams()
             # set stream rate percent to custom value
             self._set_stream_rate_percent(rate_percent)
             # run loss rate testing
-- 
2.21.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dts] [PATCH V1 1/1] dts/pktgen: fix rfc2544 rate percent bug
  2019-09-26  7:23 ` [dts] [PATCH V1 1/1] " yufengmx
@ 2019-09-26  7:25   ` Ma, LihongX
  2019-10-12  5:50   ` Tu, Lijuan
  1 sibling, 0 replies; 4+ messages in thread
From: Ma, LihongX @ 2019-09-26  7:25 UTC (permalink / raw)
  To: Mo, YufengX, dts, Wang, Yinan; +Cc: Chen, Zhaoyan

Tested-by: lihong<lihongx.ma@intel.com>

-----Original Message-----
From: Mo, YufengX 
Sent: Thursday, September 26, 2019 3:23 PM
To: dts@dpdk.org; Wang, Yinan <yinan.wang@intel.com>; Ma, LihongX <lihongx.ma@intel.com>
Cc: Chen, Zhaoyan <zhaoyan.chen@intel.com>; Mo, YufengX <yufengx.mo@intel.com>
Subject: [dts][PATCH V1 1/1] dts/pktgen: fix rfc2544 rate percent bug


When do rfc2544, streams rate percent should be set a new rate percent and stream attached on port should be cleared.

Signed-off-by: yufengmx <yufengx.mo@intel.com>
---
 framework/pktgen_base.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/framework/pktgen_base.py b/framework/pktgen_base.py index cd541b0..7855f6f 100644
--- a/framework/pktgen_base.py
+++ b/framework/pktgen_base.py
@@ -145,14 +145,14 @@ class PacketGenerator(object):
         if not self.__streams:
             return
         for stream in self.__streams:
-            stream['rate'] = rate_percent
+            stream['options']['stream_config']['rate'] = rate_percent
 
     def _set_stream_pps(self, pps):
         ''' set all streams' pps '''
         if not self.__streams:
             return
         for stream in self.__streams:
-            stream['pps'] = pps
+            stream['options']['stream_config']['pps'] = pps
 
     def reset_streams(self):
         self.__streams = []
@@ -265,12 +265,15 @@ class PacketGenerator(object):
             tx_num, rx_num = result.values()[0][1:]
             return rate_percent, tx_num, rx_num
         _options = deepcopy(options)
+        if 'rate' in _options:
+            _options.pop('rate')
         while not status and rate_percent > 0:
             rate_percent = rate_percent - rate_step
             if rate_percent <= 0:
                 msg = "rfc2544 run under zero rate"
                 self.logger.warning(msg)
                 break
+            self._clear_streams()
             # set stream rate percent to custom value
             self._set_stream_rate_percent(rate_percent)
             # run loss rate testing
--
2.21.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dts] [PATCH V1 1/1] dts/pktgen: fix rfc2544 rate percent bug
  2019-09-26  7:23 ` [dts] [PATCH V1 1/1] " yufengmx
  2019-09-26  7:25   ` Ma, LihongX
@ 2019-10-12  5:50   ` Tu, Lijuan
  1 sibling, 0 replies; 4+ messages in thread
From: Tu, Lijuan @ 2019-10-12  5:50 UTC (permalink / raw)
  To: Mo, YufengX, dts, Wang, Yinan, Ma, LihongX; +Cc: Chen, Zhaoyan, Mo, YufengX

Applied, thanks

> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of yufengmx
> Sent: Thursday, September 26, 2019 3:23 PM
> To: dts@dpdk.org; Wang, Yinan <yinan.wang@intel.com>; Ma, LihongX
> <lihongx.ma@intel.com>
> Cc: Chen, Zhaoyan <zhaoyan.chen@intel.com>; Mo, YufengX
> <yufengx.mo@intel.com>
> Subject: [dts] [PATCH V1 1/1] dts/pktgen: fix rfc2544 rate percent bug
> 
> 
> When do rfc2544, streams rate percent should be set a new rate percent and
> stream attached on port should be cleared.
> 
> Signed-off-by: yufengmx <yufengx.mo@intel.com>
> ---
>  framework/pktgen_base.py | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/framework/pktgen_base.py b/framework/pktgen_base.py index
> cd541b0..7855f6f 100644
> --- a/framework/pktgen_base.py
> +++ b/framework/pktgen_base.py
> @@ -145,14 +145,14 @@ class PacketGenerator(object):
>          if not self.__streams:
>              return
>          for stream in self.__streams:
> -            stream['rate'] = rate_percent
> +            stream['options']['stream_config']['rate'] = rate_percent
> 
>      def _set_stream_pps(self, pps):
>          ''' set all streams' pps '''
>          if not self.__streams:
>              return
>          for stream in self.__streams:
> -            stream['pps'] = pps
> +            stream['options']['stream_config']['pps'] = pps
> 
>      def reset_streams(self):
>          self.__streams = []
> @@ -265,12 +265,15 @@ class PacketGenerator(object):
>              tx_num, rx_num = result.values()[0][1:]
>              return rate_percent, tx_num, rx_num
>          _options = deepcopy(options)
> +        if 'rate' in _options:
> +            _options.pop('rate')
>          while not status and rate_percent > 0:
>              rate_percent = rate_percent - rate_step
>              if rate_percent <= 0:
>                  msg = "rfc2544 run under zero rate"
>                  self.logger.warning(msg)
>                  break
> +            self._clear_streams()
>              # set stream rate percent to custom value
>              self._set_stream_rate_percent(rate_percent)
>              # run loss rate testing
> --
> 2.21.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-10-12  5:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-26  7:23 [dts] [PATCH V1 0/1] dts/pktgen: fix rfc2544 rate percent bug yufengmx
2019-09-26  7:23 ` [dts] [PATCH V1 1/1] " yufengmx
2019-09-26  7:25   ` Ma, LihongX
2019-10-12  5:50   ` 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).