test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH V3] tests/shutdown_api: check crc strip bit instead of Rx offloads to verify CRC is enabled or not
@ 2018-10-24  9:12 wenjieli
  2018-10-25  8:50 ` Tu, Lijuan
  0 siblings, 1 reply; 2+ messages in thread
From: wenjieli @ 2018-10-24  9:12 UTC (permalink / raw)
  To: dts; +Cc: wenjieli

If crc strip is enabled, the crc strip bit (bit 16) is 0, else it is 1. 
Use this bit to check crc is enabled or not, will not just check the 
Rx offloads value in output.

Signed-off-by: wenjieli <wenjiex.a.li@intel.com>
---
 tests/TestSuite_shutdown_api.py | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/tests/TestSuite_shutdown_api.py b/tests/TestSuite_shutdown_api.py
index 52a8fbf..1282cf7 100644
--- a/tests/TestSuite_shutdown_api.py
+++ b/tests/TestSuite_shutdown_api.py
@@ -263,18 +263,24 @@ class TestShutdownApi(TestCase):
         """
         Reconfigure All Ports With The Same Configurations (CRC)
         """
+        RX_OFFLOAD_KEEP_CRC = 0x10000
+
         self.pmdout.start_testpmd("Default", "--portmask=%s --port-topology=loop --disable-crc-strip" % utils.create_mask(self.ports), socket=self.ports_socket)
         out = self.dut.send_expect("show config rxtx", "testpmd> ")
+        Rx_offloads = re.compile('Rx offloads=(.*?)\s+?').findall(out, re.S)
+        crc_keep = int(Rx_offloads[0],16) & RX_OFFLOAD_KEEP_CRC and int(Rx_offloads[1],16) & RX_OFFLOAD_KEEP_CRC
         self.verify(
-            "Rx offloads=0x10000" in out, "CRC keeping not enabled properly")
+            crc_keep == RX_OFFLOAD_KEEP_CRC, "CRC keeping not enabled properly")
 
         self.dut.send_expect("port stop all", "testpmd> ", 100)
         self.dut.send_expect("port config all crc-strip on", "testpmd> ")
         self.dut.send_expect("set fwd mac", "testpmd>")
         self.dut.send_expect("port start all", "testpmd> ", 100)
         out = self.dut.send_expect("show config rxtx", "testpmd> ")
+        Rx_offloads = re.compile('Rx offloads=(.*?)\s+?').findall(out, re.S)
+        crc_strip = int(Rx_offloads[0],16) | ~RX_OFFLOAD_KEEP_CRC and int(Rx_offloads[1],16) | ~RX_OFFLOAD_KEEP_CRC
         self.verify(
-            "Rx offloads=0x1000" in out, "CRC stripping not enabled properly")
+            crc_strip == ~RX_OFFLOAD_KEEP_CRC, "CRC stripping not enabled properly")
         self.dut.send_expect("start", "testpmd> ")
         self.check_forwarding()
 
-- 
2.17.2

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

* Re: [dts] [PATCH V3] tests/shutdown_api: check crc strip bit instead of Rx offloads to verify CRC is enabled or not
  2018-10-24  9:12 [dts] [PATCH V3] tests/shutdown_api: check crc strip bit instead of Rx offloads to verify CRC is enabled or not wenjieli
@ 2018-10-25  8:50 ` Tu, Lijuan
  0 siblings, 0 replies; 2+ messages in thread
From: Tu, Lijuan @ 2018-10-25  8:50 UTC (permalink / raw)
  To: Li, WenjieX A, dts; +Cc: Li, WenjieX A

Applied, thanks

> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of wenjieli
> Sent: Wednesday, October 24, 2018 5:12 PM
> To: dts@dpdk.org
> Cc: Li, WenjieX A <wenjiex.a.li@intel.com>
> Subject: [dts] [PATCH V3] tests/shutdown_api: check crc strip bit instead of
> Rx offloads to verify CRC is enabled or not
> 
> If crc strip is enabled, the crc strip bit (bit 16) is 0, else it is 1.
> Use this bit to check crc is enabled or not, will not just check the Rx offloads
> value in output.
> 
> Signed-off-by: wenjieli <wenjiex.a.li@intel.com>
> ---
>  tests/TestSuite_shutdown_api.py | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/TestSuite_shutdown_api.py
> b/tests/TestSuite_shutdown_api.py index 52a8fbf..1282cf7 100644
> --- a/tests/TestSuite_shutdown_api.py
> +++ b/tests/TestSuite_shutdown_api.py
> @@ -263,18 +263,24 @@ class TestShutdownApi(TestCase):
>          """
>          Reconfigure All Ports With The Same Configurations (CRC)
>          """
> +        RX_OFFLOAD_KEEP_CRC = 0x10000
> +
>          self.pmdout.start_testpmd("Default", "--portmask=%s
> --port-topology=loop --disable-crc-strip" % utils.create_mask(self.ports),
> socket=self.ports_socket)
>          out = self.dut.send_expect("show config rxtx", "testpmd> ")
> +        Rx_offloads = re.compile('Rx offloads=(.*?)\s+?').findall(out, re.S)
> +        crc_keep = int(Rx_offloads[0],16) & RX_OFFLOAD_KEEP_CRC and
> + int(Rx_offloads[1],16) & RX_OFFLOAD_KEEP_CRC
>          self.verify(
> -            "Rx offloads=0x10000" in out, "CRC keeping not enabled
> properly")
> +            crc_keep == RX_OFFLOAD_KEEP_CRC, "CRC keeping not
> enabled
> + properly")
> 
>          self.dut.send_expect("port stop all", "testpmd> ", 100)
>          self.dut.send_expect("port config all crc-strip on", "testpmd> ")
>          self.dut.send_expect("set fwd mac", "testpmd>")
>          self.dut.send_expect("port start all", "testpmd> ", 100)
>          out = self.dut.send_expect("show config rxtx", "testpmd> ")
> +        Rx_offloads = re.compile('Rx offloads=(.*?)\s+?').findall(out, re.S)
> +        crc_strip = int(Rx_offloads[0],16) | ~RX_OFFLOAD_KEEP_CRC and
> + int(Rx_offloads[1],16) | ~RX_OFFLOAD_KEEP_CRC
>          self.verify(
> -            "Rx offloads=0x1000" in out, "CRC stripping not enabled
> properly")
> +            crc_strip == ~RX_OFFLOAD_KEEP_CRC, "CRC stripping not
> + enabled properly")
>          self.dut.send_expect("start", "testpmd> ")
>          self.check_forwarding()
> 
> --
> 2.17.2

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

end of thread, other threads:[~2018-10-25  8:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-24  9:12 [dts] [PATCH V3] tests/shutdown_api: check crc strip bit instead of Rx offloads to verify CRC is enabled or not wenjieli
2018-10-25  8:50 ` 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).