test suite reviews and discussions
 help / color / mirror / Atom feed
From: "Yao, BingX Y" <bingx.y.yao@intel.com>
To: "Li, WenjieX A" <wenjiex.a.li@intel.com>, "dts@dpdk.org" <dts@dpdk.org>
Cc: "Li, WenjieX A" <wenjiex.a.li@intel.com>
Subject: Re: [dts] [PATCH V2] tests/shutdown_api: update enable_disablerss
Date: Fri, 25 Jan 2019 07:31:16 +0000	[thread overview]
Message-ID: <95BCD24840F32441BEA74E0F8A31839E04EEAE51@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <1548395505-33406-1-git-send-email-wenjiex.a.li@intel.com>

Tested-by: yaobing <bingx.y.yao@intel.com>

-----Original Message-----
From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Wenjie Li
Sent: Friday, January 25, 2019 1:52 PM
To: dts@dpdk.org
Cc: Li, WenjieX A <wenjiex.a.li@intel.com>
Subject: [dts] [PATCH V2] tests/shutdown_api: update enable_disablerss

Align to the changes of test plan.

Signed-off-by: Wenjie Li <wenjiex.a.li@intel.com>
---
V1:
1. start testpmd with "--txq=16 --rxq=16".
2. change the command to enable rss.
3. check all forward packets are not in the same queue.
4. add parameter "enable_rss" in check_forwarding() and send_packet() to get the queue id of forward packet.

V2:
Get the queue id only when rss is enabled.

 tests/TestSuite_shutdown_api.py | 31 ++++++++++++++++++++++++-------
 1 file changed, 24 insertions(+), 7 deletions(-)

diff --git a/tests/TestSuite_shutdown_api.py b/tests/TestSuite_shutdown_api.py index 9f3f03f..2569159 100644
--- a/tests/TestSuite_shutdown_api.py
+++ b/tests/TestSuite_shutdown_api.py
@@ -40,6 +40,7 @@ import utils
 import time
 import re
 import os
+import random
 from test_case import TestCase
 from pmd_output import PmdOutput
 from settings import HEADER_SIZE, PROTOCOL_PACKET_SIZE @@ -83,14 +84,14 @@ class TestShutdownApi(TestCase):
         stats = output.get_pmd_stats(portid)
         return stats
 
-    def check_forwarding(self, ports=None, pktSize=68, received=True, vlan=False, promisc=False, vlan_strip=False):
+    def check_forwarding(self, ports=None, pktSize=68, received=True, vlan=False, promisc=False, vlan_strip=False, enable_rss=False):
         if ports is None:
             ports = self.ports
         if len(ports) == 1:
-            self.send_packet(ports[0], ports[0], pktSize, received, vlan, promisc, vlan_strip)
+            self.send_packet(ports[0], ports[0], pktSize, received, 
+ vlan, promisc, vlan_strip, enable_rss)
             return
 
-    def send_packet(self, txPort, rxPort, pktSize=68, received=True, vlan=False, promisc=False, vlan_strip=False):
+    def send_packet(self, txPort, rxPort, pktSize=68, received=True, vlan=False, promisc=False, vlan_strip=False, enable_rss=False):
         """
         Send packages according to parameters.
         """
@@ -113,11 +114,19 @@ class TestShutdownApi(TestCase):
             pkg = 'Ether(src="%s", dst="%s")/Dot1Q(vlan=1)/IP()/Raw(load="P" * %d)' % (smac, dmac, padding)
         else:
             padding = pktSize - HEADER_SIZE['eth'] - HEADER_SIZE['ip']
-            pkg = 'Ether(src="%s", dst="%s")/IP()/Raw(load="P" * %d)' % (smac, dmac, padding)
+            if enable_rss:
+                sip = "192.168.0.1"
+                dip = "192.168.0.%s" % random.randint(2, 254)
+                pkg = 'Ether(src="%s", dst="%s")/IP(src="%s", dst="%s")/Raw(load="P" * %d)' % (smac, dmac, sip, dip, padding)
+            else:
+                pkg = 'Ether(src="%s", dst="%s")/IP()/Raw(load="P" * 
+ %d)' % (smac, dmac, padding)
 
         self.tester.scapy_foreground()
         self.tester.scapy_append('sendp(%s, iface="%s")' % (pkg, itf))
         self.tester.scapy_execute()
+        if enable_rss:
+            out = self.dut.get_session_output()
+            self.acutal_queue_id = int(re.compile('Receive 
+ queue=(.*?)\s+?').findall(out, re.S)[0], 16)
         time.sleep(3)
 
         port0_stats = self.get_stats(txPort) @@ -397,14 +406,22 @@ class TestShutdownApi(TestCase):
         """
         Enable/Disable RSS.
         """
-        self.pmdout.start_testpmd("Default", "--portmask=%s --port-topology=loop" % utils.create_mask(self.ports), socket=self.ports_socket)
+        self.queue_num = 16
+        self.pmdout.start_testpmd("Default", "--portmask=%s --port-topology=loop --txq=%s --rxq=%s" 
+                % (utils.create_mask(self.ports), self.queue_num, 
+ self.queue_num), socket=self.ports_socket)
 
         self.dut.send_expect("port stop all", "testpmd> ", 100)
-        self.dut.send_expect("port config rss ip", "testpmd> ")
+        self.dut.send_expect("port config all rss ip", "testpmd> ")
         self.dut.send_expect("set fwd mac", "testpmd>")
         self.dut.send_expect("port start all", "testpmd> ", 100)
         self.dut.send_expect("start", "testpmd> ")
-        self.check_forwarding()
+        self.dut.send_expect("set verbose 1", "testpmd> ")
+        queue_list = []
+        for i in range(0, self.queue_num):
+            self.check_forwarding(enable_rss=True)
+            queue_list.append(self.acutal_queue_id)
+        print("Forward packets to queues: %s" % queue_list)
+        self.verify(len(list(set(queue_list))) > 1, "All packets were 
+ send to the same queue %s" %self.acutal_queue_id)
 
     def test_change_numberrxdtxd(self):
         """
--
2.17.2

      reply	other threads:[~2019-01-25  7:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-25  5:51 Wenjie Li
2019-01-25  7:31 ` Yao, BingX Y [this message]

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=95BCD24840F32441BEA74E0F8A31839E04EEAE51@shsmsx102.ccr.corp.intel.com \
    --to=bingx.y.yao@intel.com \
    --cc=dts@dpdk.org \
    --cc=wenjiex.a.li@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).