test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH V1 1/2] test_plans/vf_rss: delete unsupport NIC and optimize verify description.
@ 2019-07-19 18:16 Haiyang Zhao
  2019-07-19 18:16 ` [dts] [PATCH V1 2/2] tests/vf_rss: optmize vf_pmdrss and vf_pmdrss_reta Haiyang Zhao
  2019-08-06 10:11 ` [dts] [PATCH V1 1/2] test_plans/vf_rss: delete unsupport NIC and optimize verify description Tu, Lijuan
  0 siblings, 2 replies; 5+ messages in thread
From: Haiyang Zhao @ 2019-07-19 18:16 UTC (permalink / raw)
  To: dts; +Cc: xueqin.lin, Haiyang Zhao

*.for test_vfpmd_rss, it has no need to config rss reta.
*.delete niantic config rss reta description, as it not support.
*.add NICS with kernel driver i40e has 64 rss reta. 
*.add more description of verify rss reta test result.

Signed-off-by: Haiyang Zhao <haiyangx.zhao@intel.com>
---
 test_plans/vf_rss_test_plan.rst | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/test_plans/vf_rss_test_plan.rst b/test_plans/vf_rss_test_plan.rst
index 746b074..0e48f46 100644
--- a/test_plans/vf_rss_test_plan.rst
+++ b/test_plans/vf_rss_test_plan.rst
@@ -150,27 +150,23 @@ interactive commands of the ``testpmd`` application.
 
     ./usertools/dpdk-devbind.py --bind=igb_uio 00:06.0 00:07.0
 
-6. Reta Configuration.  128 reta entries configuration::
-
-     testpmd command: port config 0 rss reta (hash_index,queue_id)
-
-7. Pmd fwd only receive the packets::
+6. Pmd fwd only receive the packets::
 
      testpmd command: set fwd rxonly
 
-8. Rss received package type configuration two received packet types configuration::
+7. Rss received package type configuration two received packet types configuration::
 
      testpmd command: port config all rss ip/udp/tcp
 
-9. Verbose configuration::
+8. Verbose configuration::
 
      testpmd command: set verbose 8
 
-10. Start packet receive::
+9. Start packet receive::
 
       testpmd command: start
 
-11. Send different hash types' packets with different keywords, then check rx port
+10. Send different hash types' packets with different keywords, then check rx port
     could receive packets by different queues::
 
       sendp([Ether(dst="90:e2:ba:36:99:3c")/IP(src="192.168.0.4", dst="192.168.0.5")], iface="eth3")
@@ -181,6 +177,9 @@ Test Case:  test_reta
 
 This case test hash reta table, the test steps same with test_rss_hash except config hash reta table
 
-Before send packet, config hash reta,512(niantic NICs have 128 reta) reta entries configuration::
+Before send packet, config hash reta,512(NICS with kernel driver i40e has 64 reta) reta entries configuration::
 
   testpmd command: port config 0 rss reta (hash_index,queue_id)
+
+after send packet, based on the testpmd output RSS hash value to calculate hash_index, then check whether the
+actual receive queue is the queue configured in the reta.
-- 
2.17.1


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

* [dts] [PATCH V1 2/2] tests/vf_rss: optmize vf_pmdrss and vf_pmdrss_reta
  2019-07-19 18:16 [dts] [PATCH V1 1/2] test_plans/vf_rss: delete unsupport NIC and optimize verify description Haiyang Zhao
@ 2019-07-19 18:16 ` Haiyang Zhao
  2019-07-22  3:11   ` Zhang, YanX A
  2019-08-06 10:11   ` Tu, Lijuan
  2019-08-06 10:11 ` [dts] [PATCH V1 1/2] test_plans/vf_rss: delete unsupport NIC and optimize verify description Tu, Lijuan
  1 sibling, 2 replies; 5+ messages in thread
From: Haiyang Zhao @ 2019-07-19 18:16 UTC (permalink / raw)
  To: dts; +Cc: xueqin.lin, Haiyang Zhao

*.increase sent packet to 128 and check every queue can
   receive packet in vf_pmdrss.
*.modify iptypes and add rss config command in rss_reta.
*.modify rss reta size for different nics.
*.fix pep8 issue.

Signed-off-by: Haiyang Zhao <haiyangx.zhao@intel.com>
---
 tests/TestSuite_vf_rss.py | 110 +++++++++++++++++++++++++-------------
 1 file changed, 73 insertions(+), 37 deletions(-)

diff --git a/tests/TestSuite_vf_rss.py b/tests/TestSuite_vf_rss.py
index e5c19e2..e19a9a5 100644
--- a/tests/TestSuite_vf_rss.py
+++ b/tests/TestSuite_vf_rss.py
@@ -46,11 +46,12 @@ from test_case import TestCase
 from pmd_output import PmdOutput
 from virt_common import VM
 
+
 class TestVfRss(TestCase):
 
     supported_vf_driver = ['pci-stub', 'vfio-pci']
 
-    def send_packet(self, itf, tran_type):
+    def send_packet(self, itf, tran_type, queue, packet_count=16):
         """
         Sends packets.
         """
@@ -63,28 +64,35 @@ class TestVfRss(TestCase):
         mac = self.vm0_testpmd.get_port_mac(0)
         # send packet with different source and dest ip
         if tran_type == "ipv4-other":
-            for i in range(16):
+            for i in range(packet_count):
                 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)
+        elif tran_type == "ipv4-frag":
+            for i in range(packet_count):
+                packet = r'sendp([Ether(dst="%s", src="02:00:00:00:00:00")/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)
         elif tran_type == "ipv4-tcp":
-            for i in range(16):
+            for i in range(packet_count):
                 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)
         elif tran_type == "ipv4-udp":
-            for i in range(16):
+            for i in range(packet_count):
                 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)
         elif tran_type == "ipv4-sctp":
-            for i in range(16):
+            for i in range(packet_count):
                 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)
@@ -94,7 +102,7 @@ class TestVfRss(TestCase):
             self.tester.scapy_execute()
             time.sleep(.5)
         elif tran_type == "l2_payload":
-            for i in range(16):
+            for i in range(packet_count):
                 packet = r'sendp([Ether(src="00:00:00:00:00:%02d",dst="%s")], iface="%s")' % (
                     i + 1, mac, itf)
                 self.tester.scapy_append(packet)
