test suite reviews and discussions
 help / color / mirror / Atom feed
* RE: [dts][PATCH V1 1/2] tests/tso: modify get_chksum_value_and_verify to fix a checksum-verify error
       [not found] <20220721061314.984469-1-ke1.xu@intel.com>
@ 2022-07-27  3:25 ` Fu, Qi
       [not found] ` <20220721061314.984469-2-ke1.xu@intel.com>
  1 sibling, 0 replies; 3+ messages in thread
From: Fu, Qi @ 2022-07-27  3:25 UTC (permalink / raw)
  To: Xu, Ke1, dts; +Cc: Fu, Qi

Acked-by: Fu, Qi <qi.fu@intel.com>

> -----Original Message-----
> From: Xu, Ke1 <ke1.xu@intel.com>
> Sent: Thursday, July 21, 2022 2:13 PM
> To: dts@dpdk.org
> Cc: Fu, Qi <qi.fu@intel.com>; Xu, Ke1 <ke1.xu@intel.com>
> Subject: [dts][PATCH V1 1/2] tests/tso: modify get_chksum_value_and_verify to
> fix a checksum-verify error
> 
> Function "get_chksum_value_and_verify" in test suite TSO case
> test_tso_tunneling  cannot verify checksum error.
> 
> This function uses the auto checksum calculation of scapy by reading the pcap
> file, erasing the checksum and writing back to a new pcap file. Duplicated  call to
> method "packet.read_pcapfile" at line 149 and line 162 will append  extra
> packets to the packet sequence stored in "packet.pktgen.pkts". And  erasing the
> checksum at line 153 to line 160 will modify the appended packets.
>  This leads to a wrongly organized packet sequence writen to file at line 161,
> causing the checksum verifying wrongly use the raw checksum as the corrected
> checksum. This fails the following checksum verifying.
> 
> By removing duplicated method call at line 149 and creating new object for
> temporary use at line 162. This bug is fixed.
> 
> Signed-off-by: Ke Xu <ke1.xu@intel.com>
> ---
>  tests/TestSuite_tso.py | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> 2.25.1


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

* RE: [dts][PATCH V1 2/2] tests/tso: modify get_chksum_value_and_verify to improve the execution efficiency
       [not found] ` <20220721061314.984469-2-ke1.xu@intel.com>
@ 2022-07-27  3:26   ` Fu, Qi
  0 siblings, 0 replies; 3+ messages in thread
From: Fu, Qi @ 2022-07-27  3:26 UTC (permalink / raw)
  To: Xu, Ke1, dts; +Cc: Fu, Qi

Acked-by: Fu, Qi <qi.fu@intel.com>

> -----Original Message-----
> From: Xu, Ke1 <ke1.xu@intel.com>
> Sent: Thursday, July 21, 2022 2:13 PM
> To: dts@dpdk.org
> Cc: Fu, Qi <qi.fu@intel.com>; Xu, Ke1 <ke1.xu@intel.com>
> Subject: [dts][PATCH V1 2/2] tests/tso: modify get_chksum_value_and_verify to
> improve the execution efficiency
> 
> Function "get_chksum_value_and_verify" in test suite TSO case
> test_tso_tunneling  is of low efficiency. Methods are wrongly used.
> 
> Duplicated call to method "packet.read_pcapfile" in this function will lengthen
> the packet sequence stored in "packet.pktgen.pkts", consuming more time when
> save pcap file. Duplicated call to method "packet.save_pcapfile" is also time
> consuming.
> 
> Method "pks.show" and "self.pks1[i].show" is not used as expected. "*.show" is
> used to print the packet object, not intended to return a string. Current code  is
> actually getting a method object and using "str(*)" method to turn a method
> object to a string, this may fail when "*.show" method is updated. The packet
> information printing here is equivilant to "repr(pks)".
> 
> Signed-off-by: Ke Xu <ke1.xu@intel.com>
> ---
>  tests/TestSuite_tso.py | 25 +++++++++++++++----------
>  1 file changed, 15 insertions(+), 10 deletions(-)
> 
> 2.25.1


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

* [dts][PATCH V1 1/2] tests/tso: modify get_chksum_value_and_verify to fix a checksum-verify error
  2022-08-23  5:59 [dts][PATCH V1 0/2] tests/tso: modify get_chksum_value_and_verify to fix a checksum-verify error and improve the performance Ke Xu
@ 2022-08-23  5:59 ` Ke Xu
  0 siblings, 0 replies; 3+ messages in thread
From: Ke Xu @ 2022-08-23  5:59 UTC (permalink / raw)
  To: dts; +Cc: qi.fu, ke1.xu

Function "get_chksum_value_and_verify" in test suite TSO case test_tso_tunneling
 cannot verify checksum error.

This function uses the auto checksum calculation of scapy by reading the pcap
 file, erasing the checksum and writing back to a new pcap file. Duplicated
 call to method "packet.read_pcapfile" at line 149 and line 162 will append
 extra packets to the packet sequence stored in "packet.pktgen.pkts". And
 erasing the checksum at line 153 to line 160 will modify the appended packets.
 This leads to a wrongly organized packet sequence writen to file at line 161,
 causing the checksum verifying wrongly use the raw checksum as the corrected
 checksum. This fails the following checksum verifying.

By removing duplicated method call at line 149 and creating new object for
 temporary use at line 162. This bug is fixed.

Signed-off-by: Ke Xu <ke1.xu@intel.com>
---
 tests/TestSuite_tso.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tests/TestSuite_tso.py b/tests/TestSuite_tso.py
index 778ba3cc..ef63b7cf 100644
--- a/tests/TestSuite_tso.py
+++ b/tests/TestSuite_tso.py
@@ -146,7 +146,6 @@ class TestTSO(TestCase):
         packet = Packet()
         self.pks = packet.read_pcapfile(dump_pcap, self.tester)
         for i in range(len(self.pks)):
-            self.pks = packet.read_pcapfile(dump_pcap, self.tester)
             pks = self.pks[i]
             out = pks.show
             chksum_list = re.findall(r"chksum=(0x\w+)", str(out))
@@ -159,7 +158,7 @@ class TestTSO(TestCase):
                 pks["GRE"]["IP"].chksum = None
                 pks["GRE"]["TCP"].chksum = None
             packet.save_pcapfile(self.tester, filename=save_file)
-            self.pks1 = packet.read_pcapfile(save_file, self.tester)
+            self.pks1 = Packet().read_pcapfile(save_file, self.tester)
             out1 = self.pks1[i].show
             chksum_list1 = re.findall(r"chksum=(0x\w+)", str(out1))
             self.tester.send_expect("rm -rf %s" % save_file, "#")
-- 
2.25.1


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

end of thread, other threads:[~2022-08-23  6:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20220721061314.984469-1-ke1.xu@intel.com>
2022-07-27  3:25 ` [dts][PATCH V1 1/2] tests/tso: modify get_chksum_value_and_verify to fix a checksum-verify error Fu, Qi
     [not found] ` <20220721061314.984469-2-ke1.xu@intel.com>
2022-07-27  3:26   ` [dts][PATCH V1 2/2] tests/tso: modify get_chksum_value_and_verify to improve the execution efficiency Fu, Qi
2022-08-23  5:59 [dts][PATCH V1 0/2] tests/tso: modify get_chksum_value_and_verify to fix a checksum-verify error and improve the performance Ke Xu
2022-08-23  5:59 ` [dts][PATCH V1 1/2] tests/tso: modify get_chksum_value_and_verify to fix a checksum-verify error Ke Xu

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