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: yufengmx <yufengx.mo@intel.com>
Subject: [dts] [PATCH V3 4/5] framework/pktgen_ixia: add new features
Date: Fri, 29 Nov 2019 17:03:14 +0800	[thread overview]
Message-ID: <20191129090315.60124-5-yufengx.mo@intel.com> (raw)
In-Reply-To: <20191129090315.60124-1-yufengx.mo@intel.com>


*. remove duration option used in ixia module, move duration option in
   testing scenario methods(latency/loss/throughput) in pktgen_base module.
*. remove un-used parameters in _start_transmission method.
*. add a warning message for rate percent input parameter.

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

diff --git a/framework/pktgen_ixia.py b/framework/pktgen_ixia.py
index 69f858e..14b5d5b 100644
--- a/framework/pktgen_ixia.py
+++ b/framework/pktgen_ixia.py
@@ -1247,7 +1247,6 @@ class Ixia(SSHConnection):
         ''' start ixia ports '''
         self.configure_transmission(run_opt)
         self.start_transmission()
-        time.sleep(run_opt.get('duration') or 5)
 
     def remove_all_streams(self):
         ''' delete all streams on all ixia ports '''
@@ -1652,28 +1651,13 @@ class IxiaPacketGenerator(PacketGenerator):
         self._preset_ixia_port()
 
     def _start_transmission(self, stream_ids, options={}):
-        '''
-        :param sample_delay:
-        After traffic start ``sample_delay`` seconds, start get runtime statistics
-        '''
         # get rate percentage
-        rate_percent = options.get('rate') or '100'
-        # get duration
-        duration = options.get("duration") or 5
-        duration = int(duration) if isinstance(duration, (str, unicode)) \
-                                      else duration
-        # get sample interval
-        _sample_delay = options.get("sample_delay") or duration/2
-        sample_delay = int(_sample_delay) \
-                            if isinstance(_sample_delay, (str, unicode)) \
-                            else _sample_delay
-        # get configuration from pktgen config file
-        warmup = int(self.conf["warmup"]) if self.conf.has_key("warmup") \
-                                          else 25
-        wait_interval, core_mask = (warmup+30, self.conf["core_mask"]) \
-                            if self.conf.has_key("core_mask") \
-                            else (warmup+5, None)
-        #-------------------------------------------------------------------
+        rate_percent = options.get('rate')
+        if rate_percent:
+            msg = ('{0} only support set rate percent in streams, '
+                   'current run traffic with stream rate percent').format(
+                self.pktgen_type)
+            self.logger.warning(msg)
         # run ixia server
         try:
             ###########################################
@@ -1682,8 +1666,6 @@ class IxiaPacketGenerator(PacketGenerator):
             run_opt = {
                 'ports':    self._traffic_ports,
                 'mult':     rate_percent,
-                'duration': duration,
-                'core_mask':core_mask,
                 'force':    True,}
             self._conn.start(**run_opt)
         except Exception as e:
@@ -1693,6 +1675,7 @@ class IxiaPacketGenerator(PacketGenerator):
         # using ixia server command
         if self._traffic_ports:
             self._conn.stop_transmit()
+            self.logger.info("traffic completed. ")
 
     def _retrieve_port_statistic(self, stream_id, mode):
         ''' ixia traffic statistics '''
-- 
2.21.0


  parent reply	other threads:[~2019-11-29  9:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-29  9:03 [dts] [PATCH V3 0/5] dts/pktgen: " yufengmx
2019-11-29  9:03 ` [dts] [PATCH V3 1/5] conf/pktgen: remove un-used optons yufengmx
2020-01-02  3:29   ` Chen, Zhaoyan
2019-11-29  9:03 ` [dts] [PATCH V3 2/5] doc/dts_gsg/pktgen_prog_guide: update description yufengmx
2020-01-02  3:29   ` Chen, Zhaoyan
2019-11-29  9:03 ` [dts] [PATCH V3 3/5] framework/pktgen_base: add new features yufengmx
2020-01-02  3:29   ` Chen, Zhaoyan
2019-11-29  9:03 ` yufengmx [this message]
2019-11-29  9:03 ` [dts] [PATCH V3 5/5] framework/pktgen_trex: " yufengmx
2020-01-02  3:29   ` Chen, Zhaoyan
2020-01-02  3:28 ` [dts] [PATCH V3 0/5] dts/pktgen: " Chen, Zhaoyan
2020-01-02  5:04 ` 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=20191129090315.60124-5-yufengx.mo@intel.com \
    --to=yufengx.mo@intel.com \
    --cc=dts@dpdk.org \
    --cc=lihongx.ma@intel.com \
    --cc=yinan.wang@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).