test suite reviews and discussions
 help / color / Atom feed
* [dts] [PATCH] ptype_mapping: Add support to run 'get test' on cavium devices
@ 2019-09-09 13:23 pvukkisala
  2019-09-18 10:35 ` Tu, Lijuan
  2019-09-20  6:22 ` Li, WenjieX A
  0 siblings, 2 replies; 4+ messages in thread
From: pvukkisala @ 2019-09-09 13:23 UTC (permalink / raw)
  To: dts; +Cc: avijay, fmasood, Phanendra Vukkisala

From: Phanendra Vukkisala <pvukkisala@marvell.com>

Modified commands and output according implementation for cavium platform for cavium devices

Signed-off-by: Phanendra Vukkisala <pvukkisala@marvell.com>
---
 tests/TestSuite_ptype_mapping.py |  122 +++++++++++++++++++++++++-------------
 1 file changed, 82 insertions(+), 40 deletions(-)

diff --git a/tests/TestSuite_ptype_mapping.py b/tests/TestSuite_ptype_mapping.py
index d7af657..8b8306c 100644
--- a/tests/TestSuite_ptype_mapping.py
+++ b/tests/TestSuite_ptype_mapping.py
@@ -45,21 +45,23 @@ class TestPtype_Mapping(TestCase):
         Run at the start of each test suite.
         """
         self.verify(self.nic in ['fortville_eagle', 'fortville_spirit',
-            'fortville_spirit_single', 'fortville_25g', 'fortpark_TLV', 'carlsville'],
+            'fortville_spirit_single', 'fortville_25g', 'fortpark_TLV', 'carlsville', 'cavium_a063', 'cavium_a064'],
             'ptype mapping test can not support %s nic' % self.nic)
         ports = self.dut.get_ports()
-        self.verify(len(ports) >= 1, "Insufficient ports for testing")  
+        self.verify(len(ports) >= 1, "Insufficient ports for testing")
         valports = [_ for _ in ports if self.tester.get_local_port(_) != -1]
         self.dut_port = valports[0]
         tester_port = self.tester.get_local_port(self.dut_port)
         self.tester_iface = self.tester.get_interface(tester_port)
-        self.dut.send_expect("sed -i -e '" +\
-            "/printf(\" - VLAN tci=0x%x\", mb->vlan_tci);" +\
-            "/a\\\\t\\tprintf(\" - pktype: 0x%x\", mb->packet_type);'" +\
-            " app/test-pmd/util.c", "# ", 30, verify = True)
 
-        self.dut.build_install_dpdk(self.dut.target)
-        
+        if self.nic not in ["cavium_a063", "cavium_a064"]:
+            self.dut.send_expect("sed -i -e '" +\
+                "/printf(\" - VLAN tci=0x%x\", mb->vlan_tci);" +\
+                "/a\\\\t\\tprintf(\" - pktype: 0x%x\", mb->packet_type);'" +\
+                " app/test-pmd/util.c", "# ", 30, verify = True)
+
+            self.dut.build_install_dpdk(self.dut.target)
+
 
     def set_up(self):
         """
@@ -83,16 +85,17 @@ class TestPtype_Mapping(TestCase):
             else:
                 pkt_names = pkt_types[pkt_type]
             pkt = Packet(pkt_type=pkt_type)
-            pkt.send_pkt(tx_port=self.tester_iface)
+            pkt.send_pkt(tx_port=self.tester_iface,count=4)
             out = self.dut.get_session_output(timeout=2)
-            self.verify(sw_ptype in out,
-                "Failed to detect correct ptype value")
+            if sw_ptype != None:
+                self.verify(sw_ptype in out,
+                    "Failed to detect correct ptype value")
             for pkt_layer_name in pkt_names:
                 if pkt_layer_name not in out:
                     print utils.RED("Fail to detect %s" % pkt_layer_name)
                     raise VerifyFailure("Failed to detect %s" % pkt_layer_name)            
             print utils.GREEN("Detected %s successfully" % pkt_type)
