From: Ke Xu <ke1.xu@intel.com>
To: dts@dpdk.org
Cc: ke1.xu@intel.com, weiyuanx.li@intel.com, qi.fu@intel.com,
lijuan.tu@intel.com
Subject: [DTS][PATCH V6 5/5] tests/vf_offload: fix and improve unstable implementations.
Date: Fri, 23 Dec 2022 16:55:27 +0800 [thread overview]
Message-ID: <20221223085527.29760-6-ke1.xu@intel.com> (raw)
In-Reply-To: <20221223085527.29760-1-ke1.xu@intel.com>
Improved checksum validation part for tunnel cases, ensuring correctness
under different scenarios.
Abandoned the using of packet sprintf method in validation, fixing the
possible wrong output under certain packet organizations.
Branched bad checksum counting, ensuring the correctness under DCF enabled
scenario.
Signed-off-by: Weiyuan Li <weiyuanx.li@intel.com>
Signed-off-by: Ke Xu <ke1.xu@intel.com>
---
tests/TestSuite_vf_offload.py | 32 ++++++++++++++------------------
1 file changed, 14 insertions(+), 18 deletions(-)
diff --git a/tests/TestSuite_vf_offload.py b/tests/TestSuite_vf_offload.py
index 6765fcc5..62e74c33 100644
--- a/tests/TestSuite_vf_offload.py
+++ b/tests/TestSuite_vf_offload.py
@@ -461,20 +461,10 @@ class TestVfOffload(TestCase):
p = self.tester.load_tcpdump_sniff_packets(inst)
nr_packets = len(p)
print(p)
- packets_received = [
- p[i].sprintf(
- "%IP.chksum%;%UDP.chksum%;%IP:2.chksum%;%UDP:2.chksum%;%TCP.chksum%;%SCTP.chksum%"
- )
- for i in range(nr_packets)
- ]
-
- packets_received = [
- item
- for item in packets_received[0].replace("??", "").split(";")
- if item != ""
- ]
- self.logger.debug(f"packets_received=>{packets_received}")
- self.logger.debug(f"expected_chksum=>{expected_chksum}")
+ chksums = checksum_pattern.findall(p[0].show2(dump=True))
+ packets_received = chksums
+ self.logger.debug(f"packets_received: {packets_received}")
+ self.logger.debug(f"expected_chksum: {expected_chksum}")
self.verify(
len(expected_chksum) == len(packets_received),
f"The chksum type {packet_type} length of the actual result is inconsistent with the expected length!",
@@ -609,10 +599,16 @@ class TestVfOffload(TestCase):
bad_outer_l4csum = self.vm0_testpmd.get_pmd_value("Bad-outer-l4csum:", out)
bad_inner_ipcsum = self.vm0_testpmd.get_pmd_value("Bad-ipcsum:", out)
bad_inner_l4csum = self.vm0_testpmd.get_pmd_value("Bad-l4csum:", out)
- self.verify(bad_outer_ipcsum == 42, "Bad-outer-ipcsum check error")
- self.verify(bad_outer_l4csum == 66, "Bad-outer-l4csum check error")
- self.verify(bad_inner_ipcsum == 42, "Bad-ipcsum check error")
- self.verify(bad_inner_l4csum == 84, "Bad-l4csum check error")
+ if self.dcf_mode == "enable":
+ self.verify(bad_outer_ipcsum == 24, "Bad-outer-ipcsum check error")
+ self.verify(bad_outer_l4csum == 48, "Bad-outer-l4csum check error")
+ self.verify(bad_inner_ipcsum == 42, "Bad-ipcsum check error")
+ self.verify(bad_inner_l4csum == 84, "Bad-l4csum check error")
+ else:
+ self.verify(bad_outer_ipcsum == 24, "Bad-outer-ipcsum check error")
+ self.verify(bad_outer_l4csum == 36, "Bad-outer-l4csum check error")
+ self.verify(bad_inner_ipcsum == 36, "Bad-ipcsum check error")
+ self.verify(bad_inner_l4csum == 72, "Bad-l4csum check error")
def test_checksum_offload_disable(self):
"""
--
2.25.1
next prev parent reply other threads:[~2022-12-23 8:57 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-23 8:55 [DTS][PATCH V6 0/5] add vf checksum offload and tso case for tunnel packets Ke Xu
2022-12-23 8:55 ` [DTS][PATCH V6 1/5] tests/vf_offload: fix 2 typos and a bug Ke Xu
2022-12-23 8:55 ` [DTS][PATCH V6 2/5] tests/vf_offload: add vf checksum hw offload case for tunneling packets Ke Xu
2022-12-23 8:55 ` [DTS][PATCH V6 3/5] tests/vf_offload: add vf tso " Ke Xu
2022-12-23 8:55 ` [DTS][PATCH V6 4/5] tests/vf_offload: add new method to anayse tunnel packets Ke Xu
2022-12-23 8:55 ` Ke Xu [this message]
2022-12-23 9:03 ` [DTS][PATCH V6 5/5] tests/vf_offload: fix and improve unstable implementations Li, WeiyuanX
2022-12-26 1:53 ` [DTS][PATCH V6 0/5] add vf checksum offload and tso case for tunnel packets Fu, Qi
2022-12-26 4:41 ` Tu, Lijuan
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=20221223085527.29760-6-ke1.xu@intel.com \
--to=ke1.xu@intel.com \
--cc=dts@dpdk.org \
--cc=lijuan.tu@intel.com \
--cc=qi.fu@intel.com \
--cc=weiyuanx.li@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).