test suite reviews and discussions
 help / color / mirror / Atom feed
From: Xie wei <weix.xie@intel.com>
To: dts@dpdk.org
Cc: Xie wei <weix.xie@intel.com>
Subject: [dts] [PATCH V1] tests/TestSuite_af_xdp_2:fixed save pcap file failed
Date: Thu, 22 Oct 2020 17:09:37 +0800	[thread overview]
Message-ID: <20201022090937.28791-1-weix.xie@intel.com> (raw)

*AF_XDP pmd is enable by default with meson build method, and remove rebuild steps.
*Fixed pcap file is empty.

Signed-off-by: Xie wei <weix.xie@intel.com>
---
 tests/TestSuite_af_xdp_2.py | 21 ++++-----------------
 1 file changed, 4 insertions(+), 17 deletions(-)

diff --git a/tests/TestSuite_af_xdp_2.py b/tests/TestSuite_af_xdp_2.py
index 4586c9d5..40a3d416 100644
--- a/tests/TestSuite_af_xdp_2.py
+++ b/tests/TestSuite_af_xdp_2.py
@@ -67,29 +67,21 @@ class TestAfXdp(TestCase):
         self.base_dir = self.dut.base_dir.replace('~', '/root')
         self.pktgen_helper = PacketGeneratorHelper()
 
-        self.prepare_dpdk()
         self.dut.restore_interfaces()
         self.irqs_set = self.dut.new_session(suite="irqs-set")
 
     def set_up(self):
         pass
 
-    def prepare_dpdk(self):
-        self.dut.send_expect(
-            "sed -i 's/CONFIG_RTE_LIBRTE_PMD_AF_XDP=n$/CONFIG_RTE_LIBRTE_PMD_AF_XDP=y/' config/common_base", "# ")
-        self.dut.set_build_options({'RTE_LIBRTE_PMD_AF_XDP': 'y'})
-        self.dut.build_install_dpdk(self.dut.target)
-
     def set_port_queue(self, intf):
         self.dut.send_expect("ethtool -L %s combined %d" % (intf, self.nb_cores/self.port_num), "# ")
 
     def config_stream(self, rx_port, frame_size):
-        payload = frame_size - self.header_size
         tgen_input = []
 
         dst_mac = self.dut.get_mac_address(self.dut_ports[rx_port])
-        flow = 'Ether(dst="%s")/IP(dst="192.168.%d.1", proto=255)/UDP()/("X"*%d)' % (dst_mac, rx_port+1, payload)
-        pkt = Packet(pkt_str=flow)
+        pkt = Packet(pkt_len=frame_size)
+        pkt.config_layers([('ether', {'dst': dst_mac}), ('ipv4', {'dst':"192.168.%d.1" % (rx_port+1), 'proto': 255})])
         pcap = os.path.join(self.out_path, "af_xdp_%d_%d_%d.pcap" %
                 (self.port_num, rx_port, frame_size))
         pkt.save_pcapfile(None, pcap)
@@ -98,12 +90,11 @@ class TestAfXdp(TestCase):
         return tgen_input
 
     def config_rule_stream(self, rule_index, frame_size):
-        payload = frame_size - self.header_size
         tgen_input = []
 
         rule = self.rule[rule_index]
-        flow = 'Ether()/IP()/UDP(sport=%d, dport=%d)/("X"*%d)' % (rule[-2], rule[-1], payload)
-        pkt = Packet(pkt_str=flow)
+        pkt = Packet(pkt_len=frame_size)
+        pkt.config_layers([('udp', {'src': rule[-2], 'dst': rule[-1]})])
         pcap = os.path.join(self.out_path, "af_xdp_%d_%d.pcap" %
                 (rule[-2], frame_size))
         pkt.save_pcapfile(None, pcap)
@@ -432,7 +423,3 @@ class TestAfXdp(TestCase):
 
     def tear_down_all(self):
         self.dut.kill_all()
-        self.dut.send_expect(
-            "sed -i 's/CONFIG_RTE_LIBRTE_PMD_AF_XDP=y$/CONFIG_RTE_LIBRTE_PMD_AF_XDP=n/' config/common_base", "# ")
-        self.dut.set_build_options({'RTE_LIBRTE_PMD_AF_XDP': 'n'})
-        self.dut.build_install_dpdk(self.dut.target)
-- 
2.17.1


             reply	other threads:[~2020-10-22  9:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-22  9:09 Xie wei [this message]
2020-10-22  9:19 ` Xie, WeiX
2020-10-29  8:52 ` Ma, LihongX
2020-11-03  2:04   ` Tu, Lijuan
2020-11-03  2:06   ` 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=20201022090937.28791-1-weix.xie@intel.com \
    --to=weix.xie@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).