-    
+
     def strip_ptype(self, table, hw_ptype):
         """
         Strip software packet type from packet mapping table.
@@ -113,35 +116,73 @@ class TestPtype_Mapping(TestCase):
         """
         Get ptype mapping table and run ptype test.
         """
-        out = self.dut_testpmd.execute_cmd('ptype mapping get 0 0')
-        time.sleep(3)
-        self.verify("255" in out,
-            "Failed to get 255 items ptype mapping table!!!")
-        out = self.dut_testpmd.execute_cmd('ptype mapping get 0 1')
-        time.sleep(3)
-        self.verify("166" in out,
-            "Failed to get 166 items ptype mapping table!!!")
-        sw_ptype = self.strip_ptype(out, hw_ptype)
-        if hw_ptype == 38:
+        if self.nic in ["cavium_a063", "cavium_a064"]:
+            out = self.dut_testpmd.execute_cmd('show port 0 ptypes')
+            ptype_list = ["L2_ETHER", "L3_IPV4", "INNER_L3_IPV6", "INNER_L4_UDP", "TUNNEL_GRE", "TUNNEL_NVGRE", "TUNNEL_GENEVE", "TUNNEL_VXLAN"]
+            for ptype in ptype_list :
+                self.verify( ptype in out, "Failed to get ptype: %s"%(ptype))
             pktType = {
-                "MAC_IP_IPv6_UDP_PKT":  
-                    ["L2_ETHER", "L3_IPV4_EXT_UNKNOWN",
-                     "TUNNEL_IP", "INNER_L3_IPV6_EXT_UNKNOWN",
+                "MAC_IP_IPv6_UDP_PKT":
+                    ["L2_ETHER", "L3_IPV4",
+                     "TUNNEL_IP", "INNER_L3_IPV6",
                      "INNER_L4_UDP"]
             }
-        elif hw_ptype == 75:
+            self.run_test(None, pktType, check_ptype)
             pktType = {
-                "MAC_IP_NVGRE_MAC_VLAN_IP_PKT": 
-                    ["L2_ETHER", "L3_IPV4_EXT_UNKNOWN",
-                     "TUNNEL_GRENAT", "INNER_L2_ETHER_VLAN",
-                     "INNER_L3_IPV4_EXT_UNKNOWN", "INNER_L4_NONFRAG"]
-            }       
-        self.run_test(sw_ptype, pktType, check_ptype)
-    
+                "MAC_IP_NVGRE_MAC_VLAN_IP_UDP_PKT":
+                    ["L2_ETHER", "L3_IPV4",
+                     "TUNNEL_NVGRE", "INNER_L2_ETHER_VLAN",
+                     "INNER_L3_IPV4", "INNER_L4_UDP"]
+            }
+            self.run_test(None, pktType, check_ptype)
+            pktType = {
+                "MAC_IP_UDP_VXLAN_MAC_IP_UDP_PKT":
+                    ["L2_ETHER", "L3_IPV4",
+                     "TUNNEL_VXLAN",
+                     "INNER_L3_IPV4", "INNER_L4_UDP"]
+            }
+            self.run_test(None, pktType, check_ptype)
+            pktType = {
+                "MAC_IP_UDP_GENEVE_MAC_IP_UDP_PKT":
+                    ["L2_ETHER", "L3_IPV4",
+                     "TUNNEL_GENEVE",
+                     "INNER_L3_IPV4", "INNER_L4_UDP"]
+            }
+            self.run_test(None, pktType, check_ptype)
+        else:
+            out = self.dut_testpmd.execute_cmd('ptype mapping get 0 0')
+            time.sleep(3)
+            self.verify("255" in out,
+                "Failed to get 255 items ptype mapping table!!!")
+            out = self.dut_testpmd.execute_cmd('ptype mapping get 0 1')
+            time.sleep(3)
+            self.verify("166" in out,
+                "Failed to get 166 items ptype mapping table!!!")
+            sw_ptype = self.strip_ptype(out, hw_ptype)
+            sw_ptype = None
+            if hw_ptype == 38:
+                pktType = {
+                    "MAC_IP_IPv6_UDP_PKT":
+                        ["L2_ETHER", "L3_IPV4_EXT_UNKNOWN",
+                         "TUNNEL_IP", "INNER_L3_IPV6_EXT_UNKNOWN",
+                         "INNER_L4_UDP"]
+                }
+            elif hw_ptype == 75:
+                pktType = {
+                    "MAC_IP_NVGRE_MAC_VLAN_IP_UDP_PKT":
+                        ["L2_ETHER", "L3_IPV4_EXT_UNKNOWN",
+                         "TUNNEL_GRENAT", "INNER_L2_ETHER_VLAN",
+                         "INNER_L3_IPV4_EXT_UNKNOWN", "INNER_L4_NONFRAG"]
+                }
+            self.run_test(sw_ptype, pktType, check_ptype)
+
     def ptype_mapping_test(self, check_ptype = None):
-    
-        self.run_ptype_test(hw_ptype = 38, check_ptype = check_ptype)
-        self.run_ptype_test(hw_ptype = 75, check_ptype = check_ptype)
+
+        if self.nic in ["cavium_a063", "cavium_a064"]:
+            self.run_ptype_test(hw_ptype = None, check_ptype = check_ptype)
+        else:
+            self.run_ptype_test(hw_ptype = 38, check_ptype = check_ptype)
+            self.run_ptype_test(hw_ptype = 75, check_ptype = check_ptype)
 
 
     def test_ptype_mapping_get(self):
@@ -149,7 +190,7 @@ class TestPtype_Mapping(TestCase):
         Get hardware defined ptype to software defined ptype mapping items.
         """
         self.ptype_mapping_test()
