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 61AF8A0679 for ; Mon, 29 Apr 2019 07:31:08 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 582FE1B1F0; Mon, 29 Apr 2019 07:31:08 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 9BE3929AC for ; Mon, 29 Apr 2019 07:31:07 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Apr 2019 22:31:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,408,1549958400"; d="scan'208";a="138298280" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga008.jf.intel.com with ESMTP; 28 Apr 2019 22:31:06 -0700 Received: from shsmsx107.ccr.corp.intel.com (10.239.4.96) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.408.0; Sun, 28 Apr 2019 22:31:06 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.70]) by SHSMSX107.ccr.corp.intel.com ([169.254.9.7]) with mapi id 14.03.0415.000; Mon, 29 Apr 2019 13:31:04 +0800 From: "Peng, Yuan" To: "Xiao, QimaiX" , "dts@dpdk.org" CC: "Xiao, QimaiX" , "Peng, Yuan" Thread-Topic: [dts] [PATCH V1] update rss_to_rte_flow to reduce runtime Thread-Index: AQHU/Z6qvA/lF8hQJkuOkIe3lUv4eaZSmCeg Date: Mon, 29 Apr 2019 05:31:04 +0000 Message-ID: <67D543A150B29E4CAAE53918F64EDAEA376D6F95@SHSMSX103.ccr.corp.intel.com> References: <1556441337-15976-1-git-send-email-qimaix.xiao@intel.com> In-Reply-To: <1556441337-15976-1-git-send-email-qimaix.xiao@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [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" Acked-by: Peng, Yuan -----Original Message----- From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of xiao,qimai Sent: Sunday, April 28, 2019 4:49 PM To: dts@dpdk.org Cc: Xiao, QimaiX Subject: [dts] [PATCH V1] update rss_to_rte_flow to reduce runtime 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_rt= e_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. =20 """ =20 -import utils import time import re =20 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 =20 =20 class TestRSS_to_Rteflow(TestCase): @@ -99,14 +92,13 @@ class TestRSS_to_Rteflow(TestCase): """ get the queue which packet enter. """ - outstring =3D self.dut.send_expect("stop", "testpmd> ") - time.sleep(2) - result_scanner =3D r"Forward Stats for RX Port=3D %s/Queue=3D\s?([= 0-9]+)" % self.dut_ports[0] + outstring =3D self.pmdout.get_output() + result_scanner =3D r'port\s?%s/queue\s?(\d+):\s?received \d+ packe= ts' % self.dut_ports[0] scanner =3D re.compile(result_scanner, re.DOTALL) m =3D scanner.search(outstring) queue_id =3D 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 =20 def send_and_check(self, pkt, rss_queue): @@ -115,7 +107,6 @@ class TestRSS_to_Rteflow(TestCase): """ self.tester.scapy_append('sendp(%s, iface=3D"%s")' % (pkt, self.te= ster_itf)) self.tester.scapy_execute() - time.sleep(2) queue =3D self.get_queue_number() self.verify(queue in rss_queue, "the packet doesn't enter the expe= cted RSS queue.") return queue @@ -128,14 +119,14 @@ class TestRSS_to_Rteflow(TestCase): time.sleep(2) for i in range(128): if ptype =3D=3D "ipv4-udp": - packet =3D r'sendp([Ether(dst=3D"%s", src=3Dget_if_hwaddr(= "%s"))/IP(src=3D"192.168.0.%d", dst=3D"192.168.0.%d")/UDP(dport=3D%d, sport= =3D%d)], iface=3D"%s")' % ( - self.pf_mac, itf, i + 1, i + 2, i + 21, i + 22, itf) + packet =3D r'sendp([Ether(dst=3D"%s", src=3D"%s")/IP(src= =3D"192.168.0.%d", dst=3D"192.168.0.%d")/UDP(dport=3D%d, sport=3D%d)], ifac= e=3D"%s")' % ( + self.pf_mac, self.tester_mac, i + 1, i + 2, i + 21, i = + 22, itf) elif ptype =3D=3D "ipv4-other": - packet =3D r'sendp([Ether(dst=3D"%s", src=3Dget_if_hwaddr(= "%s"))/IP(src=3D"192.168.0.%d", dst=3D"192.168.0.%d")], iface=3D"%s")' % ( - self.pf_mac, itf, i + 1, i + 2, itf) + packet =3D r'sendp([Ether(dst=3D"%s", src=3D"%s")/IP(src= =3D"192.168.0.%d", dst=3D"192.168.0.%d")], iface=3D"%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) =20 def check_packet_queue(self, queue, out): """ --=20 2.17.0