From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7D8D4A04E0; Fri, 29 Nov 2019 10:02:00 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 746A737B4; Fri, 29 Nov 2019 10:02:00 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 038A02B88 for ; Fri, 29 Nov 2019 10:01:58 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Nov 2019 01:01:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,256,1571727600"; d="scan'208";a="384029996" Received: from dpdk-moyufen06.sh.intel.com ([10.67.116.222]) by orsmga005.jf.intel.com with ESMTP; 29 Nov 2019 01:01:24 -0800 From: yufengmx To: dts@dpdk.org, yinan.wang@intel.com, lihongx.ma@intel.com Cc: yufengmx Date: Fri, 29 Nov 2019 17:03:14 +0800 Message-Id: <20191129090315.60124-5-yufengx.mo@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191129090315.60124-1-yufengx.mo@intel.com> References: <20191129090315.60124-1-yufengx.mo@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dts] [PATCH V3 4/5] framework/pktgen_ixia: add new features X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Sender: "dts" *. 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 --- 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