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 6E74BA0613 for ; Thu, 26 Sep 2019 09:25:23 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4598B1BEAE; Thu, 26 Sep 2019 09:25:23 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id BAED01BEA4 for ; Thu, 26 Sep 2019 09:25:20 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Sep 2019 00:25:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,551,1559545200"; d="scan'208";a="203798483" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga001.fm.intel.com with ESMTP; 26 Sep 2019 00:25:19 -0700 Received: from fmsmsx606.amr.corp.intel.com (10.18.126.86) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 26 Sep 2019 00:25:19 -0700 Received: from fmsmsx606.amr.corp.intel.com (10.18.126.86) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 26 Sep 2019 00:25:19 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Thu, 26 Sep 2019 00:25:18 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.92]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.132]) with mapi id 14.03.0439.000; Thu, 26 Sep 2019 15:25:15 +0800 From: "Ma, LihongX" To: "Mo, YufengX" , "dts@dpdk.org" , "Wang, Yinan" CC: "Chen, Zhaoyan" Thread-Topic: [dts][PATCH V1 1/1] dts/pktgen: fix rfc2544 rate percent bug Thread-Index: AQHVdDsPXLCBAVFRIUeOrYDKAh8dg6c9jocg Date: Thu, 26 Sep 2019 07:25:14 +0000 Message-ID: References: <20190926072317.19170-1-yufengx.mo@intel.com> <20190926072317.19170-2-yufengx.mo@intel.com> In-Reply-To: <20190926072317.19170-2-yufengx.mo@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dts] [PATCH V1 1/1] dts/pktgen: fix rfc2544 rate percent bug 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" Tested-by: lihong -----Original Message----- From: Mo, YufengX=20 Sent: Thursday, September 26, 2019 3:23 PM To: dts@dpdk.org; Wang, Yinan ; Ma, LihongX Cc: Chen, Zhaoyan ; Mo, YufengX 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 --- 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 cd54= 1b0..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'] =3D rate_percent + stream['options']['stream_config']['rate'] =3D rate_percent =20 def _set_stream_pps(self, pps): ''' set all streams' pps ''' if not self.__streams: return for stream in self.__streams: - stream['pps'] =3D pps + stream['options']['stream_config']['pps'] =3D pps =20 def reset_streams(self): self.__streams =3D [] @@ -265,12 +265,15 @@ class PacketGenerator(object): tx_num, rx_num =3D result.values()[0][1:] return rate_percent, tx_num, rx_num _options =3D deepcopy(options) + if 'rate' in _options: + _options.pop('rate') while not status and rate_percent > 0: rate_percent =3D rate_percent - rate_step if rate_percent <=3D 0: msg =3D "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