From: Wei Ling <weix.ling@intel.com>
To: dts@dpdk.org
Cc: Wei Ling <weix.ling@intel.com>
Subject: [dts][PATCH V1 3/6] tests/vswitch_sample_cbdma: fix pcap header issue
Date: Fri, 22 Apr 2022 13:48:50 +0800 [thread overview]
Message-ID: <20220422054850.1559283-1-weix.ling@intel.com> (raw)
Fix pcap header issue.
Signed-off-by: Wei Ling <weix.ling@intel.com>
---
tests/TestSuite_vswitch_sample_cbdma.py | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/tests/TestSuite_vswitch_sample_cbdma.py b/tests/TestSuite_vswitch_sample_cbdma.py
index 503c8ba0..b455790a 100644
--- a/tests/TestSuite_vswitch_sample_cbdma.py
+++ b/tests/TestSuite_vswitch_sample_cbdma.py
@@ -43,7 +43,6 @@ import framework.utils as utils
from framework.packet import Packet
from framework.pktgen import PacketGeneratorHelper
from framework.pmd_output import PmdOutput
-from framework.settings import HEADER_SIZE
from framework.test_case import TestCase
from framework.virt_common import VM
@@ -96,7 +95,6 @@ class TestVswitchSampleCBDMA(TestCase):
self.random_string = string.ascii_letters + string.digits
self.virtio_ip0 = "1.1.1.2"
self.virtio_ip1 = "1.1.1.3"
- self.headers_size = HEADER_SIZE["eth"] + HEADER_SIZE["ip"]
def set_up(self):
"""
@@ -350,8 +348,7 @@ class TestVswitchSampleCBDMA(TestCase):
rx_port = self.tester.get_local_port(self.dut_ports[0])
tx_port = self.tester.get_local_port(self.dut_ports[0])
for dst_mac in dst_mac_list:
- payload_size = frame_size - self.headers_size
- pkt = Packet(pkt_type="VLAN_UDP", pkt_len=payload_size)
+ pkt = Packet(pkt_type="VLAN_UDP", pkt_len=frame_size)
pkt.config_layer("ether", {"dst": dst_mac})
pkt.config_layer("vlan", {"vlan": 1000})
pcap = os.path.join(
@@ -504,14 +501,13 @@ class TestVswitchSampleCBDMA(TestCase):
tx_port = self.tester.get_local_port(self.dut_ports[0])
for dst_mac in dst_mac_list:
for frame_size in frame_sizes:
- payload_size = frame_size - self.headers_size
pkt = Packet()
pkt.assign_layers(["ether", "ipv4", "raw"])
pkt.config_layers(
[
("ether", {"dst": "%s" % dst_mac}),
("ipv4", {"src": "1.1.1.1"}),
- ("raw", {"payload": ["01"] * int("%d" % payload_size)}),
+ ("raw", {"payload": ["01"] * int("%d" % frame_size)}),
]
)
pcap = os.path.join(
--
2.25.1
reply other threads:[~2022-04-22 5:48 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20220422054850.1559283-1-weix.ling@intel.com \
--to=weix.ling@intel.com \
--cc=dts@dpdk.org \
/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).