From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 520AE23B for ; Wed, 20 Sep 2017 12:06:58 +0200 (CEST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Sep 2017 03:06:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,420,1500966000"; d="scan'208";a="314167350" Received: from dpdk-test47.sh.intel.com ([10.67.118.152]) by fmsmga004.fm.intel.com with ESMTP; 20 Sep 2017 03:06:57 -0700 From: wang fei To: dts@dpdk.org Cc: wang fei Date: Wed, 20 Sep 2017 20:39:25 +0800 Message-Id: <1505911165-51024-1-git-send-email-feix.y.wang@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dts] [Patch V1] framework/etgen.py : add this function to support ixia send fixed number of packets during a certain period, this is not for common use, only will be used for test_suite nic_single_core_perf 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: Wed, 20 Sep 2017 10:06:59 -0000 Signed-off-by: wang fei --- framework/etgen.py | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/framework/etgen.py b/framework/etgen.py index b3a5931..7ef2598 100644 --- a/framework/etgen.py +++ b/framework/etgen.py @@ -868,3 +868,37 @@ class IxiaPacketGenerator(SSHConnection): retrieved capture buffer. Call packetGroupStats get before. """ return self._packetgroup_cget_value('averageLatency') + + def send_packets(self,portList,ratePercent,packetNum,delay=5,runTime=60): + """ + configure ixia to send fixed number of packets for each tx port + and returns the throughput for rx ports + note that this funcion is only set for test_suite nic_single_core_perf, + not for common use + """ + rxPortlist, txPortlist = self._configure_everything(portList, ratePercent) + time.sleep(delay) + self.send_expect("ixStopTransmit portList","%",5) + + self.send_expect("stream config -numFrames %s" % packetNum,"%",5) + self.send_expect("stream config -dma stopStream","%",5) + for txPort in txPortlist: + port = self.pci_to_port(self.tester.get_pci(txPort)) + self.send_expect("stream set %d %d %d 1" % (self.chasId, port['card'], port['port']),"%",5) + + self.send_expect("ixWritePortsToHardware portList","%",5) + self.send_expect("ixClearStats portList","%",5) + self.send_expect("ixStartTransmit portList","%",5) + time.sleep(runTime) + time.sleep(3) + + txPackets = 0 + rxPackets = 0 + for port in txPortlist: + self.stat_get_stat_all_stats(port) + txPackets += self.get_frames_sent() + rxPackets += self.get_frames_received() + self.logger.info("Transmitted packets :%s" % txPackets) + self.logger.info("Received packets :%s" % rxPackets) + + return txPackets,rxPackets \ No newline at end of file -- 2.7.4