@@ -102,28 +110,35 @@ class TestVfRss(TestCase):
             time.sleep(.5)
 
         elif tran_type == "ipv6-other":
-            for i in range(16):
+            for i in range(packet_count):
                 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)
+        elif tran_type == "ipv6-frag":
+            for i in range(packet_count):
+                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", nh=44)/IPv6ExtHdrFragment()], iface="%s")' % (
+                    mac, i + 1, i + 2, itf)
+                self.tester.scapy_append(packet)
+            self.tester.scapy_execute()
+            time.sleep(.5)
         elif tran_type == "ipv6-tcp":
-            for i in range(16):
+            for i in range(packet_count):
                 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)
         elif tran_type == "ipv6-udp":
-            for i in range(16):
+            for i in range(packet_count):
                 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)
         elif tran_type == "ipv6-sctp":
-            for i in range(16):
+            for i in range(packet_count):
                 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)
@@ -136,13 +151,14 @@ class TestVfRss(TestCase):
         else:
             print "\ntran_type error!\n"
 
-        #out = self.vm_dut_0.send_expect("stop", "testpmd>")
         out = self.vm_dut_0.get_session_output()
         print '*******************************************'
         print out
-        if  not reta_entries:
-           self.verify('RSS hash=' in out, 'rss faied')
-           return 
+        if not reta_entries:
+            # for test_vfpmd_rss, check every queue can receive packet.
+            for i in range(queue):
+                self.verify('RSS queue={}'.format(hex(i)) in out, 'queue {} did not receive packets'.format(i))
+            return
         lines = out.split("\r\n")
         out = ''
         reta_line = {}
@@ -153,13 +169,12 @@ class TestVfRss(TestCase):
             if len(line) != 0 and line.startswith(("src=",)):
                 for item in line.split("-"):
                     item = item.strip()
-                    if(item.startswith("RSS hash")):
+                    if item.startswith("RSS hash"):
                         name, value = item.split("=", 1)
                         print name + "-" + value
-
-                reta_line[name.strip()] = value.strip()
-                reta_lines.append(reta_line)
-                reta_line = {}
+                        reta_line[name.strip()] = value.strip()
+                        reta_lines.append(reta_line)
+                        reta_line = {}
             elif len(line) != 0 and line.strip().startswith("port "):
                 rexp = r"port (\d)/queue (\d{1,2}): received (\d) packets"
                 m = re.match(rexp, line.strip())
@@ -171,7 +186,6 @@ class TestVfRss(TestCase):
             else:
                 pass
         self.verifyResult()
-             
 
     def verifyResult(self):
         """
@@ -184,15 +198,19 @@ class TestVfRss(TestCase):
             ['packet index', 'hash value', 'hash index', 'queue id', 'actual queue id', 'pass '])
 
         i = 0
+        self.verify(len(reta_lines) > 0, "The testpmd output has no RSS hash!")
         for tmp_reta_line in reta_lines:
             status = "false"
             if self.kdriver == "fm10k":
                 # compute the hash result of five tuple into the 7 LSBs value.
                 hash_index = int(tmp_reta_line["RSS hash"], 16) % 128
-            else:
+            elif self.kdriver == 'i40e' or self.nic in ['sageville', 'sagepond']:
                 # compute the hash result of five tuple into the 7 LSBs value.
+                hash_index = int(tmp_reta_line["RSS hash"], 16) % 64
+            else:
                 hash_index = int(tmp_reta_line["RSS hash"], 16) % 512
-            if(reta_entries[hash_index] == int(tmp_reta_line["queue"])):
+
+            if reta_entries[hash_index] == int(tmp_reta_line["queue"]):
                 status = "true"
                 result.insert(i, 0)
             else:
@@ -212,7 +230,8 @@ class TestVfRss(TestCase):
         """
 
         self.verify(
-            self.nic in ["niantic", "fortville_eagle", "fortville_spirit", "fortville_spirit_single", "fortville_25g", "sageville", "fortpark_TLV"],
+            self.nic in ["redrockcanyou", "atwood", "boulderrapid", "fortville_eagle", "fortville_spirit",
+                         "fortville_spirit_single", "fortville_25g", "sageville", "sagepond", "fortpark_TLV"],
             "NIC Unsupported: " + str(self.nic))
         self.dut_ports = self.dut.get_ports(self.nic)
         self.verify(len(self.dut_ports) >= 1, "Not enough ports available")
