test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH V2] update function send_packet of pmdrss_hash to reduce runtime
@ 2019-04-29 10:01 xiao,qimai
  2019-05-13  2:24 ` Tu, Lijuan
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: xiao,qimai @ 2019-04-29 10:01 UTC (permalink / raw)
  To: dts; +Cc: xiao,qimai

optimize function send_packet in pmdrss_hash

Signed-off-by: xiao,qimai <qimaix.xiao@intel.com>
---
 tests/TestSuite_pmdrss_hash.py | 148 ++++++++++++++-------------------
 1 file changed, 64 insertions(+), 84 deletions(-)

diff --git a/tests/TestSuite_pmdrss_hash.py b/tests/TestSuite_pmdrss_hash.py
index 283a545..32dc263 100644
--- a/tests/TestSuite_pmdrss_hash.py
+++ b/tests/TestSuite_pmdrss_hash.py
@@ -85,79 +85,79 @@ class TestPmdrssHash(TestCase):
                 packet = r'sendp([Ether(dst="%s", src=get_if_hwaddr("%s"))/IP(src="192.168.0.%d", dst="192.168.0.%d")], iface="%s")' % (
                     mac, itf, 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(10):
                 packet = r'sendp([Ether(dst="%s", src=get_if_hwaddr("%s"))/IP(src="192.168.0.%d", dst="192.168.0.%d")/TCP(sport=1024,dport=1024)], iface="%s")' % (
                     mac, itf, 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(10):
                 packet = r'sendp([Ether(dst="%s", src=get_if_hwaddr("%s"))/IP(src="192.168.0.%d", dst="192.168.0.%d")/UDP(sport=1024,dport=1024)], iface="%s")' % (
                     mac, itf, 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(10):
                 packet = r'sendp([Ether(dst="%s", src=get_if_hwaddr("%s"))/IP(src="192.168.0.%d", dst="192.168.0.%d")/SCTP(sport=1024,dport=1024,tag=1)], iface="%s")' % (
                     mac, itf, 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-frag":
             for i in range(10):
                 packet = r'sendp([Ether(dst="%s", src=get_if_hwaddr("%s"))/IP(src="192.168.0.%d", dst="192.168.0.%d",frag=1,flags="MF")], iface="%s")' % (
                     mac, itf, 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 == "l2_payload":
             for i in range(10):
                 packet = r'sendp([Ether(src="00:00:00:00:00:0%d",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(10):
                 packet = r'sendp([Ether(dst="%s", src=get_if_hwaddr("%s"))/IPv6(src="3ffe:2501:200:1fff::%d", dst="3ffe:2501:200:3::%d")], iface="%s")' % (
                     mac, itf, 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(10):
                 packet = r'sendp([Ether(dst="%s", src=get_if_hwaddr("%s"))/IPv6(src="3ffe:2501:200:1fff::%d", dst="3ffe:2501:200:3::%d")/TCP(sport=1024,dport=1024)], iface="%s")' % (
                     mac, itf, 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(10):
                 packet = r'sendp([Ether(dst="%s", src=get_if_hwaddr("%s"))/IPv6(src="3ffe:2501:200:1fff::%d", dst="3ffe:2501:200:3::%d")/UDP(sport=1024,dport=1024)], iface="%s")' % (
                     mac, itf, 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(10):
                 packet = r'sendp([Ether(dst="%s", src=get_if_hwaddr("%s"))/IPv6(src="3ffe:2501:200:1fff::%d", dst="3ffe:2501:200:3::%d", nh=132)/SCTP(sport=1024,dport=1024,tag=1)], iface="%s")' % (
                     mac, itf, 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-frag":
             for i in range(10):
                 packet = r'sendp([Ether(dst="%s", src=get_if_hwaddr("%s"))/IPv6(src="3ffe:2501:200:1fff::%d", dst="3ffe:2501:200:3::%d",nh=44)/IPv6ExtHdrFragment()], iface="%s")' % (
                     mac, itf, i + 1, i + 2, 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"
 
@@ -235,131 +235,111 @@ class TestPmdrssHash(TestCase):
                 packet = r'sendp([Ether(dst="%s")/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)
-                packet = r'sendp([Ether(dst="%s")/IP(src="192.168.0.%d", dst="192.168.0.%d")], iface="%s")' % (
+                packet2 = r'sendp([Ether(dst="%s")/IP(src="192.168.0.%d", dst="192.168.0.%d")], iface="%s")' % (
                     mac, i + 2, i + 1, itf)
-                self.tester.scapy_append(packet)
-                self.tester.scapy_execute()
-                time.sleep(.5)
+                self.tester.scapy_append(packet2)
+            self.tester.scapy_execute()
+            time.sleep(.5)
 
         elif tran_type == "ipv4-tcp":
             for i in range(4):
                 packet = r'sendp([Ether(dst="%s")/IP(src="192.168.0.%d", dst="192.168.0.%d")/TCP(sport=1024,dport=1025)], 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")/TCP(sport=1025,dport=1024)], iface="%s")' % (
+                packet2 = r'sendp([Ether(dst="%s")/IP(src="192.168.0.%d", dst="192.168.0.%d")/TCP(sport=1025,dport=1024)], iface="%s")' % (
                     mac, i + 2, i + 1, itf)
-                self.tester.scapy_append(packet)
-                self.tester.scapy_execute()
-                time.sleep(.5)
+                self.tester.scapy_append(packet2)
+            self.tester.scapy_execute()
+            time.sleep(.5)
         elif tran_type == "ipv4-udp":
             for i in range(4):
                 packet = r'sendp([Ether(dst="%s")/IP(src="192.168.0.%d", dst="192.168.0.%d")/UDP(sport=1024,dport=1025)], 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")/UDP(sport=1025,dport=1024)], iface="%s")' % (
+                packet2 = r'sendp([Ether(dst="%s")/IP(src="192.168.0.%d", dst="192.168.0.%d")/UDP(sport=1025,dport=1024)], iface="%s")' % (
                     mac, i + 2, i + 1, itf)
-                self.tester.scapy_append(packet)
-                self.tester.scapy_execute()
-                time.sleep(.5)
+                self.tester.scapy_append(packet2)
+            self.tester.scapy_execute()
+            time.sleep(.5)
         elif tran_type == "ipv4-sctp":
             for i in range(4):
                 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")' % (
+                packet2 = 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_append(packet2)
+            self.tester.scapy_execute()
+            time.sleep(.5)
         elif tran_type == "ipv4-frag":
             for i in range(10):
                 packet = r'sendp([Ether(dst="%s")/IP(src="192.168.0.%d", dst="192.168.0.%d",frag=1,flags="MF")], 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",frag=1,flags="MF")], iface="%s")' % (
+                packet2 = r'sendp([Ether(dst="%s")/IP(src="192.168.0.%d", dst="192.168.0.%d",frag=1,flags="MF")], iface="%s")' % (
                     mac, i + 2, i + 1, itf)
-                self.tester.scapy_append(packet)
-                self.tester.scapy_execute()
-                time.sleep(.5)
+                self.tester.scapy_append(packet2)
+            self.tester.scapy_execute()
+            time.sleep(.5)
         elif tran_type == "l2_payload":
             for i in range(10):
                 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(4):
                 packet = r'sendp([Ether(dst="%s")/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)
-                packet = r'sendp([Ether(dst="%s")/IPv6(src="3ffe:2501:200:3::%d", dst="3ffe:2501:200:1fff::%d")], iface="%s")' % (
+                packet2 = r'sendp([Ether(dst="%s")/IPv6(src="3ffe:2501:200:3::%d", dst="3ffe:2501:200:1fff::%d")], iface="%s")' % (
                     mac, i + 2, i + 1, itf)
-                self.tester.scapy_append(packet)
-                self.tester.scapy_execute()
-                time.sleep(.5)
+                self.tester.scapy_append(packet2)
+            self.tester.scapy_execute()
+            time.sleep(.5)
 
         elif tran_type == "ipv6-tcp":
             for i in range(4):
                 packet = r'sendp([Ether(dst="%s")/IPv6(src="3ffe:2501:200:1fff::%d", dst="3ffe:2501:200:3::%d")/TCP(sport=1024,dport=1025)], 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:3::%d", dst="3ffe:2501:200:1fff::%d")/TCP(sport=1025,dport=1024)], iface="%s")' % (
+                packet2 = r'sendp([Ether(dst="%s")/IPv6(src="3ffe:2501:200:3::%d", dst="3ffe:2501:200:1fff::%d")/TCP(sport=1025,dport=1024)], iface="%s")' % (
                     mac, i + 2, i + 1, itf)
-                self.tester.scapy_append(packet)
-                self.tester.scapy_execute()
-                time.sleep(.5)
+                self.tester.scapy_append(packet2)
+            self.tester.scapy_execute()
+            time.sleep(.5)
 
         elif tran_type == "ipv6-udp":
             for i in range(4):
                 packet = r'sendp([Ether(dst="%s")/IPv6(src="3ffe:2501:200:1fff::%d", dst="3ffe:2501:200:3::%d")/UDP(sport=1024,dport=1025)], 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")/UDP(sport=1025,dport=1024)], iface="%s")' % (
+                packet2 = r'sendp([Ether(dst="%s")/IPv6(src="3ffe:2501:200:1fff::%d", dst="3ffe:2501:200:3::%d")/UDP(sport=1025,dport=1024)], iface="%s")' % (
                     mac, i + 2, i + 1, itf)
-                self.tester.scapy_append(packet)
-                self.tester.scapy_execute()
-                time.sleep(.5)
+                self.tester.scapy_append(packet2)
+            self.tester.scapy_execute()
+            time.sleep(.5)
         elif tran_type == "ipv6-sctp":
             for i in range(4):
                 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")' % (
+                packet2 = 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_append(packet2)
+            self.tester.scapy_execute()
+            time.sleep(.5)
         elif tran_type == "ipv6-frag":
             for i in range(4):
                 packet = r'sendp([Ether(dst="%s")/IPv6(src="3ffe:2501:200:1fff::%d", dst="3ffe:2501:200:3::%d",nh=44)/IPv6ExtHdrFragment()], 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=44)/IPv6ExtHdrFragment()], iface="%s")' % (
+                packet2 = r'sendp([Ether(dst="%s")/IPv6(src="3ffe:2501:200:1fff::%d", dst="3ffe:2501:200:3::%d",nh=44)/IPv6ExtHdrFragment()], iface="%s")' % (
                     mac, i + 2, i + 1, itf)
-                self.tester.scapy_append(packet)
-                self.tester.scapy_execute()
-                time.sleep(.5)
+                self.tester.scapy_append(packet2)
+            self.tester.scapy_execute()
+            time.sleep(.5)
         else:
             print "\ntran_type error!\n"
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dts] [PATCH V2] update function send_packet of pmdrss_hash to reduce runtime
  2019-04-29 10:01 [dts] [PATCH V2] update function send_packet of pmdrss_hash to reduce runtime xiao,qimai
@ 2019-05-13  2:24 ` Tu, Lijuan
  2019-05-13  5:25 ` Li, WenjieX A
  2019-05-13  5:27 ` Li, WenjieX A
  2 siblings, 0 replies; 4+ messages in thread
