From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id D626AA04DD; Thu, 22 Oct 2020 11:07:09 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B75815AAB; Thu, 22 Oct 2020 11:07:08 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 85EEA5AA4 for ; Thu, 22 Oct 2020 11:07:07 +0200 (CEST) IronPort-SDR: 1kBxX6jcStK6OR8/eDMbLITq3jD1kzYKH4vkuImRLMcGnGfzXqucBdPxmF3dmADrirZGbAdndK vneConbO83KQ== X-IronPort-AV: E=McAfee;i="6000,8403,9781"; a="155282691" X-IronPort-AV: E=Sophos;i="5.77,404,1596524400"; d="scan'208";a="155282691" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Oct 2020 02:07:05 -0700 IronPort-SDR: VXg02DnckufbMCFpEP5z/6wZykYjbgPxXmsTTILyVH41XmKSQZeMl0hQ2dN7iR3JvlvVcq+9vb OVl4vrzL/EfA== X-IronPort-AV: E=Sophos;i="5.77,404,1596524400"; d="scan'208";a="533882851" Received: from unknown (HELO localhost.localdomain) ([10.240.183.80]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Oct 2020 02:07:04 -0700 From: Xie wei To: dts@dpdk.org Cc: Xie wei Date: Thu, 22 Oct 2020 17:09:37 +0800 Message-Id: <20201022090937.28791-1-weix.xie@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dts] [PATCH V1] tests/TestSuite_af_xdp_2:fixed save pcap file failed X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Sender: "dts" *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 --- 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