test suite reviews and discussions
 help / color / mirror / Atom feed
From: Ke Xu <ke1.xu@intel.com>
To: dts@dpdk.org
Cc: qi.fu@intel.com, ke1.xu@intel.com
Subject: [dts][PATCH V1 1/2] tests/tso: modify get_chksum_value_and_verify to fix a checksum-verify error
Date: Tue, 23 Aug 2022 05:59:38 +0000	[thread overview]
Message-ID: <20220823055939.4186198-2-ke1.xu@intel.com> (raw)
In-Reply-To: <20220823055939.4186198-1-ke1.xu@intel.com>

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


  reply	other threads:[~2022-08-23  6:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2022-08-23  5:59 ` [dts][PATCH V1 2/2] tests/tso: modify get_chksum_value_and_verify to " Ke Xu
2022-09-02  1:57   ` lijuan.tu
     [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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220823055939.4186198-2-ke1.xu@intel.com \
    --to=ke1.xu@intel.com \
    --cc=dts@dpdk.org \
    --cc=qi.fu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).