From: wang fei <feix.y.wang@intel.com>
To: dts@dpdk.org
Cc: wang fei <feix.y.wang@intel.com>
Subject: [dts] [patch v2] framework/etgen.py : add in two functions which will be used for nic_single_core_perf test_suite, thest two function will work together to send fixed number of packets for ixia ports and return all received packets on total ixia rx ports
Date: Mon, 25 Sep 2017 20:33:52 +0800 [thread overview]
Message-ID: <1506342832-55784-1-git-send-email-feix.y.wang@intel.com> (raw)
Signed-off-by: wang fei <feix.y.wang@intel.com>
---
framework/etgen.py | 44 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 44 insertions(+)
diff --git a/framework/etgen.py b/framework/etgen.py
index b3a5931..85c9814 100644
--- a/framework/etgen.py
+++ b/framework/etgen.py
@@ -868,3 +868,47 @@ class IxiaPacketGenerator(SSHConnection):
retrieved capture buffer. Call packetGroupStats get before.
"""
return self._packetgroup_cget_value('averageLatency')
+
+ def _configure_everything2(self, port_list, rate_percent, latency=False):
+ """
+ Renew _configure_everyething() function,and pop configure_transmission() in the configuration sequence,
+ And do the traffic start action in later configuration in function send_packets()
+ """
+ rxPortlist, txPortlist = self.prepare_port_list(port_list, rate_percent, latency)
+ self.prepare_ixia_for_transmission(txPortlist, rxPortlist)
+ self.start_transmission()
+ self.clear_tcl_commands()
+ return rxPortlist, txPortlist
+
+ 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_everything2(portList, ratePercent)
+
+ 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(10)
+
+ rxPackets = 0
+ for port in txPortlist:
+ self.stat_get_stat_all_stats(port)
+ txPackets = self.get_frames_sent()
+ while txPackets != packetNum:
+ time.sleep(10)
+ self.stat_get_stat_all_stats(port)
+ txPackets = self.get_frames_sent()
+ rxPackets += self.get_frames_received()
+ self.logger.info("Received packets :%s" % rxPackets)
+
+ return rxPackets
--
2.7.4
reply other threads:[~2017-09-25 10:01 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1506342832-55784-1-git-send-email-feix.y.wang@intel.com \
--to=feix.y.wang@intel.com \
--cc=dts@dpdk.org \
/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).