test suite reviews and discussions
 help / color / Atom feed
* [dts] [PATCH] pmd: Add test case packet checking in scalar mode for marvell device
@ 2019-08-27  6:48 pvukkisala
  2019-09-04  5:16 ` Tu, Lijuan
  0 siblings, 1 reply; 2+ messages in thread
From: pvukkisala @ 2019-08-27  6:48 UTC (permalink / raw)
  To: dts; +Cc: avijay, fmasood, Phanendra Vukkisala

From: Phanendra Vukkisala <pvukkisala@marvell.com>

Updated testplan, test script and support list.

Signed-off-by: Phanendra Vukkisala <pvukkisala@marvell.com>
---
 conf/test_case_supportlist.json |   16 +++++++++++++++
 test_plans/pmd_test_plan.rst    |   15 ++++++++++++++
 tests/TestSuite_pmd.py          |   41 ++++++++++++++++++++++++++++++++-------
 3 files changed, 65 insertions(+), 7 deletions(-)

diff --git a/conf/test_case_supportlist.json b/conf/test_case_supportlist.json
index f547b32..9c39f33 100644
--- a/conf/test_case_supportlist.json
+++ b/conf/test_case_supportlist.json
@@ -1612,5 +1612,21 @@
             "Bug ID": "",
             "Comments": "This case currently support for niantic "
         }
+    ],
+    "packet_checking_scalar_mode": [
+        {
+            "OS": [
+                "ALL"
+            ],
+            "NIC": [
+                "cavium_a064",
+                "cavium_a063"
+            ],
+            "Target": [
+                "ALL"
+            ],
+            "Bug ID": "",
+            "Comments": "This case currently support for cavium_a063 and cavium_a064 "
+        }
     ]
 }
diff --git a/test_plans/pmd_test_plan.rst b/test_plans/pmd_test_plan.rst
index a077cfa..f84fa55 100644
--- a/test_plans/pmd_test_plan.rst
+++ b/test_plans/pmd_test_plan.rst
@@ -92,6 +92,21 @@ Test Case: Packet Checking
    which will be forwarded by the DUT. The test checks if the packets are correctly forwarded and
    if both RX and TX packet sizes match by `show port all stats`
 
+Test Case: Packet Checking in scalar mode
+=========================================
+
+The linuxapp is started with the following parameters:
+
+::
+  -c 0x6 -n 4 -w <devid>,scalar_enable=1  -- -i --portmask=<portmask>
+
+
+This test is applicable for Marvell devices. The tester sends 1 packet at a
+time with different sizes (64, 65, 128, 256, 512, 1024, 1280 and 1518 bytes),
+using scapy, which will be forwarded by the DUT. The test checks if the packets
+are correctly forwarded and if both RX and TX packet sizes match.
+
+
 Test Case: Descriptors Checking
 ===============================
 
diff --git a/tests/TestSuite_pmd.py b/tests/TestSuite_pmd.py
index dc9078f..46141d6 100644
--- a/tests/TestSuite_pmd.py
+++ b/tests/TestSuite_pmd.py
@@ -386,6 +386,29 @@ class TestPmd(TestCase):
         self.dut.send_expect("quit", "# ", 30)
         sleep(5)
 
+    def test_packet_checking_scalar_mode(self):
+        """
+        Packet forwarding checking test
+        """
+
+        self.dut.kill_all()
+
+        port_mask = utils.create_mask([self.dut_ports[0], self.dut_ports[1]])
+
+        eal_opts = ""
+        for port in self.dut_ports:
+            eal_opts += "-w %s,scalar_enable=1 "%(self.dut.get_port_pci(self.dut_ports[port]))
+
+
+        self.pmdout.start_testpmd("1S/2C/1T", "--portmask=%s" % port_mask, eal_param = eal_opts, socket=self.ports_socket)
+        self.dut.send_expect("start", "testpmd> ")
+        for size in self.frame_sizes:
+            self.send_packet(size, scalar_test=True)
+
+        self.dut.send_expect("stop", "testpmd> ")
+        self.dut.send_expect("quit", "# ", 30)
+        sleep(5)
+
     def stop_and_get_l4csum_errors(self):
         """
         Stop forwarding and get Bad-l4csum number from stop statistic
@@ -406,7 +429,7 @@ class TestPmd(TestCase):
         stats = self.pmdout.get_pmd_stats(portid)
         return stats
 
-    def send_packet(self, frame_size, checksum_test=False):
+    def send_packet(self, frame_size, checksum_test=False, scalar_test=False):
         """
         Send 1 packet to portid
         """
@@ -428,10 +451,14 @@ class TestPmd(TestCase):
         if checksum_test:
             checksum = 'chksum=0x1'
 
+        if scalar_test:
+            pkt_count = 1
+        else:
+            pkt_count = 4
         self.tester.scapy_foreground()
         self.tester.scapy_append('nutmac="%s"' % mac)
-        self.tester.scapy_append('sendp([Ether(dst=nutmac, src="52:00:00:00:00:00")/IP(len=%s)/UDP(%s)/Raw(load="\x50"*%s)], iface="%s", count=4)' % (
-            load_size, checksum, padding, interface))
+        self.tester.scapy_append('sendp([Ether(dst=nutmac, src="52:00:00:00:00:00")/IP(len=%s)/UDP(%s)/Raw(load="\x50"*%s)], iface="%s", count=%s)' % (
+            load_size, checksum, padding, interface, pkt_count))
 
         out = self.tester.scapy_execute()
         time.sleep(.5)
@@ -452,11 +479,11 @@ class TestPmd(TestCase):
         self.verify(self.pmdout.check_tx_bytes(p0tx_pkts, p1rx_pkts),
                     "packet pass assert error, %d RX packets, %d TX packets" % (p1rx_pkts, p0tx_pkts))
 
-        self.verify(p1rx_bytes == (frame_size - 4)*4,
-                    "packet pass assert error, expected %d RX bytes, actual %d" % ((frame_size - 4)*4, p1rx_bytes))
+        self.verify(p1rx_bytes == (frame_size - 4)*pkt_count,
+                    "packet pass assert error, expected %d RX bytes, actual %d" % ((frame_size - 4)*pkt_count, p1rx_bytes))
 
-        self.verify(self.pmdout.check_tx_bytes(p0tx_bytes, (frame_size - 4)*4),
-                    "packet pass assert error, expected %d TX bytes, actual %d" % ((frame_size - 4)*4, p0tx_bytes))
+        self.verify(self.pmdout.check_tx_bytes(p0tx_bytes, (frame_size - 4)*pkt_count),
+                    "packet pass assert error, expected %d TX bytes, actual %d" % ((frame_size - 4)*pkt_count, p0tx_bytes))
 
         return out
 
-- 
1.7.9.5


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

* Re: [dts] [PATCH] pmd: Add test case packet checking in scalar mode for marvell device
  2019-08-27  6:48 [dts] [PATCH] pmd: Add test case packet checking in scalar mode for marvell device pvukkisala
@ 2019-09-04  5:16 ` Tu, Lijuan
  0 siblings, 0 replies; 2+ messages in thread