From: Tu, Lijuan @ 2019-05-13  2:24 UTC (permalink / raw)
  To: Xiao, QimaiX, dts; +Cc: Xiao, QimaiX

Applied, thanks

> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of xiao,qimai
> Sent: Monday, April 29, 2019 6:02 PM
> To: dts@dpdk.org
> Cc: Xiao, QimaiX <qimaix.xiao@intel.com>
> Subject: [dts] [PATCH V2] update function send_packet of pmdrss_hash to
> reduce runtime
> 
> optimize function send_packet in pmdrss_hash
> 
> Signed-off-by: xiao,qimai <qimaix.xiao@intel.com>
> ---
>  tests/TestSuite_pmdrss_hash.py | 148 ++++++++++++++-------------------
>  1 file changed, 64 insertions(+), 84 deletions(-)
> 
> diff --git a/tests/TestSuite_pmdrss_hash.py
> b/tests/TestSuite_pmdrss_hash.py index 283a545..32dc263 100644
> --- a/tests/TestSuite_pmdrss_hash.py
> +++ b/tests/TestSuite_pmdrss_hash.py
> @@ -85,79 +85,79 @@ class TestPmdrssHash(TestCase):
>                  packet = r'sendp([Ether(dst="%s",
> src=get_if_hwaddr("%s"))/IP(src="192.168.0.%d", dst="192.168.0.%d")],
> iface="%s")' % (
>                      mac, itf, 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(10):
>                  packet = r'sendp([Ether(dst="%s",
> src=get_if_hwaddr("%s"))/IP(src="192.168.0.%d",
> dst="192.168.0.%d")/TCP(sport=1024,dport=1024)], iface="%s")' % (
>                      mac, itf, 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(10):
>                  packet = r'sendp([Ether(dst="%s",
> src=get_if_hwaddr("%s"))/IP(src="192.168.0.%d",
> dst="192.168.0.%d")/UDP(sport=1024,dport=1024)], iface="%s")' % (
>                      mac, itf, 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(10):
>                  packet = r'sendp([Ether(dst="%s",
> src=get_if_hwaddr("%s"))/IP(src="192.168.0.%d",
> dst="192.168.0.%d")/SCTP(sport=1024,dport=1024,tag=1)], iface="%s")' % (
>                      mac, itf, 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-frag":
>              for i in range(10):
>                  packet = r'sendp([Ether(dst="%s",
> src=get_if_hwaddr("%s"))/IP(src="192.168.0.%d",
> dst="192.168.0.%d",frag=1,flags="MF")], iface="%s")' % (
>                      mac, itf, 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 == "l2_payload":
>              for i in range(10):
>                  packet = r'sendp([Ether(src="00:00:00:00:00:0%d",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(10):
>                  packet = r'sendp([Ether(dst="%s",
> src=get_if_hwaddr("%s"))/IPv6(src="3ffe:2501:200:1fff::%d",
> dst="3ffe:2501:200:3::%d")], iface="%s")' % (
>                      mac, itf, 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(10):
>                  packet = r'sendp([Ether(dst="%s",
> src=get_if_hwaddr("%s"))/IPv6(src="3ffe:2501:200:1fff::%d",
> dst="3ffe:2501:200:3::%d")/TCP(sport=1024,dport=1024)], iface="%s")' % (
>                      mac, itf, 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(10):
>                  packet = r'sendp([Ether(dst="%s",
> src=get_if_hwaddr("%s"))/IPv6(src="3ffe:2501:200:1fff::%d",
> dst="3ffe:2501:200:3::%d")/UDP(sport=1024,dport=1024)], iface="%s")' % (
>                      mac, itf, 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(10):
>                  packet = r'sendp([Ether(dst="%s",
> src=get_if_hwaddr("%s"))/IPv6(src="3ffe:2501:200:1fff::%d",
> dst="3ffe:2501:200:3::%d", nh=132)/SCTP(sport=1024,dport=1024,tag=1)],
> iface="%s")' % (
>                      mac, itf, 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-frag":
>              for i in range(10):
>                  packet = r'sendp([Ether(dst="%s",
> src=get_if_hwaddr("%s"))/IPv6(src="3ffe:2501:200:1fff::%d",
> dst="3ffe:2501:200:3::%d",nh=44)/IPv6ExtHdrFragment()], iface="%s")' % (
>                      mac, itf, i + 1, i + 2, 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"
> 
> @@ -235,131 +235,111 @@ class TestPmdrssHash(TestCase):
>                  packet = r'sendp([Ether(dst="%s")/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)
> -                packet = r'sendp([Ether(dst="%s")/IP(src="192.168.0.%d",
> dst="192.168.0.%d")], iface="%s")' % (
> +                packet2 =
> + r'sendp([Ether(dst="%s")/IP(src="192.168.0.%d", dst="192.168.0.%d")],
> + iface="%s")' % (
>                      mac, i + 2, i + 1, itf)
> -                self.tester.scapy_append(packet)
> -                self.tester.scapy_execute()
> -                time.sleep(.5)
> +                self.tester.scapy_append(packet2)
> +            self.tester.scapy_execute()
> +            time.sleep(.5)
> 
>          elif tran_type == "ipv4-tcp":
>              for i in range(4):
>                  packet = r'sendp([Ether(dst="%s")/IP(src="192.168.0.%d",
> dst="192.168.0.%d")/TCP(sport=1024,dport=1025)], 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")/TCP(sport=1025,dport=1024)], iface="%s")' % (
> +                packet2 =
> + r'sendp([Ether(dst="%s")/IP(src="192.168.0.%d",
> + dst="192.168.0.%d")/TCP(sport=1025,dport=1024)], iface="%s")' % (
>                      mac, i + 2, i + 1, itf)
> -                self.tester.scapy_append(packet)
> -                self.tester.scapy_execute()
> -                time.sleep(.5)
> +                self.tester.scapy_append(packet2)
> +            self.tester.scapy_execute()
> +            time.sleep(.5)
>          elif tran_type == "ipv4-udp":
>              for i in range(4):
>                  packet = r'sendp([Ether(dst="%s")/IP(src="192.168.0.%d",
> dst="192.168.0.%d")/UDP(sport=1024,dport=1025)], 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")/UDP(sport=1025,dport=1024)], iface="%s")' % (
> +                packet2 =
> + r'sendp([Ether(dst="%s")/IP(src="192.168.0.%d",
> + dst="192.168.0.%d")/UDP(sport=1025,dport=1024)], iface="%s")' % (
>                      mac, i + 2, i + 1, itf)
> -                self.tester.scapy_append(packet)
> -                self.tester.scapy_execute()
> -                time.sleep(.5)
> +                self.tester.scapy_append(packet2)
> +            self.tester.scapy_execute()
> +            time.sleep(.5)
>          elif tran_type == "ipv4-sctp":
>              for i in range(4):
>                  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")' % (
> +                packet2 =
> + 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_append(packet2)
> +            self.tester.scapy_execute()
> +            time.sleep(.5)
>          elif tran_type == "ipv4-frag":
>              for i in range(10):
>                  packet = r'sendp([Ether(dst="%s")/IP(src="192.168.0.%d",
> dst="192.168.0.%d",frag=1,flags="MF")], 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",frag=1,flags="MF")], iface="%s")' % (
> +                packet2 =
> + r'sendp([Ether(dst="%s")/IP(src="192.168.0.%d",
> + dst="192.168.0.%d",frag=1,flags="MF")], iface="%s")' % (
>                      mac, i + 2, i + 1, itf)
> -                self.tester.scapy_append(packet)
> -                self.tester.scapy_execute()
> -                time.sleep(.5)
> +                self.tester.scapy_append(packet2)
> +            self.tester.scapy_execute()
> +            time.sleep(.5)
>          elif tran_type == "l2_payload":
>              for i in range(10):
>                  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(4):
>                  packet = r'sendp([Ether(dst="%s")/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)
> -                packet = r'sendp([Ether(dst="%s")/IPv6(src="3ffe:2501:200:3::%d",
> dst="3ffe:2501:200:1fff::%d")], iface="%s")' % (
> +                packet2 =
> + r'sendp([Ether(dst="%s")/IPv6(src="3ffe:2501:200:3::%d",
> + dst="3ffe:2501:200:1fff::%d")], iface="%s")' % (
>                      mac, i + 2, i + 1, itf)
> -                self.tester.scapy_append(packet)
> -                self.tester.scapy_execute()
> -                time.sleep(.5)
> +                self.tester.scapy_append(packet2)
> +            self.tester.scapy_execute()
> +            time.sleep(.5)
> 
>          elif tran_type == "ipv6-tcp":
>              for i in range(4):
>                  packet = r'sendp([Ether(dst="%s")/IPv6(src="3ffe:2501:200:1fff::%d",
> dst="3ffe:2501:200:3::%d")/TCP(sport=1024,dport=1025)], 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:3::%d",
> dst="3ffe:2501:200:1fff::%d")/TCP(sport=1025,dport=1024)], iface="%s")' % (
> +                packet2 =
> + r'sendp([Ether(dst="%s")/IPv6(src="3ffe:2501:200:3::%d",
> + dst="3ffe:2501:200:1fff::%d")/TCP(sport=1025,dport=1024)],
> + iface="%s")' % (
>                      mac, i + 2, i + 1, itf)
> -                self.tester.scapy_append(packet)
> -                self.tester.scapy_execute()
> -                time.sleep(.5)
> +                self.tester.scapy_append(packet2)
> +            self.tester.scapy_execute()
> +            time.sleep(.5)
> 
>          elif tran_type == "ipv6-udp":
>              for i in range(4):
>                  packet = r'sendp([Ether(dst="%s")/IPv6(src="3ffe:2501:200:1fff::%d",
> dst="3ffe:2501:200:3::%d")/UDP(sport=1024,dport=1025)], 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")/UDP(sport=1025,dport=1024)], iface="%s")' % (
> +                packet2 =
> + r'sendp([Ether(dst="%s")/IPv6(src="3ffe:2501:200:1fff::%d",
> + dst="3ffe:2501:200:3::%d")/UDP(sport=1025,dport=1024)], iface="%s")' %
> + (
>                      mac, i + 2, i + 1, itf)
> -                self.tester.scapy_append(packet)
> -                self.tester.scapy_execute()
> -                time.sleep(.5)
> +                self.tester.scapy_append(packet2)
> +            self.tester.scapy_execute()
> +            time.sleep(.5)
>          elif tran_type == "ipv6-sctp":
>              for i in range(4):
>                  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")' % (
> +                packet2 =
> + 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_append(packet2)
> +            self.tester.scapy_execute()
> +            time.sleep(.5)
>          elif tran_type == "ipv6-frag":
>              for i in range(4):
>                  packet = r'sendp([Ether(dst="%s")/IPv6(src="3ffe:2501:200:1fff::%d",
> dst="3ffe:2501:200:3::%d",nh=44)/IPv6ExtHdrFragment()], 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=44)/IPv6ExtHdrFragment()], iface="%s")' % (
> +                packet2 =
> + r'sendp([Ether(dst="%s")/IPv6(src="3ffe:2501:200:1fff::%d",
> + dst="3ffe:2501:200:3::%d",nh=44)/IPv6ExtHdrFragment()], iface="%s")' %
> + (
>                      mac, i + 2, i + 1, itf)
> -                self.tester.scapy_append(packet)
> -                self.tester.scapy_execute()
> -                time.sleep(.5)
> +                self.tester.scapy_append(packet2)
> +            self.tester.scapy_execute()
> +            time.sleep(.5)
>          else:
>              print "\ntran_type error!\n"
> 
> --
> 2.17.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dts] [PATCH V2] update function send_packet of pmdrss_hash to reduce runtime
  2019-04-29 10:01 [dts] [PATCH V2] update function send_packet of pmdrss_hash to reduce runtime xiao,qimai
  2019-05-13  2:24 ` Tu, Lijuan
@ 2019-05-13  5:25 ` Li, WenjieX A
  2019-05-13  5:27 ` Li, WenjieX A
  2 siblings, 0 replies; 4+ messages in thread
From: Li, WenjieX A @ 2019-05-13  5:25 UTC (permalink / raw)
  To: Xiao, QimaiX, dts; +Cc: Xiao, QimaiX, Li, WenjieX A

Reviewed-by: Li, WenjieX A <wenjiex.a.li@intel.com>

> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of xiao,qimai
> Sent: Monday, April 29, 2019 6:02 PM
> To: dts@dpdk.org
> Cc: Xiao, QimaiX <qimaix.xiao@intel.com>
> Subject: [dts] [PATCH V2] update function send_packet of pmdrss_hash to
> reduce runtime
> 
> optimize function send_packet in pmdrss_hash
> 
> Signed-off-by: xiao,qimai <qimaix.xiao@intel.com>
> ---
>  tests/TestSuite_pmdrss_hash.py | 148 ++++++++++++++-------------------
>  1 file changed, 64 insertions(+), 84 deletions(-)
> 
> diff --git a/tests/TestSuite_pmdrss_hash.py b/tests/TestSuite_pmdrss_hash.py
> index 283a545..32dc263 100644
> --- a/tests/TestSuite_pmdrss_hash.py
> +++ b/tests/TestSuite_pmdrss_hash.py
> @@ -85,79 +85,79 @@ class TestPmdrssHash(TestCase):
>                  packet = r'sendp([Ether(dst="%s",
> src=get_if_hwaddr("%s"))/IP(src="192.168.0.%d", dst="192.168.0.%d")],
> iface="%s")' % (
>                      mac, itf, 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(10):
>                  packet = r'sendp([Ether(dst="%s",
> src=get_if_hwaddr("%s"))/IP(src="192.168.0.%d",
> dst="192.168.0.%d")/TCP(sport=1024,dport=1024)], iface="%s")' % (
>                      mac, itf, 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(10):
>                  packet = r'sendp([Ether(dst="%s",
> src=get_if_hwaddr("%s"))/IP(src="192.168.0.%d",
> dst="192.168.0.%d")/UDP(sport=1024,dport=1024)], iface="%s")' % (
>                      mac, itf, 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(10):
>                  packet = r'sendp([Ether(dst="%s",
> src=get_if_hwaddr("%s"))/IP(src="192.168.0.%d",
> dst="192.168.0.%d")/SCTP(sport=1024,dport=1024,tag=1)], iface="%s")' % (
>                      mac, itf, 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-frag":
>              for i in range(10):
>                  packet = r'sendp([Ether(dst="%s",
> src=get_if_hwaddr("%s"))/IP(src="192.168.0.%d",
> dst="192.168.0.%d",frag=1,flags="MF")], iface="%s")' % (
>                      mac, itf, 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 == "l2_payload":
>              for i in range(10):
>                  packet = r'sendp([Ether(src="00:00:00:00:00:0%d",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(10):
>                  packet = r'sendp([Ether(dst="%s",
> src=get_if_hwaddr("%s"))/IPv6(src="3ffe:2501:200:1fff::%d",
> dst="3ffe:2501:200:3::%d")], iface="%s")' % (
>                      mac, itf, 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(10):
>                  packet = r'sendp([Ether(dst="%s",
> src=get_if_hwaddr("%s"))/IPv6(src="3ffe:2501:200:1fff::%d",
> dst="3ffe:2501:200:3::%d")/TCP(sport=1024,dport=1024)], iface="%s")' % (
>                      mac, itf, 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(10):
>                  packet = r'sendp([Ether(dst="%s",
> src=get_if_hwaddr("%s"))/IPv6(src="3ffe:2501:200:1fff::%d",
> dst="3ffe:2501:200:3::%d")/UDP(sport=1024,dport=1024)], iface="%s")' % (
>                      mac, itf, 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(10):
>                  packet = r'sendp([Ether(dst="%s",
> src=get_if_hwaddr("%s"))/IPv6(src="3ffe:2501:200:1fff::%d",
> dst="3ffe:2501:200:3::%d", nh=132)/SCTP(sport=1024,dport=1024,tag=1)],
> iface="%s")' % (
>                      mac, itf, 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-frag":
>              for i in range(10):
>                  packet = r'sendp([Ether(dst="%s",
> src=get_if_hwaddr("%s"))/IPv6(src="3ffe:2501:200:1fff::%d",
> dst="3ffe:2501:200:3::%d",nh=44)/IPv6ExtHdrFragment()], iface="%s")' % (
>                      mac, itf, i + 1, i + 2, 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"
> 
> @@ -235,131 +235,111 @@ class TestPmdrssHash(TestCase):
>                  packet = r'sendp([Ether(dst="%s")/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)
> -                packet = r'sendp([Ether(dst="%s")/IP(src="192.168.0.%d",
> dst="192.168.0.%d")], iface="%s")' % (
> +                packet2 =
> + r'sendp([Ether(dst="%s")/IP(src="192.168.0.%d", dst="192.168.0.%d")],
> + iface="%s")' % (
>                      mac, i + 2, i + 1, itf)
> -                self.tester.scapy_append(packet)
> -                self.tester.scapy_execute()
> -                time.sleep(.5)
> +                self.tester.scapy_append(packet2)
> +            self.tester.scapy_execute()
> +            time.sleep(.5)
> 
>          elif tran_type == "ipv4-tcp":
>              for i in range(4):
>                  packet = r'sendp([Ether(dst="%s")/IP(src="192.168.0.%d",
> dst="192.168.0.%d")/TCP(sport=1024,dport=1025)], 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")/TCP(sport=1025,dport=1024)], iface="%s")' % (
> +                packet2 =
> + r'sendp([Ether(dst="%s")/IP(src="192.168.0.%d",
> + dst="192.168.0.%d")/TCP(sport=1025,dport=1024)], iface="%s")' % (
>                      mac, i + 2, i + 1, itf)
> -                self.tester.scapy_append(packet)
> -                self.tester.scapy_execute()
> -                time.sleep(.5)
> +                self.tester.scapy_append(packet2)
> +            self.tester.scapy_execute()
> +            time.sleep(.5)
>          elif tran_type == "ipv4-udp":
>              for i in range(4):
>                  packet = r'sendp([Ether(dst="%s")/IP(src="192.168.0.%d",
> dst="192.168.0.%d")/UDP(sport=1024,dport=1025)], 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")/UDP(sport=1025,dport=1024)], iface="%s")' % (
> +                packet2 =
> + r'sendp([Ether(dst="%s")/IP(src="192.168.0.%d",
> + dst="192.168.0.%d")/UDP(sport=1025,dport=1024)], iface="%s")' % (
>                      mac, i + 2, i + 1, itf)
> -                self.tester.scapy_append(packet)
> -                self.tester.scapy_execute()
> -                time.sleep(.5)
> +                self.tester.scapy_append(packet2)
> +            self.tester.scapy_execute()
> +            time.sleep(.5)
>          elif tran_type == "ipv4-sctp":
>              for i in range(4):
>                  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")' % (
> +                packet2 =
> + 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_append(packet2)
> +            self.tester.scapy_execute()
> +            time.sleep(.5)
>          elif tran_type == "ipv4-frag":
>              for i in range(10):
>                  packet = r'sendp([Ether(dst="%s")/IP(src="192.168.0.%d",
> dst="192.168.0.%d",frag=1,flags="MF")], 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",frag=1,flags="MF")], iface="%s")' % (
> +                packet2 =
> + r'sendp([Ether(dst="%s")/IP(src="192.168.0.%d",
> + dst="192.168.0.%d",frag=1,flags="MF")], iface="%s")' % (
>                      mac, i + 2, i + 1, itf)
> -                self.tester.scapy_append(packet)
> -                self.tester.scapy_execute()
> -                time.sleep(.5)
> +                self.tester.scapy_append(packet2)
> +            self.tester.scapy_execute()
> +            time.sleep(.5)
>          elif tran_type == "l2_payload":
>              for i in range(10):
>                  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(4):
>                  packet = r'sendp([Ether(dst="%s")/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)
> -                packet = r'sendp([Ether(dst="%s")/IPv6(src="3ffe:2501:200:3::%d",
> dst="3ffe:2501:200:1fff::%d")], iface="%s")' % (
> +                packet2 =
> + r'sendp([Ether(dst="%s")/IPv6(src="3ffe:2501:200:3::%d",
> + dst="3ffe:2501:200:1fff::%d")], iface="%s")' % (
>                      mac, i + 2, i + 1, itf)
> -                self.tester.scapy_append(packet)
> -                self.tester.scapy_execute()
> -                time.sleep(.5)
> +                self.tester.scapy_append(packet2)
> +            self.tester.scapy_execute()
> +            time.sleep(.5)
> 
>          elif tran_type == "ipv6-tcp":
>              for i in range(4):
>                  packet = r'sendp([Ether(dst="%s")/IPv6(src="3ffe:2501:200:1fff::%d",
> dst="3ffe:2501:200:3::%d")/TCP(sport=1024,dport=1025)], 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:3::%d",
> dst="3ffe:2501:200:1fff::%d")/TCP(sport=1025,dport=1024)], iface="%s")' % (
> +                packet2 =
> + r'sendp([Ether(dst="%s")/IPv6(src="3ffe:2501:200:3::%d",
> + dst="3ffe:2501:200:1fff::%d")/TCP(sport=1025,dport=1024)],
> + iface="%s")' % (
>                      mac, i + 2, i + 1, itf)
> -                self.tester.scapy_append(packet)
> -                self.tester.scapy_execute()
> -                time.sleep(.5)
> +                self.tester.scapy_append(packet2)
> +            self.tester.scapy_execute()
> +            time.sleep(.5)
> 
>          elif tran_type == "ipv6-udp":
>              for i in range(4):
>                  packet = r'sendp([Ether(dst="%s")/IPv6(src="3ffe:2501:200:1fff::%d",
> dst="3ffe:2501:200:3::%d")/UDP(sport=1024,dport=1025)], 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")/UDP(sport=1025,dport=1024)], iface="%s")' % (
> +                packet2 =
> + r'sendp([Ether(dst="%s")/IPv6(src="3ffe:2501:200:1fff::%d",
> + dst="3ffe:2501:200:3::%d")/UDP(sport=1025,dport=1024)], iface="%s")' %
> + (
>                      mac, i + 2, i + 1, itf)
> -                self.tester.scapy_append(packet)
> -                self.tester.scapy_execute()
> -                time.sleep(.5)
> +                self.tester.scapy_append(packet2)
> +            self.tester.scapy_execute()
> +            time.sleep(.5)
>          elif tran_type == "ipv6-sctp":
>              for i in range(4):
>                  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")' % (
> +                packet2 =
> + 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_append(packet2)
> +            self.tester.scapy_execute()
> +            time.sleep(.5)
>          elif tran_type == "ipv6-frag":
>              for i in range(4):
>                  packet = r'sendp([Ether(dst="%s")/IPv6(src="3ffe:2501:200:1fff::%d",
> dst="3ffe:2501:200:3::%d",nh=44)/IPv6ExtHdrFragment()], 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=44)/IPv6ExtHdrFragment()], iface="%s")' % (
> +                packet2 =
> + r'sendp([Ether(dst="%s")/IPv6(src="3ffe:2501:200:1fff::%d",
> + dst="3ffe:2501:200:3::%d",nh=44)/IPv6ExtHdrFragment()], iface="%s")' %
> + (
>                      mac, i + 2, i + 1, itf)
> -                self.tester.scapy_append(packet)
> -                self.tester.scapy_execute()
> -                time.sleep(.5)
> +                self.tester.scapy_append(packet2)
> +            self.tester.scapy_execute()
> +            time.sleep(.5)
>          else:
>              print "\ntran_type error!\n"
> 
> --
> 2.17.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dts] [PATCH V2] update function send_packet of pmdrss_hash to reduce runtime
  2019-04-29 10:01 [dts] [PATCH V2] update function send_packet of pmdrss_hash to reduce runtime xiao,qimai
  2019-05-13  2:24 ` Tu, Lijuan
  2019-05-13  5:25 ` Li, WenjieX A
@ 2019-05-13  5:27 ` Li, WenjieX A
  2 siblings, 0 replies; 4+ messages in thread
