From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 534F0A0679 for ; Sun, 28 Apr 2019 10:44:39 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0BFC31B470; Sun, 28 Apr 2019 10:44:39 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id EDEEC1B450 for ; Sun, 28 Apr 2019 10:44:36 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Apr 2019 01:44:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,405,1549958400"; d="scan'208";a="154427853" Received: from unknown (HELO localhost.localdomain.sh.intel.com) ([10.240.176.135]) by orsmga002.jf.intel.com with ESMTP; 28 Apr 2019 01:44:33 -0700 From: "xiao,qimai" To: dts@dpdk.org Cc: "xiao,qimai" Date: Sun, 28 Apr 2019 16:48:57 +0800 Message-Id: <1556441337-15976-1-git-send-email-qimaix.xiao@intel.com> X-Mailer: git-send-email 1.9.3 Subject: [dts] [PATCH V1] update rss_to_rte_flow to reduce runtime 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" optimize function of send packages with scapy Signed-off-by: xiao,qimai --- tests/TestSuite_rss_to_rte_flow.py | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/tests/TestSuite_rss_to_rte_flow.py b/tests/TestSuite_rss_to_rte_flow.py index 587888f..0ee55bc 100644 --- a/tests/TestSuite_rss_to_rte_flow.py +++ b/tests/TestSuite_rss_to_rte_flow.py @@ -36,18 +36,11 @@ Test moving RSS to rte_flow. """ -import utils import time import re from test_case import TestCase -from settings import HEADER_SIZE from pmd_output import PmdOutput -from settings import DRIVERS - -from project_dpdk import DPDKdut -from dut import Dut -from packet import Packet class TestRSS_to_Rteflow(TestCase): @@ -99,14 +92,13 @@ class TestRSS_to_Rteflow(TestCase): """ get the queue which packet enter. """ - outstring = self.dut.send_expect("stop", "testpmd> ") - time.sleep(2) - result_scanner = r"Forward Stats for RX Port= %s/Queue=\s?([0-9]+)" % self.dut_ports[0] + outstring = self.pmdout.get_output() + result_scanner = r'port\s?%s/queue\s?(\d+):\s?received \d+ packets' % self.dut_ports[0] scanner = re.compile(result_scanner, re.DOTALL) m = scanner.search(outstring) queue_id = m.group(1) - print "queue is %s" % queue_id - self.dut.send_expect("start", "testpmd> ") + print("queue is %s" % queue_id) + self.pmdout.execute_cmd("clear port stats all") return queue_id def send_and_check(self, pkt, rss_queue): @@ -115,7 +107,6 @@ class TestRSS_to_Rteflow(TestCase): """ self.tester.scapy_append('sendp(%s, iface="%s")' % (pkt, self.tester_itf)) self.tester.scapy_execute() - time.sleep(2) queue = self.get_queue_number() self.verify(queue in rss_queue, "the packet doesn't enter the expected RSS queue.") return queue @@ -128,14 +119,14 @@ class TestRSS_to_Rteflow(TestCase): time.sleep(2) for i in range(128): if ptype == "ipv4-udp": - packet = r'sendp([Ether(dst="%s", src=get_if_hwaddr("%s"))/IP(src="192.168.0.%d", dst="192.168.0.%d")/UDP(dport=%d, sport=%d)], iface="%s")' % ( - self.pf_mac, itf, i + 1, i + 2, i + 21, i + 22, itf) + packet = r'sendp([Ether(dst="%s", src="%s")/IP(src="192.168.0.%d", dst="192.168.0.%d")/UDP(dport=%d, sport=%d)], iface="%s")' % ( + self.pf_mac, self.tester_mac, i + 1, i + 2, i + 21, i + 22, itf) elif ptype == "ipv4-other": - packet = r'sendp([Ether(dst="%s", src=get_if_hwaddr("%s"))/IP(src="192.168.0.%d", dst="192.168.0.%d")], iface="%s")' % ( - self.pf_mac, itf, i + 1, i + 2, itf) + packet = r'sendp([Ether(dst="%s", src="%s")/IP(src="192.168.0.%d", dst="192.168.0.%d")], iface="%s")' % ( + self.pf_mac, self.tester_mac, i + 1, i + 2, itf) self.tester.scapy_append(packet) - self.tester.scapy_execute() - time.sleep(2) + self.tester.scapy_execute() + time.sleep(2) def check_packet_queue(self, queue, out): """ -- 2.17.0