-     
+
     def test_ptype_mapping_reset(self):
         """
         Reset packet mapping table after changing table.
@@ -230,7 +271,8 @@ class TestPtype_Mapping(TestCase):
         """
         Run after each test suite.
         """
-        self.dut.send_expect("sed -i '/printf(\" - pktype: 0x%x\", " +\
-            "mb->packet_type);/d' app/test-pmd/util.c", "# ", 30, verify = True)
-        self.dut.build_install_dpdk(self.dut.target)
+        if self.nic not in ["cavium_a063", "cavium_a064"]:
+            self.dut.send_expect("sed -i '/printf(\" - pktype: 0x%x\", " +\
+                "mb->packet_type);/d' app/test-pmd/util.c", "# ", 30, verify = True)
+            self.dut.build_install_dpdk(self.dut.target)
         self.dut.kill_all()
-- 
1.7.9.5


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

* Re: [dts] [PATCH] ptype_mapping: Add support to run 'get test' on cavium devices
  2019-09-09 13:23 [dts] [PATCH] ptype_mapping: Add support to run 'get test' on cavium devices pvukkisala
@ 2019-09-18 10:35 ` Tu, Lijuan
  2019-09-20  6:22 ` Li, WenjieX A
  1 sibling, 0 replies; 4+ messages in thread
From: Tu, Lijuan @ 2019-09-18 10:35 UTC (permalink / raw)
  To: pvukkisala, dts; +Cc: avijay, fmasood

Applied, thanks

> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of
> pvukkisala@marvell.com
> Sent: Monday, September 9, 2019 9:24 PM
> To: dts@dpdk.org
> Cc: avijay@marvell.com; fmasood@marvell.com; Phanendra Vukkisala
> <pvukkisala@marvell.com>
> Subject: [dts] [PATCH] ptype_mapping: Add support to run 'get test' on
> cavium devices
> 
> From: Phanendra Vukkisala <pvukkisala@marvell.com>
> 
> Modified commands and output according implementation for cavium
> platform for cavium devices
> 
> Signed-off-by: Phanendra Vukkisala <pvukkisala@marvell.com>
> ---
>  tests/TestSuite_ptype_mapping.py |  122 +++++++++++++++++++++++++------
> -------
>  1 file changed, 82 insertions(+), 40 deletions(-)
> 
> diff --git a/tests/TestSuite_ptype_mapping.py
> b/tests/TestSuite_ptype_mapping.py
> index d7af657..8b8306c 100644
> --- a/tests/TestSuite_ptype_mapping.py
> +++ b/tests/TestSuite_ptype_mapping.py
> @@ -45,21 +45,23 @@ class TestPtype_Mapping(TestCase):
>          Run at the start of each test suite.
>          """
>          self.verify(self.nic in ['fortville_eagle', 'fortville_spirit',
> -            'fortville_spirit_single', 'fortville_25g', 'fortpark_TLV', 'carlsville'],
> +            'fortville_spirit_single', 'fortville_25g', 'fortpark_TLV', 'carlsville',
> 'cavium_a063', 'cavium_a064'],
>              'ptype mapping test can not support %s nic' % self.nic)
>          ports = self.dut.get_ports()
> -        self.verify(len(ports) >= 1, "Insufficient ports for testing")
> +        self.verify(len(ports) >= 1, "Insufficient ports for testing")
>          valports = [_ for _ in ports if self.tester.get_local_port(_) != -1]
>          self.dut_port = valports[0]
>          tester_port = self.tester.get_local_port(self.dut_port)
>          self.tester_iface = self.tester.get_interface(tester_port)
> -        self.dut.send_expect("sed -i -e '" +\
> -            "/printf(\" - VLAN tci=0x%x\", mb->vlan_tci);" +\
> -            "/a\\\\t\\tprintf(\" - pktype: 0x%x\", mb->packet_type);'" +\
> -            " app/test-pmd/util.c", "# ", 30, verify = True)
> 
> -        self.dut.build_install_dpdk(self.dut.target)
> -
> +        if self.nic not in ["cavium_a063", "cavium_a064"]:
> +            self.dut.send_expect("sed -i -e '" +\
> +                "/printf(\" - VLAN tci=0x%x\", mb->vlan_tci);" +\
> +                "/a\\\\t\\tprintf(\" - pktype: 0x%x\", mb->packet_type);'" +\
> +                " app/test-pmd/util.c", "# ", 30, verify = True)
> +
> +            self.dut.build_install_dpdk(self.dut.target)
> +
> 
>      def set_up(self):
>          """
> @@ -83,16 +85,17 @@ class TestPtype_Mapping(TestCase):
>              else:
>                  pkt_names = pkt_types[pkt_type]
>              pkt = Packet(pkt_type=pkt_type)
> -            pkt.send_pkt(tx_port=self.tester_iface)
> +            pkt.send_pkt(tx_port=self.tester_iface,count=4)
>              out = self.dut.get_session_output(timeout=2)
> -            self.verify(sw_ptype in out,
> -                "Failed to detect correct ptype value")
> +            if sw_ptype != None:
> +                self.verify(sw_ptype in out,
> +                    "Failed to detect correct ptype value")
>              for pkt_layer_name in pkt_names:
>                  if pkt_layer_name not in out:
>                      print utils.RED("Fail to detect %s" % pkt_layer_name)
>                      raise VerifyFailure("Failed to detect %s" % pkt_layer_name)
>              print utils.GREEN("Detected %s successfully" % pkt_type)
> -
> +
>      def strip_ptype(self, table, hw_ptype):
>          """
>          Strip software packet type from packet mapping table.
> @@ -113,35 +116,73 @@ class TestPtype_Mapping(TestCase):
>          """
>          Get ptype mapping table and run ptype test.
>          """
> -        out = self.dut_testpmd.execute_cmd('ptype mapping get 0 0')
> -        time.sleep(3)
> -        self.verify("255" in out,
> -            "Failed to get 255 items ptype mapping table!!!")
> -        out = self.dut_testpmd.execute_cmd('ptype mapping get 0 1')
> -        time.sleep(3)
> -        self.verify("166" in out,
> -            "Failed to get 166 items ptype mapping table!!!")
> -        sw_ptype = self.strip_ptype(out, hw_ptype)
> -        if hw_ptype == 38:
> +        if self.nic in ["cavium_a063", "cavium_a064"]:
> +            out = self.dut_testpmd.execute_cmd('show port 0 ptypes')
> +            ptype_list = ["L2_ETHER", "L3_IPV4", "INNER_L3_IPV6",
> "INNER_L4_UDP", "TUNNEL_GRE", "TUNNEL_NVGRE", "TUNNEL_GENEVE",
> "TUNNEL_VXLAN"]
> +            for ptype in ptype_list :
> +                self.verify( ptype in out, "Failed to get ptype: %s"%(ptype))
>              pktType = {
> -                "MAC_IP_IPv6_UDP_PKT":
> -                    ["L2_ETHER", "L3_IPV4_EXT_UNKNOWN",
> -                     "TUNNEL_IP", "INNER_L3_IPV6_EXT_UNKNOWN",
> +                "MAC_IP_IPv6_UDP_PKT":
> +                    ["L2_ETHER", "L3_IPV4",
> +                     "TUNNEL_IP", "INNER_L3_IPV6",
>                       "INNER_L4_UDP"]
>              }
> -        elif hw_ptype == 75:
> +            self.run_test(None, pktType, check_ptype)
>              pktType = {
> -                "MAC_IP_NVGRE_MAC_VLAN_IP_PKT":
> -                    ["L2_ETHER", "L3_IPV4_EXT_UNKNOWN",
> -                     "TUNNEL_GRENAT", "INNER_L2_ETHER_VLAN",
> -                     "INNER_L3_IPV4_EXT_UNKNOWN", "INNER_L4_NONFRAG"]
> -            }
> -        self.run_test(sw_ptype, pktType, check_ptype)
> -
> +                "MAC_IP_NVGRE_MAC_VLAN_IP_UDP_PKT":
> +                    ["L2_ETHER", "L3_IPV4",
> +                     "TUNNEL_NVGRE", "INNER_L2_ETHER_VLAN",
> +                     "INNER_L3_IPV4", "INNER_L4_UDP"]
> +            }
> +            self.run_test(None, pktType, check_ptype)
> +            pktType = {
> +                "MAC_IP_UDP_VXLAN_MAC_IP_UDP_PKT":
> +                    ["L2_ETHER", "L3_IPV4",
> +                     "TUNNEL_VXLAN",
> +                     "INNER_L3_IPV4", "INNER_L4_UDP"]
> +            }
> +            self.run_test(None, pktType, check_ptype)
> +            pktType = {
> +                "MAC_IP_UDP_GENEVE_MAC_IP_UDP_PKT":
> +                    ["L2_ETHER", "L3_IPV4",
> +                     "TUNNEL_GENEVE",
> +                     "INNER_L3_IPV4", "INNER_L4_UDP"]
> +            }
> +            self.run_test(None, pktType, check_ptype)
> +        else:
> +            out = self.dut_testpmd.execute_cmd('ptype mapping get 0 0')
> +            time.sleep(3)
> +            self.verify("255" in out,
> +                "Failed to get 255 items ptype mapping table!!!")
> +            out = self.dut_testpmd.execute_cmd('ptype mapping get 0 1')
> +            time.sleep(3)
> +            self.verify("166" in out,
> +                "Failed to get 166 items ptype mapping table!!!")
> +            sw_ptype = self.strip_ptype(out, hw_ptype)
> +            sw_ptype = None
> +            if hw_ptype == 38:
> +                pktType = {
> +                    "MAC_IP_IPv6_UDP_PKT":
> +                        ["L2_ETHER", "L3_IPV4_EXT_UNKNOWN",
> +                         "TUNNEL_IP", "INNER_L3_IPV6_EXT_UNKNOWN",
> +                         "INNER_L4_UDP"]
> +                }
> +            elif hw_ptype == 75:
> +                pktType = {
> +                    "MAC_IP_NVGRE_MAC_VLAN_IP_UDP_PKT":
> +                        ["L2_ETHER", "L3_IPV4_EXT_UNKNOWN",
> +                         "TUNNEL_GRENAT", "INNER_L2_ETHER_VLAN",
> +                         "INNER_L3_IPV4_EXT_UNKNOWN", "INNER_L4_NONFRAG"]
> +                }
> +            self.run_test(sw_ptype, pktType, check_ptype)
> +
>      def ptype_mapping_test(self, check_ptype = None):
> -
> -        self.run_ptype_test(hw_ptype = 38, check_ptype = check_ptype)
> -        self.run_ptype_test(hw_ptype = 75, check_ptype = check_ptype)
> +
> +        if self.nic in ["cavium_a063", "cavium_a064"]:
> +            self.run_ptype_test(hw_ptype = None, check_ptype = check_ptype)
> +        else:
> +            self.run_ptype_test(hw_ptype = 38, check_ptype = check_ptype)
> +            self.run_ptype_test(hw_ptype = 75, check_ptype = check_ptype)
> 
> 
>      def test_ptype_mapping_get(self):
> @@ -149,7 +190,7 @@ class TestPtype_Mapping(TestCase):
>          Get hardware defined ptype to software defined ptype mapping items.
>          """
>          self.ptype_mapping_test()
> -
> +
>      def test_ptype_mapping_reset(self):
>          """
>          Reset packet mapping table after changing table.
> @@ -230,7 +271,8 @@ class TestPtype_Mapping(TestCase):
>          """
>          Run after each test suite.
>          """
> -        self.dut.send_expect("sed -i '/printf(\" - pktype: 0x%x\", " +\
> -            "mb->packet_type);/d' app/test-pmd/util.c", "# ", 30, verify = True)
> -        self.dut.build_install_dpdk(self.dut.target)
> +        if self.nic not in ["cavium_a063", "cavium_a064"]:
> +            self.dut.send_expect("sed -i '/printf(\" - pktype: 0x%x\", " +\
> +                "mb->packet_type);/d' app/test-pmd/util.c", "# ", 30, verify = True)
> +            self.dut.build_install_dpdk(self.dut.target)
>          self.dut.kill_all()
> --
> 1.7.9.5


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