From: Li, WenjieX A @ 2019-05-13  5:27 UTC (permalink / raw)
  To: Xiao, QimaiX, dts; +Cc: Xiao, QimaiX, Li, WenjieX A

Tested-by: Li, WenjieX A <wenjiex.a.li@intel.com>

The runtime is reduced to 41 from about 66 minutes.

> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of xiao,qimai
> Sent: Monday, April 29, 2019 6:02 PM
> To: dts@dpdk.org
> Cc: Xiao, QimaiX <qimaix.xiao@intel.com>
> Subject: [dts] [PATCH V2] update function send_packet of pmdrss_hash to
> reduce runtime
> 
> optimize function send_packet in pmdrss_hash
> 
> Signed-off-by: xiao,qimai <qimaix.xiao@intel.com>
> ---
>  tests/TestSuite_pmdrss_hash.py | 148 ++++++++++++++-------------------
>  1 file changed, 64 insertions(+), 84 deletions(-)
> 
> diff --git a/tests/TestSuite_pmdrss_hash.py b/tests/TestSuite_pmdrss_hash.py
> index 283a545..32dc263 100644
> --- a/tests/TestSuite_pmdrss_hash.py
> +++ b/tests/TestSuite_pmdrss_hash.py
> @@ -85,79 +85,79 @@ class TestPmdrssHash(TestCase):
>                  packet = r'sendp([Ether(dst="%s",
> src=get_if_hwaddr("%s"))/IP(src="192.168.0.%d", dst="192.168.0.%d")],
> iface="%s")' % (
>                      mac, itf, 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(10):
>                  packet = r'sendp([Ether(dst="%s",
> src=get_if_hwaddr("%s"))/IP(src="192.168.0.%d",
> dst="192.168.0.%d")/TCP(sport=1024,dport=1024)], iface="%s")' % (
>                      mac, itf, 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(10):
>                  packet = r'sendp([Ether(dst="%s",
> src=get_if_hwaddr("%s"))/IP(src="192.168.0.%d",
> dst="192.168.0.%d")/UDP(sport=1024,dport=1024)], iface="%s")' % (
>                      mac, itf, 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(10):
>                  packet = r'sendp([Ether(dst="%s",
> src=get_if_hwaddr("%s"))/IP(src="192.168.0.%d",
> dst="192.168.0.%d")/SCTP(sport=1024,dport=1024,tag=1)], iface="%s")' % (
>                      mac, itf, 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-frag":
>              for i in range(10):
>                  packet = r'sendp([Ether(dst="%s",
> src=get_if_hwaddr("%s"))/IP(src="192.168.0.%d",
> dst="192.168.0.%d",frag=1,flags="MF")], iface="%s")' % (
>                      mac, itf, 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 == "l2_payload":
>              for i in range(10):
>                  packet = r'sendp([Ether(src="00:00:00:00:00:0%d",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(10):
>                  packet = r'sendp([Ether(dst="%s",
> src=get_if_hwaddr("%s"))/IPv6(src="3ffe:2501:200:1fff::%d",
> dst="3ffe:2501:200:3::%d")], iface="%s")' % (
>                      mac, itf, 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(10):
>                  packet = r'sendp([Ether(dst="%s",
> src=get_if_hwaddr("%s"))/IPv6(src="3ffe:2501:200:1fff::%d",
> dst="3ffe:2501:200:3::%d")/TCP(sport=1024,dport=1024)], iface="%s")' % (
>                      mac, itf, 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(10):
>                  packet = r'sendp([Ether(dst="%s",
> src=get_if_hwaddr("%s"))/IPv6(src="3ffe:2501:200:1fff::%d",
> dst="3ffe:2501:200:3::%d")/UDP(sport=1024,dport=1024)], iface="%s")' % (
>                      mac, itf, 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(10):
>                  packet = r'sendp([Ether(dst="%s",
> src=get_if_hwaddr("%s"))/IPv6(src="3ffe:2501:200:1fff::%d",
> dst="3ffe:2501:200:3::%d", nh=132)/SCTP(sport=1024,dport=1024,tag=1)],
> iface="%s")' % (
>                      mac, itf, 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-frag":
>              for i in range(10):
>                  packet = r'sendp([Ether(dst="%s",
> src=get_if_hwaddr("%s"))/IPv6(src="3ffe:2501:200:1fff::%d",
> dst="3ffe:2501:200:3::%d",nh=44)/IPv6ExtHdrFragment()], iface="%s")' % (
>                      mac, itf, i + 1, i + 2, 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"
> 
> @@ -235,131 +235,111 @@ class TestPmdrssHash(TestCase):
>                  packet = r'sendp([Ether(dst="%s")/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)
> -                packet = r'sendp([Ether(dst="%s")/IP(src="192.168.0.%d",
> dst="192.168.0.%d")], iface="%s")' % (
> +                packet2 =
> + r'sendp([Ether(dst="%s")/IP(src="192.168.0.%d", dst="192.168.0.%d")],
> + iface="%s")' % (
>                      mac, i + 2, i + 1, itf)
> -                self.tester.scapy_append(packet)
> -                self.tester.scapy_execute()
> -                time.sleep(.5)
> +                self.tester.scapy_append(packet2)
> +            self.tester.scapy_execute()
> +            time.sleep(.5)
> 
>          elif tran_type == "ipv4-tcp":
>              for i in range(4):
>                  packet = r'sendp([Ether(dst="%s")/IP(src="192.168.0.%d",
> dst="192.168.0.%d")/TCP(sport=1024,dport=1025)], 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")/TCP(sport=1025,dport=1024)], iface="%s")' % (
> +                packet2 =
> + r'sendp([Ether(dst="%s")/IP(src="192.168.0.%d",
> + dst="192.168.0.%d")/TCP(sport=1025,dport=1024)], iface="%s")' % (
>                      mac, i + 2, i + 1, itf)
> -                self.tester.scapy_append(packet)
> -                self.tester.scapy_execute()
> -                time.sleep(.5)
> +                self.tester.scapy_append(packet2)
> +            self.tester.scapy_execute()
> +            time.sleep(.5)
>          elif tran_type == "ipv4-udp":
>              for i in range(4):
>                  packet = r'sendp([Ether(dst="%s")/IP(src="192.168.0.%d",
> dst="192.168.0.%d")/UDP(sport=1024,dport=1025)], 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")/UDP(sport=1025,dport=1024)], iface="%s")' % (
> +                packet2 =
> + r'sendp([Ether(dst="%s")/IP(src="192.168.0.%d",
> + dst="192.168.0.%d")/UDP(sport=1025,dport=1024)], iface="%s")' % (
>                      mac, i + 2, i + 1, itf)
> -                self.tester.scapy_append(packet)
> -                self.tester.scapy_execute()
> -                time.sleep(.5)
> +                self.tester.scapy_append(packet2)
> +            self.tester.scapy_execute()
> +            time.sleep(.5)
>          elif tran_type == "ipv4-sctp":
>              for i in range(4):
>                  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")' % (
> +                packet2 =
> + 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_append(packet2)
> +            self.tester.scapy_execute()
> +            time.sleep(.5)
>          elif tran_type == "ipv4-frag":
>              for i in range(10):
>                  packet = r'sendp([Ether(dst="%s")/IP(src="192.168.0.%d",
> dst="192.168.0.%d",frag=1,flags="MF")], 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",frag=1,flags="MF")], iface="%s")' % (
> +                packet2 =
> + r'sendp([Ether(dst="%s")/IP(src="192.168.0.%d",
> + dst="192.168.0.%d",frag=1,flags="MF")], iface="%s")' % (
>                      mac, i + 2, i + 1, itf)
> -                self.tester.scapy_append(packet)
> -                self.tester.scapy_execute()
> -                time.sleep(.5)
> +                self.tester.scapy_append(packet2)
> +            self.tester.scapy_execute()
> +            time.sleep(.5)
>          elif tran_type == "l2_payload":
>              for i in range(10):
>                  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(4):
>                  packet = r'sendp([Ether(dst="%s")/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)
> -                packet = r'sendp([Ether(dst="%s")/IPv6(src="3ffe:2501:200:3::%d",
> dst="3ffe:2501:200:1fff::%d")], iface="%s")' % (
> +                packet2 =
> + r'sendp([Ether(dst="%s")/IPv6(src="3ffe:2501:200:3::%d",
> + dst="3ffe:2501:200:1fff::%d")], iface="%s")' % (
>                      mac, i + 2, i + 1, itf)
> -                self.tester.scapy_append(packet)
> -                self.tester.scapy_execute()
> -                time.sleep(.5)
> +                self.tester.scapy_append(packet2)
> +            self.tester.scapy_execute()
> +            time.sleep(.5)
> 
>          elif tran_type == "ipv6-tcp":
>              for i in range(4):
>                  packet = r'sendp([Ether(dst="%s")/IPv6(src="3ffe:2501:200:1fff::%d",
> dst="3ffe:2501:200:3::%d")/TCP(sport=1024,dport=1025)], 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:3::%d",
> dst="3ffe:2501:200:1fff::%d")/TCP(sport=1025,dport=1024)], iface="%s")' % (
> +                packet2 =
> + r'sendp([Ether(dst="%s")/IPv6(src="3ffe:2501:200:3::%d",
> + dst="3ffe:2501:200:1fff::%d")/TCP(sport=1025,dport=1024)],
> + iface="%s")' % (
>                      mac, i + 2, i + 1, itf)
> -                self.tester.scapy_append(packet)
> -                self.tester.scapy_execute()
> -                time.sleep(.5)
> +                self.tester.scapy_append(packet2)
> +            self.tester.scapy_execute()
> +            time.sleep(.5)
> 
>          elif tran_type == "ipv6-udp":
>              for i in range(4):
>                  packet = r'sendp([Ether(dst="%s")/IPv6(src="3ffe:2501:200:1fff::%d",
> dst="3ffe:2501:200:3::%d")/UDP(sport=1024,dport=1025)], 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")/UDP(sport=1025,dport=1024)], iface="%s")' % (
> +                packet2 =
> + r'sendp([Ether(dst="%s")/IPv6(src="3ffe:2501:200:1fff::%d",
> + dst="3ffe:2501:200:3::%d")/UDP(sport=1025,dport=1024)], iface="%s")' %
> + (
>                      mac, i + 2, i + 1, itf)
> -                self.tester.scapy_append(packet)
> -                self.tester.scapy_execute()
> -                time.sleep(.5)
> +                self.tester.scapy_append(packet2)
> +            self.tester.scapy_execute()
> +            time.sleep(.5)
>          elif tran_type == "ipv6-sctp":
>              for i in range(4):
>                  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")' % (
> +                packet2 =
> + 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_append(packet2)
> +            self.tester.scapy_execute()
> +            time.sleep(.5)
>          elif tran_type == "ipv6-frag":
>              for i in range(4):
>                  packet = r'sendp([Ether(dst="%s")/IPv6(src="3ffe:2501:200:1fff::%d",
> dst="3ffe:2501:200:3::%d",nh=44)/IPv6ExtHdrFragment()], 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=44)/IPv6ExtHdrFragment()], iface="%s")' % (
> +                packet2 =
> + r'sendp([Ether(dst="%s")/IPv6(src="3ffe:2501:200:1fff::%d",
> + dst="3ffe:2501:200:3::%d",nh=44)/IPv6ExtHdrFragment()], iface="%s")' %
> + (
>                      mac, i + 2, i + 1, itf)
> -                self.tester.scapy_append(packet)
> -                self.tester.scapy_execute()
> -                time.sleep(.5)
> +                self.tester.scapy_append(packet2)
> +            self.tester.scapy_execute()
> +            time.sleep(.5)
>          else:
>              print "\ntran_type error!\n"
> 
> --
> 2.17.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-05-13  5:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-29 10:01 [dts] [PATCH V2] update function send_packet of pmdrss_hash to reduce runtime xiao,qimai
2019-05-13  2:24 ` Tu, Lijuan
2019-05-13  5:25 ` Li, WenjieX A
2019-05-13  5:27 ` Li, WenjieX A

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).