From: "Tu, Lijuan" <lijuan.tu@intel.com>
To: "Mo, YufengX" <yufengx.mo@intel.com>,
"dts@dpdk.org" <dts@dpdk.org>,
"Wang, Yinan" <yinan.wang@intel.com>,
"Ma, LihongX" <lihongx.ma@intel.com>
Cc: "Chen, Zhaoyan" <zhaoyan.chen@intel.com>,
"Mo, YufengX" <yufengx.mo@intel.com>
Subject: Re: [dts] [PATCH V1 1/1] dts/pktgen: fix rfc2544 rate percent bug
Date: Sat, 12 Oct 2019 05:50:28 +0000 [thread overview]
Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BB3EB33@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <20190926072317.19170-2-yufengx.mo@intel.com>
Applied, thanks
> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of yufengmx
> Sent: Thursday, September 26, 2019 3:23 PM
> To: dts@dpdk.org; Wang, Yinan <yinan.wang@intel.com>; Ma, LihongX
> <lihongx.ma@intel.com>
> Cc: Chen, Zhaoyan <zhaoyan.chen@intel.com>; Mo, YufengX
> <yufengx.mo@intel.com>
> 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 <yufengx.mo@intel.com>
> ---
> 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
> cd541b0..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'] = rate_percent
> + stream['options']['stream_config']['rate'] = rate_percent
>
> def _set_stream_pps(self, pps):
> ''' set all streams' pps '''
> if not self.__streams:
> return
> for stream in self.__streams:
> - stream['pps'] = pps
> + stream['options']['stream_config']['pps'] = pps
>
> def reset_streams(self):
> self.__streams = []
> @@ -265,12 +265,15 @@ class PacketGenerator(object):
> tx_num, rx_num = result.values()[0][1:]
> return rate_percent, tx_num, rx_num
> _options = deepcopy(options)
> + if 'rate' in _options:
> + _options.pop('rate')
> while not status and rate_percent > 0:
> rate_percent = rate_percent - rate_step
> if rate_percent <= 0:
> msg = "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
prev parent reply other threads:[~2019-10-12 5:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-26 7:23 [dts] [PATCH V1 0/1] " yufengmx
2019-09-26 7:23 ` [dts] [PATCH V1 1/1] " yufengmx
2019-09-26 7:25 ` Ma, LihongX
2019-10-12 5:50 ` Tu, Lijuan [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8CE3E05A3F976642AAB0F4675D0AD20E0BB3EB33@SHSMSX101.ccr.corp.intel.com \
--to=lijuan.tu@intel.com \
--cc=dts@dpdk.org \
--cc=lihongx.ma@intel.com \
--cc=yinan.wang@intel.com \
--cc=yufengx.mo@intel.com \
--cc=zhaoyan.chen@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).