* Re: [dts] [PATCH] ptype_mapping: Add support to run 'get test' on cavium devices
  2019-09-09 13:23 [dts] [PATCH] ptype_mapping: Add support to run 'get test' on cavium devices pvukkisala
  2019-09-18 10:35 ` Tu, Lijuan
@ 2019-09-20  6:22 ` Li, WenjieX A
  2019-09-20 16:26   ` Phanendra Vukkisala
  1 sibling, 1 reply; 4+ messages in thread
From: Li, WenjieX A @ 2019-09-20  6:22 UTC (permalink / raw)
  To: pvukkisala; +Cc: avijay, fmasood, dts

[-- Attachment #1: Type: text/plain, Size: 9659 bytes --]

Hi Phanendra,

With your patch, ptype_mapping failed with ALL i40e NICs: "Failed to detect INNER_L4_NONFRAG". 
Attach a log for you.
Could you please help to debug it? 
Thank you!

BR,
Wenjie

> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of
> pvukkisala@marvell.com
> Sent: Monday, September 9, 2019 9:24 PM
> To: dts@dpdk.org
> Cc: avijay@marvell.com; fmasood@marvell.com; Phanendra Vukkisala
> <pvukkisala@marvell.com>
> Subject: [dts] [PATCH] ptype_mapping: Add support to run 'get test' on cavium
> devices
> 
> From: Phanendra Vukkisala <pvukkisala@marvell.com>
> 
> Modified commands and output according implementation for cavium platform
> for cavium devices
> 
> Signed-off-by: Phanendra Vukkisala <pvukkisala@marvell.com>
> ---
>  tests/TestSuite_ptype_mapping.py |  122 +++++++++++++++++++++++++---------
> ----
>  1 file changed, 82 insertions(+), 40 deletions(-)
> 
> diff --git a/tests/TestSuite_ptype_mapping.py
> b/tests/TestSuite_ptype_mapping.py
> index d7af657..8b8306c 100644
> --- a/tests/TestSuite_ptype_mapping.py
> +++ b/tests/TestSuite_ptype_mapping.py
> @@ -45,21 +45,23 @@ class TestPtype_Mapping(TestCase):
>          Run at the start of each test suite.
>          """
>          self.verify(self.nic in ['fortville_eagle', 'fortville_spirit',
> -            'fortville_spirit_single', 'fortville_25g', 'fortpark_TLV', 'carlsville'],
> +            'fortville_spirit_single', 'fortville_25g', 'fortpark_TLV', 'carlsville',
> 'cavium_a063', 'cavium_a064'],
>              'ptype mapping test can not support %s nic' % self.nic)
>          ports = self.dut.get_ports()
> -        self.verify(len(ports) >= 1, "Insufficient ports for testing")
> +        self.verify(len(ports) >= 1, "Insufficient ports for testing")
>          valports = [_ for _ in ports if self.tester.get_local_port(_) != -1]
>          self.dut_port = valports[0]
>          tester_port = self.tester.get_local_port(self.dut_port)
>          self.tester_iface = self.tester.get_interface(tester_port)
> -        self.dut.send_expect("sed -i -e '" +\
> -            "/printf(\" - VLAN tci=0x%x\", mb->vlan_tci);" +\
> -            "/a\\\\t\\tprintf(\" - pktype: 0x%x\", mb->packet_type);'" +\
> -            " app/test-pmd/util.c", "# ", 30, verify = True)
> 
> -        self.dut.build_install_dpdk(self.dut.target)
> -
> +        if self.nic not in ["cavium_a063", "cavium_a064"]:
> +            self.dut.send_expect("sed -i -e '" +\
> +                "/printf(\" - VLAN tci=0x%x\", mb->vlan_tci);" +\
> +                "/a\\\\t\\tprintf(\" - pktype: 0x%x\", mb->packet_type);'" +\
> +                " app/test-pmd/util.c", "# ", 30, verify = True)
> +
> +            self.dut.build_install_dpdk(self.dut.target)
> +
> 
>      def set_up(self):
>          """
> @@ -83,16 +85,17 @@ class TestPtype_Mapping(TestCase):
>              else:
>                  pkt_names = pkt_types[pkt_type]
>              pkt = Packet(pkt_type=pkt_type)
> -            pkt.send_pkt(tx_port=self.tester_iface)
> +            pkt.send_pkt(tx_port=self.tester_iface,count=4)
>              out = self.dut.get_session_output(timeout=2)
> -            self.verify(sw_ptype in out,
> -                "Failed to detect correct ptype value")
> +            if sw_ptype != None:
> +                self.verify(sw_ptype in out,
> +                    "Failed to detect correct ptype value")
>              for pkt_layer_name in pkt_names:
>                  if pkt_layer_name not in out:
>                      print utils.RED("Fail to detect %s" % pkt_layer_name)
>                      raise VerifyFailure("Failed to detect %s" % pkt_layer_name)
>              print utils.GREEN("Detected %s successfully" % pkt_type)
> -
> +
>      def strip_ptype(self, table, hw_ptype):
>          """
>          Strip software packet type from packet mapping table.
> @@ -113,35 +116,73 @@ class TestPtype_Mapping(TestCase):
>          """
>          Get ptype mapping table and run ptype test.
>          """
> -        out = self.dut_testpmd.execute_cmd('ptype mapping get 0 0')
> -        time.sleep(3)
> -        self.verify("255" in out,
> -            "Failed to get 255 items ptype mapping table!!!")
> -        out = self.dut_testpmd.execute_cmd('ptype mapping get 0 1')
> -        time.sleep(3)
> -        self.verify("166" in out,
> -            "Failed to get 166 items ptype mapping table!!!")
> -        sw_ptype = self.strip_ptype(out, hw_ptype)
> -        if hw_ptype == 38:
> +        if self.nic in ["cavium_a063", "cavium_a064"]:
> +            out = self.dut_testpmd.execute_cmd('show port 0 ptypes')
> +            ptype_list = ["L2_ETHER", "L3_IPV4", "INNER_L3_IPV6",
> "INNER_L4_UDP", "TUNNEL_GRE", "TUNNEL_NVGRE", "TUNNEL_GENEVE",
> "TUNNEL_VXLAN"]
> +            for ptype in ptype_list :
> +                self.verify( ptype in out, "Failed to get ptype: %s"%(ptype))
>              pktType = {
> -                "MAC_IP_IPv6_UDP_PKT":
> -                    ["L2_ETHER", "L3_IPV4_EXT_UNKNOWN",
> -                     "TUNNEL_IP", "INNER_L3_IPV6_EXT_UNKNOWN",
> +                "MAC_IP_IPv6_UDP_PKT":
> +                    ["L2_ETHER", "L3_IPV4",
> +                     "TUNNEL_IP", "INNER_L3_IPV6",
>                       "INNER_L4_UDP"]
>              }
> -        elif hw_ptype == 75:
> +            self.run_test(None, pktType, check_ptype)
>              pktType = {
> -                "MAC_IP_NVGRE_MAC_VLAN_IP_PKT":
> -                    ["L2_ETHER", "L3_IPV4_EXT_UNKNOWN",
> -                     "TUNNEL_GRENAT", "INNER_L2_ETHER_VLAN",
> -                     "INNER_L3_IPV4_EXT_UNKNOWN", "INNER_L4_NONFRAG"]
> -            }
> -        self.run_test(sw_ptype, pktType, check_ptype)
> -
> +                "MAC_IP_NVGRE_MAC_VLAN_IP_UDP_PKT":
> +                    ["L2_ETHER", "L3_IPV4",
> +                     "TUNNEL_NVGRE", "INNER_L2_ETHER_VLAN",
> +                     "INNER_L3_IPV4", "INNER_L4_UDP"]
> +            }
> +            self.run_test(None, pktType, check_ptype)
> +            pktType = {
> +                "MAC_IP_UDP_VXLAN_MAC_IP_UDP_PKT":
> +                    ["L2_ETHER", "L3_IPV4",
> +                     "TUNNEL_VXLAN",
> +                     "INNER_L3_IPV4", "INNER_L4_UDP"]
> +            }
> +            self.run_test(None, pktType, check_ptype)
> +            pktType = {
> +                "MAC_IP_UDP_GENEVE_MAC_IP_UDP_PKT":
> +                    ["L2_ETHER", "L3_IPV4",
> +                     "TUNNEL_GENEVE",
> +                     "INNER_L3_IPV4", "INNER_L4_UDP"]
> +            }
> +            self.run_test(None, pktType, check_ptype)
> +        else:
> +            out = self.dut_testpmd.execute_cmd('ptype mapping get 0 0')
> +            time.sleep(3)
> +            self.verify("255" in out,
> +                "Failed to get 255 items ptype mapping table!!!")
> +            out = self.dut_testpmd.execute_cmd('ptype mapping get 0 1')
> +            time.sleep(3)
> +            self.verify("166" in out,
> +                "Failed to get 166 items ptype mapping table!!!")
> +            sw_ptype = self.strip_ptype(out, hw_ptype)
> +            sw_ptype = None
> +            if hw_ptype == 38:
> +                pktType = {
> +                    "MAC_IP_IPv6_UDP_PKT":
> +                        ["L2_ETHER", "L3_IPV4_EXT_UNKNOWN",
> +                         "TUNNEL_IP", "INNER_L3_IPV6_EXT_UNKNOWN",
> +                         "INNER_L4_UDP"]
> +                }
> +            elif hw_ptype == 75:
> +                pktType = {
> +                    "MAC_IP_NVGRE_MAC_VLAN_IP_UDP_PKT":
> +                        ["L2_ETHER", "L3_IPV4_EXT_UNKNOWN",
> +                         "TUNNEL_GRENAT", "INNER_L2_ETHER_VLAN",
> +                         "INNER_L3_IPV4_EXT_UNKNOWN", "INNER_L4_NONFRAG"]
> +                }
> +            self.run_test(sw_ptype, pktType, check_ptype)
> +
>      def ptype_mapping_test(self, check_ptype = None):
> -
> -        self.run_ptype_test(hw_ptype = 38, check_ptype = check_ptype)
> -        self.run_ptype_test(hw_ptype = 75, check_ptype = check_ptype)
> +
> +        if self.nic in ["cavium_a063", "cavium_a064"]:
> +            self.run_ptype_test(hw_ptype = None, check_ptype = check_ptype)
> +        else:
> +            self.run_ptype_test(hw_ptype = 38, check_ptype = check_ptype)
> +            self.run_ptype_test(hw_ptype = 75, check_ptype = check_ptype)
> 
> 
>      def test_ptype_mapping_get(self):
> @@ -149,7 +190,7 @@ class TestPtype_Mapping(TestCase):
>          Get hardware defined ptype to software defined ptype mapping items.
>          """
>          self.ptype_mapping_test()
> -
> +
>      def test_ptype_mapping_reset(self):
>          """
>          Reset packet mapping table after changing table.
> @@ -230,7 +271,8 @@ class TestPtype_Mapping(TestCase):
>          """
>          Run after each test suite.
>          """
> -        self.dut.send_expect("sed -i '/printf(\" - pktype: 0x%x\", " +\
> -            "mb->packet_type);/d' app/test-pmd/util.c", "# ", 30, verify = True)
> -        self.dut.build_install_dpdk(self.dut.target)
> +        if self.nic not in ["cavium_a063", "cavium_a064"]:
> +            self.dut.send_expect("sed -i '/printf(\" - pktype: 0x%x\", " +\
> +                "mb->packet_type);/d' app/test-pmd/util.c", "# ", 30, verify = True)
> +            self.dut.build_install_dpdk(self.dut.target)
>          self.dut.kill_all()
> --
> 1.7.9.5


[-- Attachment #2: TestPtype_Mapping.log --]
[-- Type: application/octet-stream, Size: 204559 bytes --]

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

* Re: [dts] [PATCH] ptype_mapping: Add support to run 'get test' on cavium devices
  2019-09-20  6:22 ` Li, WenjieX A