@@ -237,6 +256,7 @@ class TestVfRss(TestCase):
         Run before each test case.
         """
         pass
+
     def setup_1pf_1vf_1vm_env(self, driver='default'):
         
         self.used_dut_port_0 = self.dut_ports[0]
@@ -244,7 +264,6 @@ class TestVfRss(TestCase):
         self.sriov_vfs_port_0 = self.dut.ports_info[self.used_dut_port_0]['vfs_port']
 
         try:
-
             for port in self.sriov_vfs_port_0:
                 port.bind_driver(self.vf_driver)
 
@@ -254,7 +273,7 @@ class TestVfRss(TestCase):
             if driver == 'igb_uio':
                 # start testpmd without the two VFs on the host
                 self.host_testpmd = PmdOutput(self.dut)
-                eal_param = '-b %(vf0)s -b %(vf1)s' % {'vf0': self.sriov_vfs_port_0[0].pci}
+                eal_param = '-b %(vf0)s ' % {'vf0': self.sriov_vfs_port_0[0].pci}
                 self.host_testpmd.start_testpmd("1S/2C/2T", eal_param=eal_param)
 
             # set up VM0 ENV
@@ -301,15 +320,23 @@ class TestVfRss(TestCase):
 
     def test_vf_pmdrss_reta(self):
         
-        # niantic kernel host driver not support this case
-        if self.nic is 'niantic' and not self.host_testpmd:
-            self.logger.warning("niantic kernel host driver not support this case")
-            return
         vm0dutPorts = self.vm_dut_0.get_ports('any')
         localPort = self.tester.get_local_port(vm0dutPorts[0])
         itf = self.tester.get_interface(localPort)
         self.vm0_ports_socket = self.vm_dut_0.get_numa_id(vm0dutPorts[0])
-        iptypes = ['IPV4']
+        iptypes = {
+                   'ipv4-other': 'ip',
+                   'ipv4-frag': 'ip',
+                   'ipv4-udp': 'udp',
+                   'ipv4-tcp': 'tcp',
+                   'ipv4-sctp': 'sctp',
+                   'ipv6-other': 'ip',
+                   'ipv6-frag': 'ip',
+                   'ipv6-udp': 'udp',
+                   'ipv6-tcp': 'tcp',
+                   'ipv6-sctp': 'sctp',
+                 #  'l2_payload': 'ether'
+                   }
 
         self.vm_dut_0.kill_all()
 
@@ -320,33 +347,42 @@ class TestVfRss(TestCase):
             self.vm0_testpmd.start_testpmd(
                 "all", "--rxq=%d --txq=%d %s" % (queue, queue, eal_param), socket=self.vm0_ports_socket)
 
-            for iptype in iptypes:
+            for iptype, rss_type in iptypes.items():
                 self.vm_dut_0.send_expect("set verbose 8", "testpmd> ")
                 self.vm_dut_0.send_expect("set fwd rxonly", "testpmd> ")
                 self.vm_dut_0.send_expect(
                     "set nbcore %d" % (queue + 1), "testpmd> ")
 
                 # configure the reta with specific mappings.
-                if(self.nic in ["niantic", "redrockcanyou", "atwood", "boulderrapid"]):
+                if self.nic in ["redrockcanyou", "atwood", "boulderrapid"]:
                     for i in range(128):
                         reta_entries.insert(i, random.randint(0, queue - 1))
                         self.vm_dut_0.send_expect(
                             "port config 0 rss reta (%d,%d)" % (i, reta_entries[i]), "testpmd> ")
+                    self.vm_dut_0.send_expect("port config all rss %s" % rss_type, "testpmd> ")
+                elif self.kdriver == 'i40e' or self.nic in ['sageville', 'sagepond']:
+                    for i in range(64):
+                        reta_entries.insert(i, random.randint(0, queue - 1))
+                        self.vm_dut_0.send_expect(
+                            "port config 0 rss reta (%d,%d)" % (i, reta_entries[i]), "testpmd> ")
+                    self.vm_dut_0.send_expect("port config all rss %s" % rss_type, "testpmd> ")
                 else:
                     for i in range(512):
                         reta_entries.insert(i, random.randint(0, queue - 1))
                         self.vm_dut_0.send_expect(
                             "port config 0 rss reta (%d,%d)" % (i, reta_entries[i]), "testpmd> ")
+                    self.vm_dut_0.send_expect("port config all rss %s" % rss_type, "testpmd> ")
 
-                self.send_packet(itf, iptype)
+                self.send_packet(itf, iptype, queue)
 
             self.vm_dut_0.send_expect("quit", "# ", 30)
+
     def test_vf_pmdrss(self): 
         vm0dutPorts = self.vm_dut_0.get_ports('any')
         localPort = self.tester.get_local_port(vm0dutPorts[0])
         itf = self.tester.get_interface(localPort)
         self.vm0_ports_socket = self.vm_dut_0.get_numa_id(vm0dutPorts[0])
-        iptypes = {'ipv4-sctp':'ip',
+        iptypes = {
                    'ipv4-other':'ip',
                    'ipv4-udp':'udp',
                    'ipv4-tcp':'tcp',
@@ -367,7 +403,7 @@ class TestVfRss(TestCase):
             self.vm0_testpmd.start_testpmd(
                 "all", "--rxq=%d --txq=%d %s" % (queue, queue, eal_param), socket=self.vm0_ports_socket)
 
-            for iptype,rsstype in iptypes.items():
+            for iptype, rsstype in iptypes.items():
                 self.vm_dut_0.send_expect("set verbose 8", "testpmd> ")
                 self.vm_dut_0.send_expect("set fwd rxonly", "testpmd> ")
                 out = self.vm_dut_0.send_expect("port config all rss %s" % rsstype, "testpmd> ")
@@ -375,9 +411,9 @@ class TestVfRss(TestCase):
                 self.vm_dut_0.send_expect(
                     "set nbcore %d" % (queue + 1), "testpmd> ")
 
-                self.send_packet(itf, iptype)
-
+                self.send_packet(itf, iptype, queue, 128)
             self.vm_dut_0.send_expect("quit", "# ", 30)
+
     def tear_down(self):
         """
         Run after each test case.
-- 
2.17.1


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

