test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH] tests pmdrss_hash: add new PCTYPE to fortpark_TLV
@ 2016-09-12  6:48 Peng yuan
  0 siblings, 0 replies; only message in thread
From: Peng yuan @ 2016-09-12  6:48 UTC (permalink / raw)
  To: dts; +Cc: pengyuan

From: pengyuan <yuan.peng@intel.com>

Signed-off-by: pengyuan <yuan.peng@intel.com>

diff --git a/tests/TestSuite_pmdrss_hash.py b/tests/TestSuite_pmdrss_hash.py
index a53057b..101cc0d 100644
--- a/tests/TestSuite_pmdrss_hash.py
+++ b/tests/TestSuite_pmdrss_hash.py
@@ -81,6 +81,13 @@ class TestPmdrssHash(TestCase):
                 self.tester.scapy_append(packet)
                 self.tester.scapy_execute()
                 time.sleep(.5)
+        elif tran_type == "ipv4-tcp-syn-no-ack":
+            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)
         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")' % (
@@ -88,6 +95,20 @@ class TestPmdrssHash(TestCase):
                 self.tester.scapy_append(packet)
                 self.tester.scapy_execute()
                 time.sleep(.5)
+	elif tran_type == "ipv4-udp-unicast":
+            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)
+        elif tran_type == "ipv4-udp-multicast":
+            for i in range(10):
+                packet = r'sendp([Ether(dst="01:00:5e:57:91:e6", src=get_if_hwaddr("%s"))/IP(src="192.168.0.%d", dst="224.215.145.230")/UDP(sport=1024,dport=1024)], iface="%s")' % (
+                    itf, i + 1, itf)
+                self.tester.scapy_append(packet)
+                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")' % (
@@ -124,6 +145,13 @@ class TestPmdrssHash(TestCase):
                 self.tester.scapy_append(packet)
                 self.tester.scapy_execute()
                 time.sleep(.5)
+        elif tran_type == "ipv6-tcp-syn-no-ack":
+            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)
         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")' % (
@@ -131,6 +159,20 @@ class TestPmdrssHash(TestCase):
                 self.tester.scapy_append(packet)
                 self.tester.scapy_execute()
                 time.sleep(.5)
+        elif tran_type == "ipv6-udp-unicast":
+            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)
+        elif tran_type == "ipv6-udp-multicast":
+            for i in range(10):
+                packet = r'sendp([Ether(dst="33:33:88:88:88:88", src=get_if_hwaddr("%s"))/IPv6(src="3ffe:2501:200:1fff::%d", dst="FF1E:5555:6666:6666:7777:7777:8888:8888")/UDP(sport=1024,dport=1024)], iface="%s")' % (
+                    itf, i + 1, itf)
+                self.tester.scapy_append(packet)
+                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")/SCTP(sport=1024,dport=1024,tag=1)], iface="%s")' % (
@@ -154,7 +196,8 @@ class TestPmdrssHash(TestCase):
         reta_line = {}
         # collect the hash result and the queue id
         for line in lines:
-            line = line.strip()
+            print "line is %s" % line
+	    line = line.strip()
             if len(line) != 0 and line.strip().startswith("port "):
                 reta_line = {}
                 rexp = r"port (\d)/queue (\d{1,2}): received (\d) packets"
@@ -164,8 +207,8 @@ class TestPmdrssHash(TestCase):
                     reta_line["queue"] = m.group(2)
 
             elif len(line) != 0 and line.startswith(("src=",)):
-                if "RSS hash" not in line:
-                    continue
+                #if "RSS hash" not in line:
+                #    continue
                 for item in line.split("-"):
                     item = item.strip()
                     if(item.startswith("RSS hash")):
@@ -203,10 +246,9 @@ class TestPmdrssHash(TestCase):
             dts.results_table_add_row(
                 [i, tmp_reta_line["RSS hash"], hash_index, reta_entries[hash_index], tmp_reta_line["queue"], status])
             i = i + 1
-
         dts.results_table_print()
         reta_lines = []
