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 3D00AA00E6 for ; Tue, 6 Aug 2019 08:13:41 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 33C251B9A5; Tue, 6 Aug 2019 08:13:41 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id CF70C1B974 for ; Tue, 6 Aug 2019 08:13:39 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Aug 2019 23:13:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,352,1559545200"; d="scan'208";a="198212245" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga004.fm.intel.com with ESMTP; 05 Aug 2019 23:13:39 -0700 Received: from fmsmsx158.amr.corp.intel.com (10.18.116.75) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 5 Aug 2019 23:13:39 -0700 Received: from shsmsx154.ccr.corp.intel.com (10.239.6.54) by fmsmsx158.amr.corp.intel.com (10.18.116.75) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 5 Aug 2019 23:13:38 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.112]) by SHSMSX154.ccr.corp.intel.com ([169.254.7.249]) with mapi id 14.03.0439.000; Tue, 6 Aug 2019 14:13:36 +0800 From: "Chen, Zhaoyan" To: "Mo, YufengX" , "dts@dpdk.org" CC: "Mo, YufengX" , "Chen, Zhaoyan" Thread-Topic: [dts] [PATCH V2 2/2] [next]framework/pktgen_trex: convert core mask setting to Thread-Index: AQHVTBy/BE95dxcUQ0mfNiDQxtm9cKbto+vQ Date: Tue, 6 Aug 2019 06:13:36 +0000 Message-ID: <9DEEADBC57E43F4DA73B571777FECECA41D770E7@SHSMSX104.ccr.corp.intel.com> References: <1565071409-215899-1-git-send-email-yufengx.mo@intel.com> <1565071409-215899-3-git-send-email-yufengx.mo@intel.com> In-Reply-To: <1565071409-215899-3-git-send-email-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.0.600.7 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 V2 2/2] [next]framework/pktgen_trex: convert core mask setting to 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" Acked-by: Zhaoyan Chen Regards, Zhaoyan Chen > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of yufengmx > Sent: Tuesday, August 6, 2019 2:03 PM > To: dts@dpdk.org > Cc: Mo, YufengX > Subject: [dts] [PATCH V2 2/2] [next]framework/pktgen_trex: convert core m= ask > setting to >=20 > list format >=20 > *. convert core mask setting to list format. > *. create _get_traffic_option to convert pktgen.cfg setting value to traf= fic start > options. >=20 > Signed-off-by: yufengmx > --- > framework/pktgen_trex.py | 26 +++++++++++++++++++++----- > 1 file changed, 21 insertions(+), 5 deletions(-) >=20 > diff --git a/framework/pktgen_trex.py b/framework/pktgen_trex.py index > 159750e..c05741b 100644 > --- a/framework/pktgen_trex.py > +++ b/framework/pktgen_trex.py > @@ -451,6 +451,23 @@ class TrexPacketGenerator(PacketGenerator): > from trex_stl_lib.api import STLClient > # set trex class > self.STLClient =3D STLClient > + # get configuration from pktgen config file > + self._get_traffic_option() > + > + def _get_traffic_option(self): > + ''' get configuration from pktgen config file ''' > + # set trex coremask > + _core_mask =3D self.conf.get("core_mask") > + if _core_mask: > + if '0x' in _core_mask: > + self.core_mask =3D \ > + [int(item[2:], 16) for item in _core_mask.split(',')= ] > + else: > + self.core_mask =3D self.STLClient.CORE_MASK_PIN \ > + if _core_mask.upper() =3D=3D 'CORE_MASK_PIN' else \ > + None > + else: > + self.core_mask =3D None >=20 > def _connect(self): > self._conn =3D self.STLClient(server=3Dself.conf["server"]) > @@ -792,10 +809,9 @@ class TrexPacketGenerator(PacketGenerator): > warmup =3D int(self.conf["warmup"]) if self.conf.has_key("warmup= ") \ > else 25 > # set trex coremask > - wait_interval, core_mask =3D ( > - warmup+30, int(self.conf["core_mask"], 16)) \ > - if self.conf.has_key("core_mask") \ > - else (warmup+5, 0x3) > + wait_interval =3D warmup+30 \ > + if self.conf.has_key("core_mask") \ > + else warmup+5 >=20 > try: > ########################################### > @@ -806,7 +822,7 @@ class TrexPacketGenerator(PacketGenerator): > 'ports': self._traffic_ports, > 'mult': rate_percent, > 'duration': duration, > - 'core_mask':core_mask, > + 'core_mask': self.core_mask, > 'force': True,} > self.logger.info("begin traffic ......") > self._conn.start(**run_opt) > -- > 1.9.3