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 00C07A04F0; Thu, 2 Jan 2020 09:17:47 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4165B1BFEA; Thu, 2 Jan 2020 09:17:46 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id D077B1BFE1 for ; Thu, 2 Jan 2020 09:17:44 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Jan 2020 00:17:43 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,386,1571727600"; d="scan'208";a="252181933" Received: from dpdk-moyufen06.sh.intel.com ([10.67.116.222]) by fmsmga002.fm.intel.com with ESMTP; 02 Jan 2020 00:17:42 -0800 From: yufengmx To: dts@dpdk.org, yinan.wang@intel.com, lihongx.ma@intel.com, lijuan.tu@intel.com Cc: yufengmx Date: Thu, 2 Jan 2020 16:20:40 +0800 Message-Id: <20200102082040.16175-2-yufengx.mo@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200102082040.16175-1-yufengx.mo@intel.com> References: <20200102082040.16175-1-yufengx.mo@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dts] [PATCH V1 1/1] framework/pktgen_base: fix rfc2544 dichotomy warm up and 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" return value fix rfc2544 dichotomy warm up and return value. Signed-off-by: yufengmx --- 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