test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH] Fix checksum_checking failed issue
@ 2015-09-17  9:07 changru
  2015-09-18 12:42 ` Liu, Yong
  0 siblings, 1 reply; 2+ messages in thread
From: changru @ 2015-09-17  9:07 UTC (permalink / raw)
  To: dts

In UDP packet, if the chksum is equal to 0, it means the receiver don't need to check.
But, we want to send a packet with an error checksum.
On the other hand, on 1G NICs, the packet received has the same length with the packet sent.   

Signed-off-by: changru <changrux.fan@intel.com>
---
 tests/TestSuite_pmd.py | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/tests/TestSuite_pmd.py b/tests/TestSuite_pmd.py
index afb2450..525ed02 100644
--- a/tests/TestSuite_pmd.py
+++ b/tests/TestSuite_pmd.py
@@ -375,7 +375,7 @@ class TestPmd(TestCase,IxiaPacketGenerator):
 
         checksum = ''
         if checksum_test:
-            checksum = 'chksum=0x0'
+            checksum = 'chksum=0x1'
 
         self.tester.scapy_foreground()
         self.tester.scapy_append('nutmac="%s"' % mac)
@@ -402,8 +402,12 @@ class TestPmd(TestCase,IxiaPacketGenerator):
                     "packet pass assert error, %d RX packets, %d TX packets" % (p1rx_pkts, p0tx_pkts))
 
         if checksum_test:
-            self.verify(p1rx_bytes == frame_size - 4,
-                        "packet pass assert error, expected %d RX bytes, actual %d" % (frame_size - 4, p1rx_bytes))
+            if self.nic in ["powerville", "springville", "kawela_4"]:
+            	self.verify(p1rx_bytes == frame_size,
+                        	"packet pass assert error, expected %d RX bytes, actual %d" % (frame_size, p1rx_bytes))
+            else:
+            	self.verify(p1rx_bytes == frame_size - 4,
+                        	"packet pass assert error, expected %d RX bytes, actual %d" % (frame_size - 4, p1rx_bytes))
         else:
             self.verify(p1rx_bytes == frame_size,
                         "packet pass assert error, expected %d RX bytes, actual %d" % (frame_size, p1rx_bytes))
-- 
2.1.0

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

* Re: [dts] [PATCH] Fix checksum_checking failed issue
  2015-09-17  9:07 [dts] [PATCH] Fix checksum_checking failed issue changru
@ 2015-09-18 12:42 ` Liu, Yong
  0 siblings, 0 replies; 2+ messages in thread
From: Liu, Yong @ 2015-09-18 12:42 UTC (permalink / raw)
  To: Fan, ChangruX, dts

Thanks. Applied.

> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of changru
> Sent: Thursday, September 17, 2015 5:07 PM
> To: dts@dpdk.org
> Subject: [dts] [PATCH] Fix checksum_checking failed issue
> 
> In UDP packet, if the chksum is equal to 0, it means the receiver don't
> need to check.
> But, we want to send a packet with an error checksum.
> On the other hand, on 1G NICs, the packet received has the same length
> with the packet sent.
> 
> Signed-off-by: changru <changrux.fan@intel.com>
> ---
>  tests/TestSuite_pmd.py | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/TestSuite_pmd.py b/tests/TestSuite_pmd.py
> index afb2450..525ed02 100644
> --- a/tests/TestSuite_pmd.py
> +++ b/tests/TestSuite_pmd.py
> @@ -375,7 +375,7 @@ class TestPmd(TestCase,IxiaPacketGenerator):
> 
>          checksum = ''
>          if checksum_test:
> -            checksum = 'chksum=0x0'
> +            checksum = 'chksum=0x1'
> 
>          self.tester.scapy_foreground()
>          self.tester.scapy_append('nutmac="%s"' % mac)
> @@ -402,8 +402,12 @@ class TestPmd(TestCase,IxiaPacketGenerator):
>                      "packet pass assert error, %d RX packets, %d TX
> packets" % (p1rx_pkts, p0tx_pkts))
> 
>          if checksum_test:
> -            self.verify(p1rx_bytes == frame_size - 4,
> -                        "packet pass assert error, expected %d RX bytes,
> actual %d" % (frame_size - 4, p1rx_bytes))
> +            if self.nic in ["powerville", "springville", "kawela_4"]:
> +            	self.verify(p1rx_bytes == frame_size,
> +                        	"packet pass assert error, expected %d RX
> bytes, actual %d" % (frame_size, p1rx_bytes))
> +            else:
> +            	self.verify(p1rx_bytes == frame_size - 4,
> +                        	"packet pass assert error, expected %d RX
> bytes, actual %d" % (frame_size - 4, p1rx_bytes))
>          else:
>              self.verify(p1rx_bytes == frame_size,
>                          "packet pass assert error, expected %d RX bytes,
> actual %d" % (frame_size, p1rx_bytes))
> --
> 2.1.0

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

end of thread, other threads:[~2015-09-18 12:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-17  9:07 [dts] [PATCH] Fix checksum_checking failed issue changru
2015-09-18 12:42 ` Liu, Yong

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