* Re: [dts] [PATCH V1 2/2] tests/vf_rss: optmize vf_pmdrss and vf_pmdrss_reta
  2019-07-19 18:16 ` [dts] [PATCH V1 2/2] tests/vf_rss: optmize vf_pmdrss and vf_pmdrss_reta Haiyang Zhao
@ 2019-07-22  3:11   ` Zhang, YanX A
  2019-08-06 10:11   ` Tu, Lijuan
  1 sibling, 0 replies; 5+ messages in thread
From: Zhang, YanX A @ 2019-07-22  3:11 UTC (permalink / raw)
  To: Zhao, HaiyangX, dts; +Cc: Lin, Xueqin, Zhao, HaiyangX

Tested-by:  Zhang, YanX A <yanx.a.zhang@intel.com>

-----Original Message-----
From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Haiyang Zhao
Sent: Saturday, July 20, 2019 2:17 AM
To: dts@dpdk.org
Cc: Lin, Xueqin <xueqin.lin@intel.com>; Zhao, HaiyangX <haiyangx.zhao@intel.com>
Subject: [dts] [PATCH V1 2/2] tests/vf_rss: optmize vf_pmdrss and vf_pmdrss_reta

*.increase sent packet to 128 and check every queue can
   receive packet in vf_pmdrss.
*.modify iptypes and add rss config command in rss_reta.
*.modify rss reta size for different nics.
*.fix pep8 issue.

Signed-off-by: Haiyang Zhao <haiyangx.zhao@intel.com>
---
 tests/TestSuite_vf_rss.py | 110 +++++++++++++++++++++++++-------------
 1 file changed, 73 insertions(+), 37 deletions(-)

diff --git a/tests/TestSuite_vf_rss.py b/tests/TestSuite_vf_rss.py index e5c19e2..e19a9a5 100644
--- a/tests/TestSuite_vf_rss.py
+++ b/tests/TestSuite_vf_rss.py
@@ -46,11 +46,12 @@ from test_case import TestCase  from pmd_output import PmdOutput  from virt_common import VM
 
+
 class TestVfRss(TestCase):
 
     supported_vf_driver = ['pci-stub', 'vfio-pci']
 
-    def send_packet(self, itf, tran_type):
+    def send_packet(self, itf, tran_type, queue, packet_count=16):
         """
         Sends packets.
         """
@@ -63,28 +64,35 @@ class TestVfRss(TestCase):
         mac = self.vm0_testpmd.get_port_mac(0)
         # send packet with different source and dest ip
         if tran_type == "ipv4-other":
-            for i in range(16):
+            for i in range(packet_count):
                 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)
+        elif tran_type == "ipv4-frag":
+            for i in range(packet_count):
+                packet = r'sendp([Ether(dst="%s", src="02:00:00:00:00:00")/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)
         elif tran_type == "ipv4-tcp":
-            for i in range(16):
+            for i in range(packet_count):
                 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)
         elif tran_type == "ipv4-udp":
-            for i in range(16):
+            for i in range(packet_count):
                 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)
         elif tran_type == "ipv4-sctp":
-            for i in range(16):
+            for i in range(packet_count):
                 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) @@ -94,7 +102,7 @@ class TestVfRss(TestCase):
             self.tester.scapy_execute()
             time.sleep(.5)
         elif tran_type == "l2_payload":
-            for i in range(16):
+            for i in range(packet_count):
                 packet = r'sendp([Ether(src="00:00:00:00:00:%02d",dst="%s")], iface="%s")' % (
                     i + 1, mac, itf)
                 self.tester.scapy_append(packet) @@ -102,28 +110,35 @@ class TestVfRss(TestCase):
             time.sleep(.5)
 
         elif tran_type == "ipv6-other":
-            for i in range(16):
+            for i in range(packet_count):
                 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)
+        elif tran_type == "ipv6-frag":
+            for i in range(packet_count):
+                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", nh=44)/IPv6ExtHdrFragment()], iface="%s")' % (
+                    mac, i + 1, i + 2, itf)
+                self.tester.scapy_append(packet)
+            self.tester.scapy_execute()
+            time.sleep(.5)
         elif tran_type == "ipv6-tcp":
-            for i in range(16):
+            for i in range(packet_count):
                 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)
         elif tran_type == "ipv6-udp":
-            for i in range(16):
+            for i in range(packet_count):
                 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)
         elif tran_type == "ipv6-sctp":
-            for i in range(16):
+            for i in range(packet_count):
                 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) @@ -136,13 +151,14 @@ class TestVfRss(TestCase):
         else:
             print "\ntran_type error!\n"
 
-        #out = self.vm_dut_0.send_expect("stop", "testpmd>")
         out = self.vm_dut_0.get_session_output()
         print '*******************************************'
         print out
-        if  not reta_entries:
-           self.verify('RSS hash=' in out, 'rss faied')
-           return 
+        if not reta_entries:
+            # for test_vfpmd_rss, check every queue can receive packet.
+            for i in range(queue):
+                self.verify('RSS queue={}'.format(hex(i)) in out, 'queue {} did not receive packets'.format(i))
+            return
         lines = out.split("\r\n")
         out = ''
         reta_line = {}
@@ -153,13 +169,12 @@ class TestVfRss(TestCase):
             if len(line) != 0 and line.startswith(("src=",)):
                 for item in line.split("-"):
                     item = item.strip()
-                    if(item.startswith("RSS hash")):
+                    if item.startswith("RSS hash"):
                         name, value = item.split("=", 1)
                         print name + "-" + value
-
-                reta_line[name.strip()] = value.strip()
-                reta_lines.append(reta_line)
-                reta_line = {}
+                        reta_line[name.strip()] = value.strip()
+                        reta_lines.append(reta_line)
+                        reta_line = {}
             elif len(line) != 0 and line.strip().startswith("port "):
                 rexp = r"port (\d)/queue (\d{1,2}): received (\d) packets"
                 m = re.match(rexp, line.strip()) @@ -171,7 +186,6 @@ class TestVfRss(TestCase):
             else:
                 pass
         self.verifyResult()
-             
 
     def verifyResult(self):
         """
@@ -184,15 +198,19 @@ class TestVfRss(TestCase):
             ['packet index', 'hash value', 'hash index', 'queue id', 'actual queue id', 'pass '])
 
         i = 0
+        self.verify(len(reta_lines) > 0, "The testpmd output has no RSS 
+ hash!")
         for tmp_reta_line in reta_lines:
             status = "false"
             if self.kdriver == "fm10k":
                 # compute the hash result of five tuple into the 7 LSBs value.
                 hash_index = int(tmp_reta_line["RSS hash"], 16) % 128
-            else:
+            elif self.kdriver == 'i40e' or self.nic in ['sageville', 'sagepond']:
                 # compute the hash result of five tuple into the 7 LSBs value.
+                hash_index = int(tmp_reta_line["RSS hash"], 16) % 64
+            else:
                 hash_index = int(tmp_reta_line["RSS hash"], 16) % 512
-            if(reta_entries[hash_index] == int(tmp_reta_line["queue"])):
+
+            if reta_entries[hash_index] == int(tmp_reta_line["queue"]):
                 status = "true"
                 result.insert(i, 0)
             else:
@@ -212,7 +230,8 @@ class TestVfRss(TestCase):
         """
 
         self.verify(
-            self.nic in ["niantic", "fortville_eagle", "fortville_spirit", "fortville_spirit_single", "fortville_25g", "sageville", "fortpark_TLV"],
+            self.nic in ["redrockcanyou", "atwood", "boulderrapid", "fortville_eagle", "fortville_spirit",
+                         "fortville_spirit_single", "fortville_25g", 
+ "sageville", "sagepond", "fortpark_TLV"],
             "NIC Unsupported: " + str(self.nic))
         self.dut_ports = self.dut.get_ports(self.nic)
         self.verify(len(self.dut_ports) >= 1, "Not enough ports available") @@ -237,6 +256,7 @@ class TestVfRss(TestCase):
         Run before each test case.
         """
         pass
+
     def setup_1pf_1vf_1vm_env(self, driver='default'):
         
         self.used_dut_port_0 = self.dut_ports[0] @@ -244,7 +264,6 @@ class TestVfRss(TestCase):
         self.sriov_vfs_port_0 = self.dut.ports_info[self.used_dut_port_0]['vfs_port']
 
         try:
-
             for port in self.sriov_vfs_port_0:
                 port.bind_driver(self.vf_driver)
 
@@ -254,7 +273,7 @@ class TestVfRss(TestCase):
             if driver == 'igb_uio':
                 # start testpmd without the two VFs on the host
                 self.host_testpmd = PmdOutput(self.dut)
-                eal_param = '-b %(vf0)s -b %(vf1)s' % {'vf0': self.sriov_vfs_port_0[0].pci}
+                eal_param = '-b %(vf0)s ' % {'vf0': 
+ self.sriov_vfs_port_0[0].pci}
                 self.host_testpmd.start_testpmd("1S/2C/2T", eal_param=eal_param)
 
             # set up VM0 ENV
@@ -301,15 +320,23 @@ class TestVfRss(TestCase):
 
     def test_vf_pmdrss_reta(self):
         
-        # niantic kernel host driver not support this case
-        if self.nic is 'niantic' and not self.host_testpmd:
-            self.logger.warning("niantic kernel host driver not support this case")
-            return
         vm0dutPorts = self.vm_dut_0.get_ports('any')
         localPort = self.tester.get_local_port(vm0dutPorts[0])
         itf = self.tester.get_interface(localPort)
         self.vm0_ports_socket = self.vm_dut_0.get_numa_id(vm0dutPorts[0])
-        iptypes = ['IPV4']
+        iptypes = {
+                   'ipv4-other': 'ip',
+                   'ipv4-frag': 'ip',
+                   'ipv4-udp': 'udp',
+                   'ipv4-tcp': 'tcp',
+                   'ipv4-sctp': 'sctp',
+                   'ipv6-other': 'ip',
+                   'ipv6-frag': 'ip',
+                   'ipv6-udp': 'udp',
+                   'ipv6-tcp': 'tcp',
+                   'ipv6-sctp': 'sctp',
+                 #  'l2_payload': 'ether'
+                   }
 
         self.vm_dut_0.kill_all()
 
@@ -320,33 +347,42 @@ class TestVfRss(TestCase):
             self.vm0_testpmd.start_testpmd(
                 "all", "--rxq=%d --txq=%d %s" % (queue, queue, eal_param), socket=self.vm0_ports_socket)
 
-            for iptype in iptypes:
+            for iptype, rss_type in iptypes.items():
                 self.vm_dut_0.send_expect("set verbose 8", "testpmd> ")
                 self.vm_dut_0.send_expect("set fwd rxonly", "testpmd> ")
                 self.vm_dut_0.send_expect(
                     "set nbcore %d" % (queue + 1), "testpmd> ")
 
                 # configure the reta with specific mappings.
-                if(self.nic in ["niantic", "redrockcanyou", "atwood", "boulderrapid"]):
+                if self.nic in ["redrockcanyou", "atwood", "boulderrapid"]:
                     for i in range(128):
                         reta_entries.insert(i, random.randint(0, queue - 1))
                         self.vm_dut_0.send_expect(
                             "port config 0 rss reta (%d,%d)" % (i, reta_entries[i]), "testpmd> ")
+                    self.vm_dut_0.send_expect("port config all rss %s" % rss_type, "testpmd> ")
+                elif self.kdriver == 'i40e' or self.nic in ['sageville', 'sagepond']:
+                    for i in range(64):
+                        reta_entries.insert(i, random.randint(0, queue - 1))
+                        self.vm_dut_0.send_expect(
+                            "port config 0 rss reta (%d,%d)" % (i, reta_entries[i]), "testpmd> ")
+                    self.vm_dut_0.send_expect("port config all rss %s" 
+ % rss_type, "testpmd> ")
                 else:
                     for i in range(512):
                         reta_entries.insert(i, random.randint(0, queue - 1))
                         self.vm_dut_0.send_expect(
                             "port config 0 rss reta (%d,%d)" % (i, reta_entries[i]), "testpmd> ")
+                    self.vm_dut_0.send_expect("port config all rss %s" 
+ % rss_type, "testpmd> ")
 
-                self.send_packet(itf, iptype)
+                self.send_packet(itf, iptype, queue)
 
             self.vm_dut_0.send_expect("quit", "# ", 30)
+
     def test_vf_pmdrss(self): 
         vm0dutPorts = self.vm_dut_0.get_ports('any')
         localPort = self.tester.get_local_port(vm0dutPorts[0])
         itf = self.tester.get_interface(localPort)
         self.vm0_ports_socket = self.vm_dut_0.get_numa_id(vm0dutPorts[0])
-        iptypes = {'ipv4-sctp':'ip',
+        iptypes = {
                    'ipv4-other':'ip',
                    'ipv4-udp':'udp',
                    'ipv4-tcp':'tcp',
@@ -367,7 +403,7 @@ class TestVfRss(TestCase):
             self.vm0_testpmd.start_testpmd(
                 "all", "--rxq=%d --txq=%d %s" % (queue, queue, eal_param), socket=self.vm0_ports_socket)
 
-            for iptype,rsstype in iptypes.items():
+            for iptype, rsstype in iptypes.items():
                 self.vm_dut_0.send_expect("set verbose 8", "testpmd> ")
                 self.vm_dut_0.send_expect("set fwd rxonly", "testpmd> ")
                 out = self.vm_dut_0.send_expect("port config all rss %s" % rsstype, "testpmd> ") @@ -375,9 +411,9 @@ class TestVfRss(TestCase):
                 self.vm_dut_0.send_expect(
                     "set nbcore %d" % (queue + 1), "testpmd> ")
 
-                self.send_packet(itf, iptype)
-
+                self.send_packet(itf, iptype, queue, 128)
             self.vm_dut_0.send_expect("quit", "# ", 30)
+
     def tear_down(self):
         """
         Run after each test case.
--
2.17.1


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

* Re: [dts] [PATCH V1 1/2] test_plans/vf_rss: delete unsupport NIC and optimize verify description.
  2019-07-19 18:16 [dts] [PATCH V1 1/2] test_plans/vf_rss: delete unsupport NIC and optimize verify description Haiyang Zhao
  2019-07-19 18:16 ` [dts] [PATCH V1 2/2] tests/vf_rss: optmize vf_pmdrss and vf_pmdrss_reta Haiyang Zhao