@ 2019-09-20 16:26   ` Phanendra Vukkisala
  0 siblings, 0 replies; 4+ messages in thread
From: Phanendra Vukkisala @ 2019-09-20 16:26 UTC (permalink / raw)
  To: Li, WenjieX A; +Cc: Vijaya Bhaskar Annayyolla, Faisal Masood, dts

Hi Wenjie,

Thanks for validation of my patch. Submitted patch to fix this failure. 

Regards,
Phanendra

-----Original Message-----
From: Li, WenjieX A <wenjiex.a.li@intel.com> 
Sent: Friday, September 20, 2019 11:53 AM
To: Phanendra Vukkisala <pvukkisala@marvell.com>
Cc: Vijaya Bhaskar Annayyolla <avijay@marvell.com>; Faisal Masood <fmasood@marvell.com>; dts@dpdk.org
Subject: [EXT] RE: [dts] [PATCH] ptype_mapping: Add support to run 'get test' on cavium devices

External Email

----------------------------------------------------------------------
Hi Phanendra,

With your patch, ptype_mapping failed with ALL i40e NICs: "Failed to detect INNER_L4_NONFRAG". 
Attach a log for you.
Could you please help to debug it? 
Thank you!

BR,
Wenjie

> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of 
> pvukkisala@marvell.com
> Sent: Monday, September 9, 2019 9:24 PM
> To: dts@dpdk.org
> Cc: avijay@marvell.com; fmasood@marvell.com; Phanendra Vukkisala 
> <pvukkisala@marvell.com>
> Subject: [dts] [PATCH] ptype_mapping: Add support to run 'get test' on 
> cavium devices
> 
> From: Phanendra Vukkisala <pvukkisala@marvell.com>
> 
> Modified commands and output according implementation for cavium 
> platform for cavium devices
> 
> Signed-off-by: Phanendra Vukkisala <pvukkisala@marvell.com>
> ---
>  tests/TestSuite_ptype_mapping.py |  122 
> +++++++++++++++++++++++++---------
> ----
>  1 file changed, 82 insertions(+), 40 deletions(-)
> 
> diff --git a/tests/TestSuite_ptype_mapping.py
> b/tests/TestSuite_ptype_mapping.py
> index d7af657..8b8306c 100644
> --- a/tests/TestSuite_ptype_mapping.py
> +++ b/tests/TestSuite_ptype_mapping.py
> @@ -45,21 +45,23 @@ class TestPtype_Mapping(TestCase):
>          Run at the start of each test suite.
>          """
>          self.verify(self.nic in ['fortville_eagle', 'fortville_spirit',
> -            'fortville_spirit_single', 'fortville_25g', 'fortpark_TLV', 'carlsville'],
> +            'fortville_spirit_single', 'fortville_25g', 
> + 'fortpark_TLV', 'carlsville',
> 'cavium_a063', 'cavium_a064'],
>              'ptype mapping test can not support %s nic' % self.nic)
>          ports = self.dut.get_ports()
> -        self.verify(len(ports) >= 1, "Insufficient ports for testing")
> +        self.verify(len(ports) >= 1, "Insufficient ports for 
> + testing")
>          valports = [_ for _ in ports if self.tester.get_local_port(_) != -1]
>          self.dut_port = valports[0]
>          tester_port = self.tester.get_local_port(self.dut_port)
>          self.tester_iface = self.tester.get_interface(tester_port)
> -        self.dut.send_expect("sed -i -e '" +\
> -            "/printf(\" - VLAN tci=0x%x\", mb->vlan_tci);" +\
> -            "/a\\\\t\\tprintf(\" - pktype: 0x%x\", mb->packet_type);'" +\
> -            " app/test-pmd/util.c", "# ", 30, verify = True)
> 
> -        self.dut.build_install_dpdk(self.dut.target)
> -
> +        if self.nic not in ["cavium_a063", "cavium_a064"]:
> +            self.dut.send_expect("sed -i -e '" +\
> +                "/printf(\" - VLAN tci=0x%x\", mb->vlan_tci);" +\
> +                "/a\\\\t\\tprintf(\" - pktype: 0x%x\", mb->packet_type);'" +\
> +                " app/test-pmd/util.c", "# ", 30, verify = True)
> +
> +            self.dut.build_install_dpdk(self.dut.target)
> +
> 
>      def set_up(self):
>          """
> @@ -83,16 +85,17 @@ class TestPtype_Mapping(TestCase):
>              else:
>                  pkt_names = pkt_types[pkt_type]
>              pkt = Packet(pkt_type=pkt_type)
> -            pkt.send_pkt(tx_port=self.tester_iface)
> +            pkt.send_pkt(tx_port=self.tester_iface,count=4)
>              out = self.dut.get_session_output(timeout=2)
> -            self.verify(sw_ptype in out,
> -                "Failed to detect correct ptype value")
> +            if sw_ptype != None:
> +                self.verify(sw_ptype in out,
> +                    "Failed to detect correct ptype value")
>              for pkt_layer_name in pkt_names:
>                  if pkt_layer_name not in out:
>                      print utils.RED("Fail to detect %s" % pkt_layer_name)
>                      raise VerifyFailure("Failed to detect %s" % pkt_layer_name)
>              print utils.GREEN("Detected %s successfully" % pkt_type)
> -
> +
>      def strip_ptype(self, table, hw_ptype):
>          """
>          Strip software packet type from packet mapping table.
> @@ -113,35 +116,73 @@ class TestPtype_Mapping(TestCase):
>          """
>          Get ptype mapping table and run ptype test.
>          """
> -        out = self.dut_testpmd.execute_cmd('ptype mapping get 0 0')
> -        time.sleep(3)
> -        self.verify("255" in out,
> -            "Failed to get 255 items ptype mapping table!!!")
> -        out = self.dut_testpmd.execute_cmd('ptype mapping get 0 1')
> -        time.sleep(3)
> -        self.verify("166" in out,
> -            "Failed to get 166 items ptype mapping table!!!")
> -        sw_ptype = self.strip_ptype(out, hw_ptype)
> -        if hw_ptype == 38:
> +        if self.nic in ["cavium_a063", "cavium_a064"]:
> +            out = self.dut_testpmd.execute_cmd('show port 0 ptypes')
> +            ptype_list = ["L2_ETHER", "L3_IPV4", "INNER_L3_IPV6",
> "INNER_L4_UDP", "TUNNEL_GRE", "TUNNEL_NVGRE", "TUNNEL_GENEVE", 
> "TUNNEL_VXLAN"]
> +            for ptype in ptype_list :
> +                self.verify( ptype in out, "Failed to get ptype: 
> + %s"%(ptype))
>              pktType = {
> -                "MAC_IP_IPv6_UDP_PKT":
> -                    ["L2_ETHER", "L3_IPV4_EXT_UNKNOWN",
> -                     "TUNNEL_IP", "INNER_L3_IPV6_EXT_UNKNOWN",
> +                "MAC_IP_IPv6_UDP_PKT":
> +                    ["L2_ETHER", "L3_IPV4",
> +                     "TUNNEL_IP", "INNER_L3_IPV6",
>                       "INNER_L4_UDP"]
>              }
> -        elif hw_ptype == 75:
> +            self.run_test(None, pktType, check_ptype)
>              pktType = {
> -                "MAC_IP_NVGRE_MAC_VLAN_IP_PKT":
> -                    ["L2_ETHER", "L3_IPV4_EXT_UNKNOWN",
> -                     "TUNNEL_GRENAT", "INNER_L2_ETHER_VLAN",
> -                     "INNER_L3_IPV4_EXT_UNKNOWN", "INNER_L4_NONFRAG"]
> -            }
> -        self.run_test(sw_ptype, pktType, check_ptype)
> -
> +                "MAC_IP_NVGRE_MAC_VLAN_IP_UDP_PKT":
> +                    ["L2_ETHER", "L3_IPV4",
> +                     "TUNNEL_NVGRE", "INNER_L2_ETHER_VLAN",
> +                     "INNER_L3_IPV4", "INNER_L4_UDP"]
> +            }
> +            self.run_test(None, pktType, check_ptype)
> +            pktType = {
> +                "MAC_IP_UDP_VXLAN_MAC_IP_UDP_PKT":
> +                    ["L2_ETHER", "L3_IPV4",
> +                     "TUNNEL_VXLAN",
> +                     "INNER_L3_IPV4", "INNER_L4_UDP"]
> +            }
> +            self.run_test(None, pktType, check_ptype)
> +            pktType = {
> +                "MAC_IP_UDP_GENEVE_MAC_IP_UDP_PKT":
> +                    ["L2_ETHER", "L3_IPV4",
> +                     "TUNNEL_GENEVE",
> +                     "INNER_L3_IPV4", "INNER_L4_UDP"]
> +            }
> +            self.run_test(None, pktType, check_ptype)
> +        else:
> +            out = self.dut_testpmd.execute_cmd('ptype mapping get 0 0')
> +            time.sleep(3)
> +            self.verify("255" in out,
> +                "Failed to get 255 items ptype mapping table!!!")
> +            out = self.dut_testpmd.execute_cmd('ptype mapping get 0 1')
> +            time.sleep(3)
> +            self.verify("166" in out,
> +                "Failed to get 166 items ptype mapping table!!!")
> +            sw_ptype = self.strip_ptype(out, hw_ptype)
> +            sw_ptype = None
> +            if hw_ptype == 38:
> +                pktType = {
> +                    "MAC_IP_IPv6_UDP_PKT":
> +                        ["L2_ETHER", "L3_IPV4_EXT_UNKNOWN",
> +                         "TUNNEL_IP", "INNER_L3_IPV6_EXT_UNKNOWN",
> +                         "INNER_L4_UDP"]
> +                }
> +            elif hw_ptype == 75:
> +                pktType = {
> +                    "MAC_IP_NVGRE_MAC_VLAN_IP_UDP_PKT":
> +                        ["L2_ETHER", "L3_IPV4_EXT_UNKNOWN",
> +                         "TUNNEL_GRENAT", "INNER_L2_ETHER_VLAN",
> +                         "INNER_L3_IPV4_EXT_UNKNOWN", "INNER_L4_NONFRAG"]
> +                }
> +            self.run_test(sw_ptype, pktType, check_ptype)
> +
>      def ptype_mapping_test(self, check_ptype = None):
> -
> -        self.run_ptype_test(hw_ptype = 38, check_ptype = check_ptype)
> -        self.run_ptype_test(hw_ptype = 75, check_ptype = check_ptype)
> +
> +        if self.nic in ["cavium_a063", "cavium_a064"]:
> +            self.run_ptype_test(hw_ptype = None, check_ptype = check_ptype)
> +        else:
> +            self.run_ptype_test(hw_ptype = 38, check_ptype = check_ptype)
> +            self.run_ptype_test(hw_ptype = 75, check_ptype = 
> + check_ptype)
> 
> 
>      def test_ptype_mapping_get(self):
> @@ -149,7 +190,7 @@ class TestPtype_Mapping(TestCase):
>          Get hardware defined ptype to software defined ptype mapping items.
>          """
>          self.ptype_mapping_test()
> -
> +
>      def test_ptype_mapping_reset(self):
>          """
>          Reset packet mapping table after changing table.
> @@ -230,7 +271,8 @@ class TestPtype_Mapping(TestCase):
>          """
>          Run after each test suite.
>          """
> -        self.dut.send_expect("sed -i '/printf(\" - pktype: 0x%x\", " +\
> -            "mb->packet_type);/d' app/test-pmd/util.c", "# ", 30, verify = True)
> -        self.dut.build_install_dpdk(self.dut.target)
> +        if self.nic not in ["cavium_a063", "cavium_a064"]:
> +            self.dut.send_expect("sed -i '/printf(\" - pktype: 0x%x\", " +\
> +                "mb->packet_type);/d' app/test-pmd/util.c", "# ", 30, verify = True)
> +            self.dut.build_install_dpdk(self.dut.target)
>          self.dut.kill_all()
> --
> 1.7.9.5


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

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-09 13:23 [dts] [PATCH] ptype_mapping: Add support to run 'get test' on cavium devices pvukkisala
2019-09-18 10:35 ` Tu, Lijuan
2019-09-20  6:22 ` Li, WenjieX A
2019-09-20 16:26   ` Phanendra Vukkisala

test suite reviews and discussions

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/dts/0 dts/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dts dts/ http://inbox.dpdk.org/dts \
		dts@dpdk.org
	public-inbox-index dts


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dts


AGPL code for this site: git clone https://public-inbox.org/ public-inbox