test suite reviews and discussions
 help / color / mirror / Atom feed
From: "Peng, Yuan" <yuan.peng@intel.com>
To: "Xiao, QimaiX" <qimaix.xiao@intel.com>, "dts@dpdk.org" <dts@dpdk.org>
Cc: "Xiao, QimaiX" <qimaix.xiao@intel.com>,
	"Peng, Yuan" <yuan.peng@intel.com>
Subject: Re: [dts] [PATCH V1] update rss_to_rte_flow to reduce runtime
Date: Mon, 29 Apr 2019 05:31:04 +0000	[thread overview]
Message-ID: <67D543A150B29E4CAAE53918F64EDAEA376D6F95@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <1556441337-15976-1-git-send-email-qimaix.xiao@intel.com>

Acked-by: Peng, Yuan <yuan.peng@intel.com>

-----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 <qimaix.xiao@intel.com>
Subject: [dts] [PATCH V1] update rss_to_rte_flow to reduce runtime

optimize function of send packages with scapy

Signed-off-by: xiao,qimai <qimaix.xiao@intel.com>
---
 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


  reply	other threads:[~2019-04-29  5:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-28  8:48 xiao,qimai
2019-04-29  5:31 ` Peng, Yuan [this message]
2019-05-09  3:30 ` Tu, Lijuan
  -- strict thread matches above, loose matches on Subject: below --
2019-04-28  8:42 xiao,qimai
2019-04-28  7:14 xiao,qimai

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=67D543A150B29E4CAAE53918F64EDAEA376D6F95@SHSMSX103.ccr.corp.intel.com \
    --to=yuan.peng@intel.com \
    --cc=dts@dpdk.org \
    --cc=qimaix.xiao@intel.com \
    /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).