@ 2019-08-06 10:11 ` Tu, Lijuan
  1 sibling, 0 replies; 5+ messages in thread
From: Tu, Lijuan @ 2019-08-06 10:11 UTC (permalink / raw)
  To: Zhao, HaiyangX, dts; +Cc: Lin, Xueqin, Zhao, HaiyangX

Applied, thanks

> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Haiyang Zhao
> Sent: Saturday, July 20, 2019 2:17 AM
> To: dts@dpdk.org
> Cc: Lin, Xueqin <xueqin.lin@intel.com>; Zhao, HaiyangX
> <haiyangx.zhao@intel.com>
> Subject: [dts] [PATCH V1 1/2] test_plans/vf_rss: delete unsupport NIC and
> optimize verify description.
> 
> *.for test_vfpmd_rss, it has no need to config rss reta.
> *.delete niantic config rss reta description, as it not support.
> *.add NICS with kernel driver i40e has 64 rss reta.
> *.add more description of verify rss reta test result.
> 
> Signed-off-by: Haiyang Zhao <haiyangx.zhao@intel.com>
> ---
>  test_plans/vf_rss_test_plan.rst | 19 +++++++++----------
>  1 file changed, 9 insertions(+), 10 deletions(-)
> 
> diff --git a/test_plans/vf_rss_test_plan.rst b/test_plans/vf_rss_test_plan.rst
> index 746b074..0e48f46 100644
> --- a/test_plans/vf_rss_test_plan.rst
> +++ b/test_plans/vf_rss_test_plan.rst
> @@ -150,27 +150,23 @@ interactive commands of the ``testpmd``
> application.
> 
>      ./usertools/dpdk-devbind.py --bind=igb_uio 00:06.0 00:07.0
> 
> -6. Reta Configuration.  128 reta entries configuration::
> -
> -     testpmd command: port config 0 rss reta (hash_index,queue_id)
> -
> -7. Pmd fwd only receive the packets::
> +6. Pmd fwd only receive the packets::
> 
>       testpmd command: set fwd rxonly
> 
> -8. Rss received package type configuration two received packet types
> configuration::
> +7. Rss received package type configuration two received packet types
> configuration::
> 
>       testpmd command: port config all rss ip/udp/tcp
> 
> -9. Verbose configuration::
> +8. Verbose configuration::
> 
>       testpmd command: set verbose 8
> 
> -10. Start packet receive::
> +9. Start packet receive::
> 
>        testpmd command: start
> 
> -11. Send different hash types' packets with different keywords, then check
> rx port
> +10. Send different hash types' packets with different keywords, then
> +check rx port
>      could receive packets by different queues::
> 
>        sendp([Ether(dst="90:e2:ba:36:99:3c")/IP(src="192.168.0.4",
> dst="192.168.0.5")], iface="eth3") @@ -181,6 +177,9 @@ Test Case:
> test_reta
> 
>  This case test hash reta table, the test steps same with test_rss_hash except
> config hash reta table
> 
> -Before send packet, config hash reta,512(niantic NICs have 128 reta) reta
> entries configuration::
> +Before send packet, config hash reta,512(NICS with kernel driver i40e has 64
> reta) reta entries configuration::
> 
>    testpmd command: port config 0 rss reta (hash_index,queue_id)
> +
> +after send packet, based on the testpmd output RSS hash value to
> +calculate hash_index, then check whether the actual receive queue is the
> queue configured in the reta.
> --
> 2.17.1


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

* Re: [dts] [PATCH V1 2/2] tests/vf_rss: optmize vf_pmdrss and vf_pmdrss_reta
  2019-07-19 18:16 ` [dts] [PATCH V1 2/2] tests/vf_rss: optmize vf_pmdrss and vf_pmdrss_reta Haiyang Zhao
  2019-07-22  3:11   ` Zhang, YanX A
@ 2019-08-06 10:11   ` Tu, Lijuan
  1 sibling, 0 replies; 5+ messages in thread
