test suite reviews and discussions
 help / color / mirror / Atom feed
From: yufengmx <yufengx.mo@intel.com>
To: dts@dpdk.org, yinan.wang@intel.com, lihongx.ma@intel.com
Cc: zhaoyan.chen@intel.com, yufengmx <yufengx.mo@intel.com>
Subject: [dts] [PATCH V1 1/1] dts/pktgen: fix rfc2544 rate percent bug
Date: Thu, 26 Sep 2019 15:23:17 +0800	[thread overview]
Message-ID: <20190926072317.19170-2-yufengx.mo@intel.com> (raw)
In-Reply-To: <20190926072317.19170-1-yufengx.mo@intel.com>


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


  reply	other threads:[~2019-09-26  7:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-26  7:23 [dts] [PATCH V1 0/1] " yufengmx
2019-09-26  7:23 ` yufengmx [this message]
2019-09-26  7:25   ` [dts] [PATCH V1 1/1] " Ma, LihongX
2019-10-12  5:50   ` Tu, Lijuan

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=20190926072317.19170-2-yufengx.mo@intel.com \
    --to=yufengx.mo@intel.com \
    --cc=dts@dpdk.org \
    --cc=lihongx.ma@intel.com \
    --cc=yinan.wang@intel.com \
    --cc=zhaoyan.chen@intel.com \
    /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).