-        self.verify(sum(result) == 0, "the reta update function failed!")
+        self.verify(sum(result) == 0, "The actual-queue-id matches queue-id failed!")
 
     def send_packet_symmetric(self, itf, tran_type):
         """
@@ -243,6 +285,18 @@ class TestPmdrssHash(TestCase):
                 self.tester.scapy_append(packet)
                 self.tester.scapy_execute()
                 time.sleep(.5)
+        elif tran_type == "ipv4-tcp-syn-no-ack":
+            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")' % (
+                    mac, i + 2, i + 1, itf)
+                self.tester.scapy_append(packet)
+                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")' % (
@@ -255,7 +309,31 @@ class TestPmdrssHash(TestCase):
                 self.tester.scapy_append(packet)
                 self.tester.scapy_execute()
                 time.sleep(.5)
-        elif tran_type == "ipv4-sctp":
+        elif tran_type == "ipv4-udp-unicast":
+            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")' % (
+                    mac, i + 2, i + 1, itf)
+                self.tester.scapy_append(packet)
+                self.tester.scapy_execute()
+                time.sleep(.5)
+        elif tran_type == "ipv4-udp-multicast":
+            for i in range(4):
+                packet = r'sendp([Ether(dst="01:00:5e:57:91:e6")/IP(src="192.168.0.%d", dst="224.215.145.230")/UDP(sport=1024,dport=1025)], iface="%s")' % (
+                    i + 1, itf)
+                self.tester.scapy_append(packet)
+                self.tester.scapy_execute()
+                time.sleep(.5)
+                packet = r'sendp([Ether(dst="01:00:5e:57:91:e6")/IP(src="224.215.145.230", dst="192.168.0.%d")/UDP(sport=1025,dport=1024)], iface="%s")' % (
+                    i + 1, itf)
+                self.tester.scapy_append(packet)
+                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)
@@ -312,6 +390,19 @@ class TestPmdrssHash(TestCase):
                 self.tester.scapy_execute()
                 time.sleep(.5)
 
+        elif tran_type == "ipv6-tcp-syn-no-ack":
+            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")' % (
+                    mac, i + 2, i + 1, itf)
+                self.tester.scapy_append(packet)
+                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")' % (
@@ -324,6 +415,30 @@ class TestPmdrssHash(TestCase):
                 self.tester.scapy_append(packet)
                 self.tester.scapy_execute()
                 time.sleep(.5)
+        elif tran_type == "ipv6-udp-unicast":
+            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")' % (
+                    mac, i + 2, i + 1, itf)
+                self.tester.scapy_append(packet)
+                self.tester.scapy_execute()
+                time.sleep(.5)
+        elif tran_type == "ipv6-udp-multicast":
+            for i in range(4):
+                packet = r'sendp([Ether(dst="33:33:88:88:88:88")/IPv6(src="3ffe:2501:200:1fff::%d", dst="FF1E:5555:6666:6666:7777:7777:8888:8888")/UDP(sport=1024,dport=1025)], iface="%s")' % (
+                    i + 1, itf)
+                self.tester.scapy_append(packet)
+                self.tester.scapy_execute()
+                time.sleep(.5)
+                packet = r'sendp([Ether(dst="33:33:88:88:88:88")/IPv6(src="FF1E:5555:6666:6666:7777:7777:8888:8888", dst="3ffe:2501:200:1fff::%d")/UDP(sport=1025,dport=1024)], iface="%s")' % (
+                    i + 1, itf)
+                self.tester.scapy_append(packet)
+                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")/SCTP(sport=1024,dport=1025,tag=1)], iface="%s")' % (
@@ -442,7 +557,7 @@ class TestPmdrssHash(TestCase):
         localPort = self.tester.get_local_port(dutPorts[0])
         itf = self.tester.get_interface(localPort)
         global reta_num
-        iptypes = {'ipv4-sctp': 'sctp',
+	iptypes = {'ipv4-sctp': 'sctp',
                    'ipv4-other': 'ip',
                    'ipv4-frag': 'ip',
                    'ipv4-udp': 'udp',
@@ -455,6 +570,26 @@ class TestPmdrssHash(TestCase):
                    'ipv6-tcp': 'tcp',
                    'ipv6-frag': 'ip'
                    }
+	if (self.nic in ["fortpark_TLV"]):
+            iptypes = {'ipv4-sctp': 'sctp',
+                       'ipv4-other': 'ip',
+                       'ipv4-frag': 'ip',
+                       'ipv4-udp': 'udp',
+                       'ipv4-udp-unicast': 'udp',
+                       'ipv4-udp-multicast': 'udp',
+                       'ipv4-tcp': 'tcp',
+                       'ipv4-tcp-syn-no-ack': 'tcp',
+                       # this hash not support in dpdk2.0
+                       # 'l2_payload':'ether',
+                       'ipv6-other': 'ip',
+                       'ipv6-sctp': 'ip',
+                       'ipv6-udp': 'udp',
+                       'ipv6-udp-unicast': 'udp',
+                       'ipv6-udp-multicast': 'udp',
+                       'ipv6-tcp': 'tcp',
+                       'ipv6-tcp-syn-no-ack': 'tcp',
+                       'ipv6-frag': 'ip'
+                       }
 
         self.dut.kill_all()
 
@@ -493,7 +628,7 @@ class TestPmdrssHash(TestCase):
         localPort = self.tester.get_local_port(dutPorts[0])
         itf = self.tester.get_interface(localPort)
         global reta_num
-        iptypes = {'ipv4-sctp': 'sctp',
+	ptypes = {'ipv4-sctp': 'sctp',
                    'ipv4-other': 'ip',
                    'ipv4-frag': 'ip',
                    'ipv4-udp': 'udp',
@@ -506,6 +641,26 @@ class TestPmdrssHash(TestCase):
                    'ipv6-tcp': 'tcp',
                    'ipv6-frag': 'ip'
                    }
+        if (self.nic in ["fortpark_TLV"]):
+            iptypes = {'ipv4-sctp': 'sctp',
+                       'ipv4-other': 'ip',
+                       'ipv4-frag': 'ip',
+                       'ipv4-udp': 'udp',
+                       'ipv4-udp-unicast': 'udp',
+                       'ipv4-udp-multicast': 'udp',
+                       'ipv4-tcp': 'tcp',
+                       'ipv4-tcp-syn-no-ack': 'tcp',
+                       # this hash not support in dpdk2.0
+                       # 'l2_payload':'ether',
+                       'ipv6-other': 'ip',
+                       'ipv6-sctp': 'ip',
+                       'ipv6-udp': 'udp',
+                       'ipv6-udp-unicast': 'udp',
+                       'ipv6-udp-multicast': 'udp',
+                       'ipv6-tcp': 'tcp',
+                       'ipv6-tcp-syn-no-ack': 'tcp',
+                       'ipv6-frag': 'ip'
+                       }
 
         self.dut.kill_all()
 
@@ -551,7 +706,7 @@ class TestPmdrssHash(TestCase):
                    'ipv4-frag': 'ip',
                    'ipv4-udp': 'udp',
                    'ipv4-tcp': 'tcp',
-                   # this hass not support in dpdk 2.0
+                   # this hash not support in dpdk2.0
                    # 'l2_payload':'ether',
                    'ipv6-other': 'ip',
                    'ipv6-sctp': 'ip',
@@ -559,6 +714,27 @@ class TestPmdrssHash(TestCase):
                    'ipv6-tcp': 'tcp',
                    'ipv6-frag': 'ip'
                    }
+        if (self.nic in ["fortpark_TLV"]):
+            iptypes = {'ipv4-sctp': 'sctp',
+                       'ipv4-other': 'ip',
+                       'ipv4-frag': 'ip',
+                       'ipv4-udp': 'udp',
+                       'ipv4-udp-unicast': 'udp',
+                       'ipv4-udp-multicast': 'udp',
+                       'ipv4-tcp': 'tcp',
+                       'ipv4-tcp-syn-no-ack': 'tcp',
+                       # this hash not support in dpdk2.0
+                       # 'l2_payload':'ether',
+                       'ipv6-other': 'ip',
+                       'ipv6-sctp': 'ip',
+                       'ipv6-udp': 'udp',
+                       'ipv6-udp-unicast': 'udp',
+                       'ipv6-udp-multicast': 'udp',
+                       'ipv6-tcp': 'tcp',
+                       'ipv6-tcp-syn-no-ack': 'tcp',
+                       'ipv6-frag': 'ip'
+                       }
+           
         if self.kdriver in ["fm10k"]:
             iptypes.pop('ipv4-sctp')
             iptypes.pop('ipv6-sctp')
@@ -616,7 +792,28 @@ class TestPmdrssHash(TestCase):
                    'ipv6-tcp': 'tcp',
                    'ipv6-frag': 'ip'
                    }
-        self.dut.kill_all()
+        if (self.nic in ["fortpark_TLV"]):
+            iptypes = {'ipv4-sctp': 'sctp',
+                       'ipv4-other': 'ip',
+                       'ipv4-frag': 'ip',
+                       'ipv4-udp': 'udp',
+                       'ipv4-udp-unicast': 'udp',
+                       'ipv4-udp-multicast': 'udp',
+                       'ipv4-tcp': 'tcp',
+                       'ipv4-tcp-syn-no-ack': 'tcp',
+                       # this hash not support in dpdk2.0
+                       # 'l2_payload':'ether',
+                       'ipv6-other': 'ip',
+                       'ipv6-sctp': 'ip',
+                       'ipv6-udp': 'udp',
+                       'ipv6-udp-unicast': 'udp',
+                       'ipv6-udp-multicast': 'udp',
+                       'ipv6-tcp': 'tcp',
+                       'ipv6-tcp-syn-no-ack': 'tcp',
+                       'ipv6-frag': 'ip'
+                       }
+
+	self.dut.kill_all()
 
         # test with different rss queues
         for queue in testQueues:
-- 
2.5.0

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-09-12  6:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-12  6:48 [dts] [PATCH] tests pmdrss_hash: add new PCTYPE to fortpark_TLV Peng yuan

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