From: Tu, Lijuan @ 2019-08-06 10:11 UTC (permalink / raw)
  To: Zhao, HaiyangX, dts; +Cc: Lin, Xueqin, Zhao, HaiyangX

Applied, thanks

> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Haiyang Zhao
> Sent: Saturday, July 20, 2019 2:17 AM
> To: dts@dpdk.org
> Cc: Lin, Xueqin <xueqin.lin@intel.com>; Zhao, HaiyangX
> <haiyangx.zhao@intel.com>
> Subject: [dts] [PATCH V1 2/2] tests/vf_rss: optmize vf_pmdrss and
> vf_pmdrss_reta
> 
> *.increase sent packet to 128 and check every queue can
>    receive packet in vf_pmdrss.
> *.modify iptypes and add rss config command in rss_reta.
> *.modify rss reta size for different nics.
> *.fix pep8 issue.
> 
> Signed-off-by: Haiyang Zhao <haiyangx.zhao@intel.com>
> ---
>  tests/TestSuite_vf_rss.py | 110 +++++++++++++++++++++++++-------------
>  1 file changed, 73 insertions(+), 37 deletions(-)
> 
> diff --git a/tests/TestSuite_vf_rss.py b/tests/TestSuite_vf_rss.py index
> e5c19e2..e19a9a5 100644
> --- a/tests/TestSuite_vf_rss.py
> +++ b/tests/TestSuite_vf_rss.py
> @@ -46,11 +46,12 @@ from test_case import TestCase  from pmd_output
> import PmdOutput  from virt_common import VM
> 
> +
>  class TestVfRss(TestCase):
> 
>      supported_vf_driver = ['pci-stub', 'vfio-pci']
> 
> -    def send_packet(self, itf, tran_type):
> +    def send_packet(self, itf, tran_type, queue, packet_count=16):
>          """
>          Sends packets.
>          """
> @@ -63,28 +64,35 @@ class TestVfRss(TestCase):
>          mac = self.vm0_testpmd.get_port_mac(0)
>          # send packet with different source and dest ip
>          if tran_type == "ipv4-other":
> -            for i in range(16):
> +            for i in range(packet_count):
>                  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)
> +        elif tran_type == "ipv4-frag":
> +            for i in range(packet_count):
> +                packet = r'sendp([Ether(dst="%s",
> src="02:00:00:00:00:00")/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)
>          elif tran_type == "ipv4-tcp":
> -            for i in range(16):
> +            for i in range(packet_count):
>                  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)
>          elif tran_type == "ipv4-udp":
> -            for i in range(16):
> +            for i in range(packet_count):
>                  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)
>          elif tran_type == "ipv4-sctp":
> -            for i in range(16):
> +            for i in range(packet_count):
>                  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) @@ -94,7 +102,7 @@ class
> TestVfRss(TestCase):
>              self.tester.scapy_execute()
>              time.sleep(.5)
>          elif tran_type == "l2_payload":
> -            for i in range(16):
> +            for i in range(packet_count):
>                  packet = r'sendp([Ether(src="00:00:00:00:00:%02d",dst="%s")],
> iface="%s")' % (
>                      i + 1, mac, itf)
>                  self.tester.scapy_append(packet) @@ -102,28 +110,35 @@ class
> TestVfRss(TestCase):
>              time.sleep(.5)
> 
>          elif tran_type == "ipv6-other":
> -            for i in range(16):
> +            for i in range(packet_count):
>                  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)
> +        elif tran_type == "ipv6-frag":
> +            for i in range(packet_count):
> +                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", nh=44)/IPv6ExtHdrFragment()], iface="%s")' % (
> +                    mac, i + 1, i + 2, itf)
> +                self.tester.scapy_append(packet)
> +            self.tester.scapy_execute()
> +            time.sleep(.5)
>          elif tran_type == "ipv6-tcp":
> -            for i in range(16):
> +            for i in range(packet_count):
>                  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)
>          elif tran_type == "ipv6-udp":
> -            for i in range(16):
> +            for i in range(packet_count):
>                  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)
>          elif tran_type == "ipv6-sctp":
> -            for i in range(16):
> +            for i in range(packet_count):
>                  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) @@ -136,13 +151,14 @@ class
> TestVfRss(TestCase):
>          else:
>              print "\ntran_type error!\n"
> 
> -        #out = self.vm_dut_0.send_expect("stop", "testpmd>")
>          out = self.vm_dut_0.get_session_output()
>          print '*******************************************'
>          print out
> -        if  not reta_entries:
> -           self.verify('RSS hash=' in out, 'rss faied')
> -           return
> +        if not reta_entries:
> +            # for test_vfpmd_rss, check every queue can receive packet.
> +            for i in range(queue):
> +                self.verify('RSS queue={}'.format(hex(i)) in out, 'queue {} did not
> receive packets'.format(i))
> +            return
>          lines = out.split("\r\n")
>          out = ''
>          reta_line = {}
> @@ -153,13 +169,12 @@ class TestVfRss(TestCase):
>              if len(line) != 0 and line.startswith(("src=",)):
>                  for item in line.split("-"):
>                      item = item.strip()
> -                    if(item.startswith("RSS hash")):
> +                    if item.startswith("RSS hash"):
>                          name, value = item.split("=", 1)
>                          print name + "-" + value
> -
> -                reta_line[name.strip()] = value.strip()
> -                reta_lines.append(reta_line)
> -                reta_line = {}
> +                        reta_line[name.strip()] = value.strip()
> +                        reta_lines.append(reta_line)
> +                        reta_line = {}
>              elif len(line) != 0 and line.strip().startswith("port "):
>                  rexp = r"port (\d)/queue (\d{1,2}): received (\d) packets"
>                  m = re.match(rexp, line.strip()) @@ -171,7 +186,6 @@ class
> TestVfRss(TestCase):
>              else:
>                  pass
>          self.verifyResult()
> -
> 
>      def verifyResult(self):
>          """
> @@ -184,15 +198,19 @@ class TestVfRss(TestCase):
>              ['packet index', 'hash value', 'hash index', 'queue id', 'actual queue id',
> 'pass '])
> 
>          i = 0
> +        self.verify(len(reta_lines) > 0, "The testpmd output has no RSS
> + hash!")
>          for tmp_reta_line in reta_lines:
>              status = "false"
>              if self.kdriver == "fm10k":
>                  # compute the hash result of five tuple into the 7 LSBs value.
>                  hash_index = int(tmp_reta_line["RSS hash"], 16) % 128
> -            else:
> +            elif self.kdriver == 'i40e' or self.nic in ['sageville', 'sagepond']:
>                  # compute the hash result of five tuple into the 7 LSBs value.
> +                hash_index = int(tmp_reta_line["RSS hash"], 16) % 64
> +            else:
>                  hash_index = int(tmp_reta_line["RSS hash"], 16) % 512
> -            if(reta_entries[hash_index] == int(tmp_reta_line["queue"])):
> +
> +            if reta_entries[hash_index] == int(tmp_reta_line["queue"]):
>                  status = "true"
>                  result.insert(i, 0)
>              else:
> @@ -212,7 +230,8 @@ class TestVfRss(TestCase):
>          """
> 
>          self.verify(
> -            self.nic in ["niantic", "fortville_eagle", "fortville_spirit",
> "fortville_spirit_single", "fortville_25g", "sageville", "fortpark_TLV"],
> +            self.nic in ["redrockcanyou", "atwood", "boulderrapid",
> "fortville_eagle", "fortville_spirit",
> +                         "fortville_spirit_single", "fortville_25g",
> + "sageville", "sagepond", "fortpark_TLV"],
>              "NIC Unsupported: " + str(self.nic))
>          self.dut_ports = self.dut.get_ports(self.nic)
>          self.verify(len(self.dut_ports) >= 1, "Not enough ports available") @@ -
> 237,6 +256,7 @@ class TestVfRss(TestCase):
>          Run before each test case.
>          """
>          pass
> +
>      def setup_1pf_1vf_1vm_env(self, driver='default'):
> 
>          self.used_dut_port_0 = self.dut_ports[0] @@ -244,7 +264,6 @@ class
> TestVfRss(TestCase):
>          self.sriov_vfs_port_0 =
> self.dut.ports_info[self.used_dut_port_0]['vfs_port']
> 
>          try:
> -
>              for port in self.sriov_vfs_port_0:
>                  port.bind_driver(self.vf_driver)
> 
> @@ -254,7 +273,7 @@ class TestVfRss(TestCase):
>              if driver == 'igb_uio':
>                  # start testpmd without the two VFs on the host
>                  self.host_testpmd = PmdOutput(self.dut)
> -                eal_param = '-b %(vf0)s -b %(vf1)s' % {'vf0':
> self.sriov_vfs_port_0[0].pci}
> +                eal_param = '-b %(vf0)s ' % {'vf0':
> + self.sriov_vfs_port_0[0].pci}
>                  self.host_testpmd.start_testpmd("1S/2C/2T",
> eal_param=eal_param)
> 
>              # set up VM0 ENV
> @@ -301,15 +320,23 @@ class TestVfRss(TestCase):
> 
>      def test_vf_pmdrss_reta(self):
> 
> -        # niantic kernel host driver not support this case
> -        if self.nic is 'niantic' and not self.host_testpmd:
> -            self.logger.warning("niantic kernel host driver not support this case")
> -            return
>          vm0dutPorts = self.vm_dut_0.get_ports('any')
>          localPort = self.tester.get_local_port(vm0dutPorts[0])
>          itf = self.tester.get_interface(localPort)
>          self.vm0_ports_socket = self.vm_dut_0.get_numa_id(vm0dutPorts[0])
> -        iptypes = ['IPV4']
> +        iptypes = {
> +                   'ipv4-other': 'ip',
> +                   'ipv4-frag': 'ip',
> +                   'ipv4-udp': 'udp',
> +                   'ipv4-tcp': 'tcp',
> +                   'ipv4-sctp': 'sctp',
> +                   'ipv6-other': 'ip',
> +                   'ipv6-frag': 'ip',
> +                   'ipv6-udp': 'udp',
> +                   'ipv6-tcp': 'tcp',
> +                   'ipv6-sctp': 'sctp',
> +                 #  'l2_payload': 'ether'
> +                   }
> 
>          self.vm_dut_0.kill_all()
> 
> @@ -320,33 +347,42 @@ class TestVfRss(TestCase):
>              self.vm0_testpmd.start_testpmd(
>                  "all", "--rxq=%d --txq=%d %s" % (queue, queue, eal_param),
> socket=self.vm0_ports_socket)
> 
> -            for iptype in iptypes:
> +            for iptype, rss_type in iptypes.items():
>                  self.vm_dut_0.send_expect("set verbose 8", "testpmd> ")
>                  self.vm_dut_0.send_expect("set fwd rxonly", "testpmd> ")
>                  self.vm_dut_0.send_expect(
>                      "set nbcore %d" % (queue + 1), "testpmd> ")
> 
>                  # configure the reta with specific mappings.
> -                if(self.nic in ["niantic", "redrockcanyou", "atwood",
> "boulderrapid"]):
> +                if self.nic in ["redrockcanyou", "atwood", "boulderrapid"]:
>                      for i in range(128):
>                          reta_entries.insert(i, random.randint(0, queue - 1))
>                          self.vm_dut_0.send_expect(
>                              "port config 0 rss reta (%d,%d)" % (i, reta_entries[i]),
> "testpmd> ")
> +                    self.vm_dut_0.send_expect("port config all rss %s" % rss_type,
> "testpmd> ")
> +                elif self.kdriver == 'i40e' or self.nic in ['sageville', 'sagepond']:
> +                    for i in range(64):
> +                        reta_entries.insert(i, random.randint(0, queue - 1))
> +                        self.vm_dut_0.send_expect(
> +                            "port config 0 rss reta (%d,%d)" % (i, reta_entries[i]),
> "testpmd> ")
> +                    self.vm_dut_0.send_expect("port config all rss %s"
> + % rss_type, "testpmd> ")
>                  else:
>                      for i in range(512):
>                          reta_entries.insert(i, random.randint(0, queue - 1))
>                          self.vm_dut_0.send_expect(
>                              "port config 0 rss reta (%d,%d)" % (i, reta_entries[i]),
> "testpmd> ")
> +                    self.vm_dut_0.send_expect("port config all rss %s"
> + % rss_type, "testpmd> ")
> 
> -                self.send_packet(itf, iptype)
> +                self.send_packet(itf, iptype, queue)
> 
>              self.vm_dut_0.send_expect("quit", "# ", 30)
> +
>      def test_vf_pmdrss(self):
>          vm0dutPorts = self.vm_dut_0.get_ports('any')
>          localPort = self.tester.get_local_port(vm0dutPorts[0])
>          itf = self.tester.get_interface(localPort)
>          self.vm0_ports_socket = self.vm_dut_0.get_numa_id(vm0dutPorts[0])
> -        iptypes = {'ipv4-sctp':'ip',
> +        iptypes = {
>                     'ipv4-other':'ip',
>                     'ipv4-udp':'udp',
>                     'ipv4-tcp':'tcp',
> @@ -367,7 +403,7 @@ class TestVfRss(TestCase):
>              self.vm0_testpmd.start_testpmd(
>                  "all", "--rxq=%d --txq=%d %s" % (queue, queue, eal_param),
> socket=self.vm0_ports_socket)
> 
> -            for iptype,rsstype in iptypes.items():
> +            for iptype, rsstype in iptypes.items():
>                  self.vm_dut_0.send_expect("set verbose 8", "testpmd> ")
>                  self.vm_dut_0.send_expect("set fwd rxonly", "testpmd> ")
>                  out = self.vm_dut_0.send_expect("port config all rss %s" % rsstype,
> "testpmd> ") @@ -375,9 +411,9 @@ class TestVfRss(TestCase):
>                  self.vm_dut_0.send_expect(
>                      "set nbcore %d" % (queue + 1), "testpmd> ")
> 
> -                self.send_packet(itf, iptype)
> -
> +                self.send_packet(itf, iptype, queue, 128)
>              self.vm_dut_0.send_expect("quit", "# ", 30)
> +
>      def tear_down(self):
>          """
>          Run after each test case.
> --
> 2.17.1


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

end of thread, other threads:[~2019-08-06 10:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-19 18:16 [dts] [PATCH V1 1/2] test_plans/vf_rss: delete unsupport NIC and optimize verify description Haiyang Zhao
2019-07-19 18:16 ` [dts] [PATCH V1 2/2] tests/vf_rss: optmize vf_pmdrss and vf_pmdrss_reta Haiyang Zhao
2019-07-22  3:11   ` Zhang, YanX A
2019-08-06 10:11   ` Tu, Lijuan
2019-08-06 10:11 ` [dts] [PATCH V1 1/2] test_plans/vf_rss: delete unsupport NIC and optimize verify description Tu, Lijuan

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