From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 8F7C18E66 for ; Fri, 11 Dec 2015 01:58:40 +0100 (CET) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP; 10 Dec 2015 16:58:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,410,1444719600"; d="scan'208";a="11269840" Received: from stv-crb-56.sh.intel.com (HELO [10.239.128.116]) ([10.239.128.116]) by fmsmga004.fm.intel.com with ESMTP; 10 Dec 2015 16:58:38 -0800 Message-ID: <566A1FA6.4040903@intel.com> Date: Fri, 11 Dec 2015 08:58:14 +0800 From: "Liu, Yong" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Ding Heng , dts@dpdk.org References: <1449727815-22305-1-git-send-email-hengx.ding@intel.com> In-Reply-To: <1449727815-22305-1-git-send-email-hengx.ding@intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dts] [PATCH] framework: enable RFC2544 support 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: , X-List-Received-Date: Fri, 11 Dec 2015 00:58:41 -0000 Thanks Heng, some comments following. On 12/10/2015 02:10 PM, Ding Heng wrote: > Enable RFC2544 support for dts framework, add "delay" parameter for some of the > functions in file etgen.py and tester.py to make sure that test cases could > control the time to run. > > Signed-off-by: Ding Heng > > diff --git a/framework/etgen.py b/framework/etgen.py > index 508439b..37c4ff3 100644 > --- a/framework/etgen.py > +++ b/framework/etgen.py > @@ -476,18 +476,18 @@ class IxiaPacketGenerator(SSHConnection): > > return {'card': int(m.group(1)), 'port': int(m.group(2))} > > - def loss(self, portList, ratePercent): > + def loss(self, portList, ratePercent, delay=5): > """ > Run loss performance test and return loss rate. > """ > rxPortlist, txPortlist = self._configure_everything(portList, ratePercent) > - return self.get_loss_packet_rate(rxPortlist, txPortlist) > + return self.get_loss_packet_rate(rxPortlist, txPortlist, delay) > > - def get_loss_packet_rate(self, rxPortlist, txPortlist): > + def get_loss_packet_rate(self, rxPortlist, txPortlist, delay=5): > """ > Get RX/TX packet statistics and calculate loss rate. > """ > - time.sleep(3) > + time.sleep(delay) > > self.send_expect("ixStopTransmit portList", "%", 10) > time.sleep(2) > @@ -507,7 +507,7 @@ class IxiaPacketGenerator(SSHConnection): > revNumber += self.get_frames_received() > self.logger.info("rev :%f" % revNumber) > > - return float(sendNumber - revNumber) / sendNumber > + return float(sendNumber - revNumber) / sendNumber, sendNumber, revNumber > Need confirm that changed the return value will not cause existed case failure. > def latency(self, portList, ratePercent, delay=5): > """ > @@ -801,7 +801,10 @@ class IxiaPacketGenerator(SSHConnection): > Returns the number of packets captured by IXIA on a previously set > port. Call self.stat_get_stat_all_stats(port) before. > """ > - return self._stat_cget_value('framesReceived') > + if self._stat_cget_value('framesReceived') !=0: > + return self._stat_cget_value('framesReceived') > + else: Need one line comment for this judgment. > + return self._stat_cget_value('oversize') > > def get_flow_control_frames(self): > """ > diff --git a/framework/tester.py b/framework/tester.py > index b102065..9446854 100644 > --- a/framework/tester.py > +++ b/framework/tester.py > @@ -413,8 +413,33 @@ class Tester(Crb): > self.logger.warning("exception by mixed port types") > return None > return self.packet_gen.throughput(portList, rate_percent) Need black line between functions. > + def run_rfc2544(self, portlist, delay=120): > + """ > + zero_rate: dpdk will not lost packet in this line rate. > + loss_rate: dpdk will loss packet in this line rate. > + test_rate: the line rate we are going to test. > + """ > + zero_rate = 0.0 > + loss_rate = 100.0 > + test_rate = 100.0 > + > + while (loss_rate - zero_rate) > 0.002: > + self.logger.info("test rate: %f " % test_rate) > + if test_rate == 100: > + lost, tx_num, rx_num = self.traffic_generator_loss(portlist, test_rate, delay) > + else: > + lost, _, _ = self.traffic_generator_loss(portlist, test_rate, delay) > + if lost != 0: > + loss_rate = test_rate > + test_rate = (test_rate + zero_rate)/2 > + else: > + zero_rate = test_rate > + test_rate = (test_rate + loss_rate)/2 > + > + self.logger.info("zero loss rate is %s" % test_rate) > + return test_rate, tx_num, rx_num > > - def traffic_generator_loss(self, portList, ratePercent): > + def traffic_generator_loss(self, portList, ratePercent, delay=60): > """ > Run loss performance test on specified ports. > """ > @@ -423,7 +448,7 @@ class Tester(Crb): > elif not self.check_port_list(portList): > self.logger.warning("exception by mixed port types") > return None > - return self.packet_gen.loss(portList, ratePercent) > + return self.packet_gen.loss(portList, ratePercenti, delay) > > def traffic_generator_latency(self, portList, ratePercent=100, delay=5): > """