From: Tu, Lijuan @ 2019-09-04  5:16 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: Tuesday, August 27, 2019 2:48 PM
> To: dts@dpdk.org
> Cc: avijay@marvell.com; fmasood@marvell.com; Phanendra Vukkisala
> <pvukkisala@marvell.com>
> Subject: [dts] [PATCH] pmd: Add test case packet checking in scalar mode for
> marvell device
> 
> From: Phanendra Vukkisala <pvukkisala@marvell.com>
> 
> Updated testplan, test script and support list.
> 
> Signed-off-by: Phanendra Vukkisala <pvukkisala@marvell.com>
> ---
>  conf/test_case_supportlist.json |   16 +++++++++++++++
>  test_plans/pmd_test_plan.rst    |   15 ++++++++++++++
>  tests/TestSuite_pmd.py          |   41 ++++++++++++++++++++++++++++++++----
> ---
>  3 files changed, 65 insertions(+), 7 deletions(-)
> 
> diff --git a/conf/test_case_supportlist.json b/conf/test_case_supportlist.json
> index f547b32..9c39f33 100644
> --- a/conf/test_case_supportlist.json
> +++ b/conf/test_case_supportlist.json
> @@ -1612,5 +1612,21 @@
>              "Bug ID": "",
>              "Comments": "This case currently support for niantic "
>          }
> +    ],
> +    "packet_checking_scalar_mode": [
> +        {
> +            "OS": [
> +                "ALL"
> +            ],
> +            "NIC": [
> +                "cavium_a064",
> +                "cavium_a063"
> +            ],
> +            "Target": [
> +                "ALL"
> +            ],
> +            "Bug ID": "",
> +            "Comments": "This case currently support for cavium_a063 and
> cavium_a064 "
> +        }
>      ]
>  }
> diff --git a/test_plans/pmd_test_plan.rst b/test_plans/pmd_test_plan.rst
> index a077cfa..f84fa55 100644
> --- a/test_plans/pmd_test_plan.rst
> +++ b/test_plans/pmd_test_plan.rst
> @@ -92,6 +92,21 @@ Test Case: Packet Checking
>     which will be forwarded by the DUT. The test checks if the packets are
> correctly forwarded and
>     if both RX and TX packet sizes match by `show port all stats`
> 
> +Test Case: Packet Checking in scalar mode
> +=========================================
> +
> +The linuxapp is started with the following parameters:
> +
> +::
> +  -c 0x6 -n 4 -w <devid>,scalar_enable=1  -- -i --portmask=<portmask>
> +
> +
> +This test is applicable for Marvell devices. The tester sends 1 packet
> +at a time with different sizes (64, 65, 128, 256, 512, 1024, 1280 and
> +1518 bytes), using scapy, which will be forwarded by the DUT. The test
> +checks if the packets are correctly forwarded and if both RX and TX packet
> sizes match.
> +
> +
>  Test Case: Descriptors Checking
>  ===============================
> 
> diff --git a/tests/TestSuite_pmd.py b/tests/TestSuite_pmd.py index
> dc9078f..46141d6 100644
> --- a/tests/TestSuite_pmd.py
> +++ b/tests/TestSuite_pmd.py
> @@ -386,6 +386,29 @@ class TestPmd(TestCase):
>          self.dut.send_expect("quit", "# ", 30)
>          sleep(5)
> 
> +    def test_packet_checking_scalar_mode(self):
> +        """
> +        Packet forwarding checking test
> +        """
> +
> +        self.dut.kill_all()
> +
> +        port_mask = utils.create_mask([self.dut_ports[0],
> + self.dut_ports[1]])
> +
> +        eal_opts = ""
> +        for port in self.dut_ports:
> +            eal_opts += "-w %s,scalar_enable=1
> + "%(self.dut.get_port_pci(self.dut_ports[port]))
> +
> +
> +        self.pmdout.start_testpmd("1S/2C/1T", "--portmask=%s" % port_mask,
> eal_param = eal_opts, socket=self.ports_socket)
> +        self.dut.send_expect("start", "testpmd> ")
> +        for size in self.frame_sizes:
> +            self.send_packet(size, scalar_test=True)
> +
> +        self.dut.send_expect("stop", "testpmd> ")
> +        self.dut.send_expect("quit", "# ", 30)
> +        sleep(5)
> +
>      def stop_and_get_l4csum_errors(self):
>          """
>          Stop forwarding and get Bad-l4csum number from stop statistic @@ -
> 406,7 +429,7 @@ class TestPmd(TestCase):
>          stats = self.pmdout.get_pmd_stats(portid)
>          return stats
> 
> -    def send_packet(self, frame_size, checksum_test=False):
> +    def send_packet(self, frame_size, checksum_test=False, scalar_test=False):
>          """
>          Send 1 packet to portid
>          """
> @@ -428,10 +451,14 @@ class TestPmd(TestCase):
>          if checksum_test:
>              checksum = 'chksum=0x1'
> 
> +        if scalar_test:
> +            pkt_count = 1
> +        else:
> +            pkt_count = 4
>          self.tester.scapy_foreground()
>          self.tester.scapy_append('nutmac="%s"' % mac)
> -        self.tester.scapy_append('sendp([Ether(dst=nutmac,
> src="52:00:00:00:00:00")/IP(len=%s)/UDP(%s)/Raw(load="\x50"*%s)],
> iface="%s", count=4)' % (
> -            load_size, checksum, padding, interface))
> +        self.tester.scapy_append('sendp([Ether(dst=nutmac,
> src="52:00:00:00:00:00")/IP(len=%s)/UDP(%s)/Raw(load="\x50"*%s)],
> iface="%s", count=%s)' % (
> +            load_size, checksum, padding, interface, pkt_count))
> 
>          out = self.tester.scapy_execute()
>          time.sleep(.5)
> @@ -452,11 +479,11 @@ class TestPmd(TestCase):
>          self.verify(self.pmdout.check_tx_bytes(p0tx_pkts, p1rx_pkts),
>                      "packet pass assert error, %d RX packets, %d TX packets" %
> (p1rx_pkts, p0tx_pkts))
> 
> -        self.verify(p1rx_bytes == (frame_size - 4)*4,
> -                    "packet pass assert error, expected %d RX bytes, actual %d" %
> ((frame_size - 4)*4, p1rx_bytes))
> +        self.verify(p1rx_bytes == (frame_size - 4)*pkt_count,
> +                    "packet pass assert error, expected %d RX bytes,
> + actual %d" % ((frame_size - 4)*pkt_count, p1rx_bytes))
> 
> -        self.verify(self.pmdout.check_tx_bytes(p0tx_bytes, (frame_size - 4)*4),
> -                    "packet pass assert error, expected %d TX bytes, actual %d" %
> ((frame_size - 4)*4, p0tx_bytes))
> +        self.verify(self.pmdout.check_tx_bytes(p0tx_bytes, (frame_size -
> 4)*pkt_count),
> +                    "packet pass assert error, expected %d TX bytes,
> + actual %d" % ((frame_size - 4)*pkt_count, p0tx_bytes))
> 
>          return out
> 
> --
> 1.7.9.5


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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-27  6:48 [dts] [PATCH] pmd: Add test case packet checking in scalar mode for marvell device pvukkisala
2019-09-04  5:16 ` Tu, Lijuan

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