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 402D7A0583; Fri, 20 Mar 2020 09:04:33 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 321DD1C023; Fri, 20 Mar 2020 09:04:33 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id D9593F94 for ; Fri, 20 Mar 2020 09:04:31 +0100 (CET) IronPort-SDR: eFyZGuEW1DtyORWs7qzOl9Z3JNAMg0jr8TsTFpjeQU8cPt4WXzOYvO9q6HsIJAh7b2QcnnvF0H 0w3xwZbugaPA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Mar 2020 01:04:30 -0700 IronPort-SDR: sxvNOd/DjCWHTkBDJmtM/DEapXw76cru6FPZ3CNSrkUmx54CV0uqvk+r7TrrPzKcLQQK1gskck NjbjKLYiTKnA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,283,1580803200"; d="scan'208";a="245420124" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga003.jf.intel.com with ESMTP; 20 Mar 2020 01:04:28 -0700 Received: from fmsmsx601.amr.corp.intel.com (10.18.126.81) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 20 Mar 2020 01:04:13 -0700 Received: from fmsmsx601.amr.corp.intel.com (10.18.126.81) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 20 Mar 2020 01:04:13 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Fri, 20 Mar 2020 01:04:12 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.43]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.137]) with mapi id 14.03.0439.000; Fri, 20 Mar 2020 16:04:10 +0800 From: "Tu, Lijuan" To: "Mo, YufengX" , "dts@dpdk.org" , "Han, YingyaX" Thread-Topic: [dts][PATCH V1 1/1] l3fwd: update display format and json content Thread-Index: AQHV+RC46rUk5JfmHkKfHMeq8I46wKhRKhvQ Date: Fri, 20 Mar 2020 08:04:09 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BBEFA47@SHSMSX101.ccr.corp.intel.com> References: <20200313082723.24945-1-yufengx.mo@intel.com> <20200313082723.24945-2-yufengx.mo@intel.com> In-Reply-To: <20200313082723.24945-2-yufengx.mo@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action 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] l3fwd: update display format and json content 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" Applied, thanks > -----Original Message----- > From: Mo, YufengX > Sent: Friday, March 13, 2020 4:27 PM > To: dts@dpdk.org; Tu, Lijuan ; Han, YingyaX > > Cc: Mo, YufengX > Subject: [dts][PATCH V1 1/1] l3fwd: update display format and json conten= t >=20 >=20 > #. update rfc2544 display format. > #. add rfc2544 actual line rate return value. > #. update json content. >=20 > Signed-off-by: yufengmx > --- > tests/l3fwd_base.py | 54 +++++++++++++++++++++++++++------------------ > 1 file changed, 32 insertions(+), 22 deletions(-) >=20 > diff --git a/tests/l3fwd_base.py b/tests/l3fwd_base.py index > 431c28e..ca5a9f8 100644 > --- a/tests/l3fwd_base.py > +++ b/tests/l3fwd_base.py > @@ -390,6 +390,7 @@ class L3fwdBase(object): > 'rate': max_rate, > 'traffic_opt': { > 'method': 'rfc2544_dichotomy', > + 'throughput_stat_flag': True, > 'max_rate': max_rate, > 'min_rate': min_rate, > 'accuracy': accuracy, > @@ -399,7 +400,7 @@ class L3fwdBase(object): > result =3D self.__send_packets_by_pktgen(option) > # statistics result > if result: > - _, tx_pkts, rx_pkts =3D result > + _, tx_pkts, rx_pkts, _ =3D result > self.verify(tx_pkts > 0, "No traffic detected") > self.verify(rx_pkts > 0, "No packet transfer detected") > else: > @@ -519,11 +520,11 @@ class L3fwdBase(object): > return {"unit": "Mpps", "name": "Throughput", > "value": value[0], "delta": value[1]} >=20 > - def __json_line_rate(self, value): > + def __json_rate_percent(self, value): > return {"unit": "", "name": "% of Line Rate", "value": value} >=20 > def __json_port_config(self, value): > - return {"unit": "", "name": "Number of Cores/Queues/Threads", > + return {"unit": "", "name": "Number of Cores/Threads/Queues", > "value": value} >=20 > def __json_frame_size(self, value): > @@ -531,38 +532,36 @@ class L3fwdBase(object): > "value": value} >=20 > def __save_throughput_result(self, case_name, result): > - suite_results =3D {} > - case_result =3D suite_results[case_name] =3D [] > + case_result =3D [] > for sub_result in result: > - status, throughput, line_rate, port_config, frame_size =3D s= ub_result > + status, throughput, rate_percent, port_config, frame_size = =3D > + sub_result > one_result =3D { > "status": status, > "performance": [ > self.__json_throughput(throughput), > - self.__json_line_rate(line_rate), ], > + self.__json_rate_percent(rate_percent), ], > "parameters": [ > self.__json_port_config(port_config), > self.__json_frame_size(frame_size), ]} > case_result.append(one_result) > - self.logger.debug(pformat(suite_results)) > - self.__json_results[case_name] =3D suite_results > + self.logger.debug(pformat(case_result)) > + self.__json_results[case_name] =3D case_result >=20 > def __save_rfc2544_result(self, case_name, result): > - suite_results =3D {} > - case_result =3D suite_results[case_name] =3D [] > + case_result =3D [] > for sub_result in result: > - status, rfc2544, line_rate, port_config, frame_size =3D sub_= result > + status, rfc2544, rate_percent, port_config, frame_size =3D > + sub_result > one_result =3D { > "status": status, > "performance": [ > self.__json_rfc2544(rfc2544), > - self.__json_line_rate(line_rate), ], > + self.__json_rate_percent(rate_percent), ], > "parameters": [ > self.__json_port_config(port_config), > self.__json_frame_size(frame_size), ]} > case_result.append(one_result) > - self.logger.debug(pformat(suite_results)) > - self.__json_results[case_name] =3D suite_results > + self.logger.debug(pformat(case_result)) > + self.__json_results[case_name] =3D case_result >=20 > def l3fwd_save_results(self, json_file=3DNone): > if not self.__json_results: > @@ -627,7 +626,7 @@ class L3fwdBase(object): > 'ignore check').format(config, frame_size) > self.logger.warning(msg) > status =3D 'pass' > - js_results.append([status, result, linerate, config, frame_s= ize]) > + js_results.append([status, [pps, linerate - pps], > + percentage, config, frame_size]) > # save data with json format > self.__save_throughput_result(self.__cur_case, js_results) > # display result table > @@ -656,18 +655,23 @@ class L3fwdBase(object): > self.__test_content.get('expected_rfc2544', {}).get( > self.__cur_case, {}).get(self.__nic_name, {}).get( > config, {}).get(str(frame_size), {}) > - zero_loss_rate, tx_pkts, rx_pkts =3D result if result else [= None] * 3 > + zero_loss_rate, tx_pkts, rx_pkts, pps =3D result if result e= lse [None] * 3 > + mpps =3D pps / 1000000.0 > # expected line rate > _frame_size =3D self.__get_frame_size(stm_name, frame_size) > linerate =3D self.wirespeed( > self.nic, _frame_size, len(self.__valports)) > - throughput =3D linerate * zero_loss_rate / 100 > + actual_rate_percent =3D mpps * 100 / linerate > # append data for display > pdr =3D expected_cfg.get('traffic_opt', {}).get('pdr') > values.append([ > config, frame_size, mode.upper(), > - str(throughput), > + str(linerate), > + str(mpps), > str(zero_loss_rate), > + str(actual_rate_percent), > + str(tx_pkts), > + str(rx_pkts), > ]) > # check data with expected values > expected_rate =3D float(expected_cfg.get('rate') or 100.0) @= @ -675,7 > +679,9 @@ class L3fwdBase(object): > if zero_loss_rate and zero_loss_rate > expected_rate \ > else 'failed' > js_results.append( > - [status, [zero_loss_rate, 0], linerate, config, frame_si= ze]) > + [status, > + [mpps, linerate - mpps], actual_rate_percent, > + config, frame_size]) > # save data in json file > self.__save_rfc2544_result(self.__cur_case, js_results) > # display result table > @@ -683,8 +689,12 @@ class L3fwdBase(object): > 'Total Cores/Threads/Queues per port', > "Frame Size", > "Mode", > - 'Theory line rate (Mpps) '.format(mode.upper()), > - '{} Mode Zero Loss Rate % '.format(mode.upper()), > + 'Expected Throughput (Mpps)', > + 'Actual line rate (Mpps) ', > + '{} Mode config line rate % '.format(mode.upper()), > + '{} Mode actual line rate % '.format(mode.upper()), > + 'tx_pkts', > + 'rx_pkts', > ] >=20 > _data =3D { > -- > 2.21.0