test suite reviews and discussions
 help / color / mirror / Atom feed
From: Wenjie Li <wenjiex.a.li@intel.com>
To: dts@dpdk.org
Cc: "zhang,yan" <yanx.a.zhang@intel.com>
Subject: [dts] [PATCH V1] update TestSuite_vf_rss to reduce runtime
Date: Wed, 29 May 2019 17:00:36 +0800	[thread overview]
Message-ID: <1559120436-112959-1-git-send-email-wenjiex.a.li@intel.com> (raw)

From: "zhang,yan" <yanx.a.zhang@intel.com>

optimize function of send package with scapy

Signed-off-by: zhang,yan <yanx.a.zhang@intel.com>
---
 tests/TestSuite_vf_rss.py | 40 ++++++++++++++++++---------------------
 1 file changed, 18 insertions(+), 22 deletions(-)

diff --git a/tests/TestSuite_vf_rss.py b/tests/TestSuite_vf_rss.py
index 8b3d2db..3ad5517 100644
--- a/tests/TestSuite_vf_rss.py
+++ b/tests/TestSuite_vf_rss.py
@@ -67,75 +67,71 @@ class TestVfRss(TestCase):
                 packet = r'sendp([Ether(dst="%s", src="02:00:00:00:00:00")/IP(src="192.168.0.%d", dst="192.168.0.%d")], iface="%s")' % (
                     mac, i + 1, i + 2, itf)
                 self.tester.scapy_append(packet)
-                self.tester.scapy_execute()
-                time.sleep(.5)
+            self.tester.scapy_execute()
+            time.sleep(.5)
         elif tran_type == "ipv4-tcp":
             for i in range(16):
                 packet = r'sendp([Ether(dst="%s", src="02:00:00:00:00:00")/IP(src="192.168.0.%d", dst="192.168.0.%d")/TCP(sport=1024,dport=1024)], iface="%s")' % (
                     mac, i + 1, i + 2, itf)
                 self.tester.scapy_append(packet)
-                self.tester.scapy_execute()
-                time.sleep(.5)
+            self.tester.scapy_execute()
+            time.sleep(.5)
         elif tran_type == "ipv4-udp":
             for i in range(16):
                 packet = r'sendp([Ether(dst="%s", src="02:00:00:00:00:00")/IP(src="192.168.0.%d", dst="192.168.0.%d")/UDP(sport=1024,dport=1024)], iface="%s")' % (
                     mac, i + 1, i + 2, itf)
                 self.tester.scapy_append(packet)
-                self.tester.scapy_execute()
-                time.sleep(.5)
+            self.tester.scapy_execute()
+            time.sleep(.5)
         elif tran_type == "ipv4-sctp":
             for i in range(16):
                 packet = r'sendp([Ether(dst="%s")/IP(src="192.168.0.%d", dst="192.168.0.%d")/SCTP(sport=1024,dport=1025,tag=1)], iface="%s")' % (
                     mac, i + 1, i + 2, itf)
                 self.tester.scapy_append(packet)
-                self.tester.scapy_execute()
-                time.sleep(.5)
                 packet = r'sendp([Ether(dst="%s")/IP(src="192.168.0.%d", dst="192.168.0.%d")/SCTP(sport=1025,dport=1024,tag=1)], iface="%s")' % (
                     mac, i + 2, i + 1, itf)
                 self.tester.scapy_append(packet)
-                self.tester.scapy_execute()
-                time.sleep(.5)
+            self.tester.scapy_execute()
+            time.sleep(.5)
         elif tran_type == "l2_payload":
             for i in range(16):
                 packet = r'sendp([Ether(src="00:00:00:00:00:%02d",dst="%s")], iface="%s")' % (
                     i + 1, mac, itf)
                 self.tester.scapy_append(packet)
-                self.tester.scapy_execute()
-                time.sleep(.5)
+            self.tester.scapy_execute()
+            time.sleep(.5)
 
         elif tran_type == "ipv6-other":
             for i in range(16):
                 packet = r'sendp([Ether(dst="%s", src="02:00:00:00:00:00")/IPv6(src="3ffe:2501:200:1fff::%d", dst="3ffe:2501:200:3::%d")], iface="%s")' % (
                     mac, i + 1, i + 2, itf)
                 self.tester.scapy_append(packet)
-                self.tester.scapy_execute()
-                time.sleep(.5)
+            self.tester.scapy_execute()
+            time.sleep(.5)
         elif tran_type == "ipv6-tcp":
             for i in range(16):
                 packet = r'sendp([Ether(dst="%s", src="02:00:00:00:00:00")/IPv6(src="3ffe:2501:200:1fff::%d", dst="3ffe:2501:200:3::%d")/TCP(sport=1024,dport=1024)], iface="%s")' % (
                     mac, i + 1, i + 2, itf)
                 self.tester.scapy_append(packet)
-                self.tester.scapy_execute()
-                time.sleep(.5)
+            self.tester.scapy_execute()
+            time.sleep(.5)
         elif tran_type == "ipv6-udp":
             for i in range(16):
                 packet = r'sendp([Ether(dst="%s", src="02:00:00:00:00:00")/IPv6(src="3ffe:2501:200:1fff::%d", dst="3ffe:2501:200:3::%d")/UDP(sport=1024,dport=1024)], iface="%s")' % (
                     mac, i + 1, i + 2, itf)
                 self.tester.scapy_append(packet)
-                self.tester.scapy_execute()
-                time.sleep(.5)
+            self.tester.scapy_execute()
+            time.sleep(.5)
         elif tran_type == "ipv6-sctp":
             for i in range(16):
                 packet = r'sendp([Ether(dst="%s")/IPv6(src="3ffe:2501:200:1fff::%d", dst="3ffe:2501:200:3::%d", nh=132)/SCTP(sport=1024,dport=1025,tag=1)], iface="%s")' % (
                     mac, i + 1, i + 2, itf)
                 self.tester.scapy_append(packet)
-                self.tester.scapy_execute()
-                time.sleep(.5)
                 packet = r'sendp([Ether(dst="%s")/IPv6(src="3ffe:2501:200:1fff::%d", dst="3ffe:2501:200:3::%d", nh=132)/SCTP(sport=1025,dport=1024,tag=1)], iface="%s")' % (
                     mac, i + 2, i + 1, itf)
                 self.tester.scapy_append(packet)
-                self.tester.scapy_execute()
-                time.sleep(.5)
+            self.tester.scapy_execute()
+            time.sleep(.5)
 
         else:
             print "\ntran_type error!\n"
-- 
2.17.2


             reply	other threads:[~2019-05-29  8:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-29  9:00 Wenjie Li [this message]
2019-05-30  1:06 ` Yao, BingX Y
2019-05-30  4:40 ` Li, WenjieX A
2019-06-05  1:46 ` Tu, Lijuan

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=1559120436-112959-1-git-send-email-wenjiex.a.li@intel.com \
    --to=wenjiex.a.li@intel.com \
    --cc=dts@dpdk.org \
    --cc=yanx.a.zhang@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).