test suite reviews and discussions
 help / color / mirror / Atom feed
From: <nareddy@marvell.com>
To: <dts@dpdk.org>
Cc: <pvukkisala@marvell.com>, Praneeth Reddy <nareddy@marvell.com>
Subject: [dts] [PATCH] TestSuite_pmdrssreta.py: Modified test case to support vector mode and made few changes for cavium_a063 and cavium_a064
Date: Fri, 13 Dec 2019 16:56:43 +0530	[thread overview]
Message-ID: <1576236403-24341-1-git-send-email-nareddy@marvell.com> (raw)

From: Praneeth Reddy <nareddy@marvell.com>

- Sending 4 packets to support vector mode
- For cavium_a063 and cavium_a064 rx-offloads parameter is required to support RSS hash
- For cavium_a063 and cavium_a064 Hash value must be 32 bit

Signed-off-by: Praneeth Reddy <nareddy@marvell.com>
---
 tests/TestSuite_pmdrssreta.py | 45 ++++++++++++++++++++++++-------------------
 1 file changed, 25 insertions(+), 20 deletions(-)

diff --git a/tests/TestSuite_pmdrssreta.py b/tests/TestSuite_pmdrssreta.py
index a2f2d3e..0fddb17 100644
--- a/tests/TestSuite_pmdrssreta.py
+++ b/tests/TestSuite_pmdrssreta.py
@@ -63,42 +63,42 @@ class TestPmdrssreta(TestCase):
         # send packet with different source and dest ip
         if tran_type == "IPV4":
             for i in range(16):
-                packet = r'sendp([Ether(dst="%s", src="02:00:00:00:00:00")/IP(src="192.168.0.%d", dst="192.168.0.%d")], iface="%s")' % (
+                packet = r'sendp([Ether(dst="%s", src="02:00:00:00:00:00")/IP(src="192.168.0.%d", dst="192.168.0.%d")], iface="%s", count=4)' % (
                     mac, i + 1, i + 2, itf)
                 self.tester.scapy_append(packet)
             self.tester.scapy_execute()
             time.sleep(.5)
         elif tran_type == "IPV4&TCP":
             for i in range(16):
-                packet = r'sendp([Ether(dst="%s", src="02:00:00:00:00:00")/IP(src="192.168.0.%d", dst="192.168.0.%d")/TCP(sport=1024,dport=1024)], iface="%s")' % (
+                packet = r'sendp([Ether(dst="%s", src="02:00:00:00:00:00")/IP(src="192.168.0.%d", dst="192.168.0.%d")/TCP(sport=1024,dport=1024)], iface="%s", count=4)' % (
                     mac, i + 1, i + 2, itf)
                 self.tester.scapy_append(packet)
             self.tester.scapy_execute()
             time.sleep(.5)
         elif tran_type == "IPV4&UDP":
             for i in range(16):
-                packet = r'sendp([Ether(dst="%s", src="02:00:00:00:00:00")/IP(src="192.168.0.%d", dst="192.168.0.%d")/UDP(sport=1024,dport=1024)], iface="%s")' % (
+                packet = r'sendp([Ether(dst="%s", src="02:00:00:00:00:00")/IP(src="192.168.0.%d", dst="192.168.0.%d")/UDP(sport=1024,dport=1024)], iface="%s", count=4)' % (
                     mac, i + 1, i + 2, itf)
                 self.tester.scapy_append(packet)
             self.tester.scapy_execute()
             time.sleep(.5)
         elif tran_type == "IPV6":
             for i in range(16):
-                packet = r'sendp([Ether(dst="%s", src="02:00:00:00:00:00")/IPv6(src="3ffe:2501:200:1fff::%d", dst="3ffe:2501:200:3::%d")], iface="%s")' % (
+                packet = r'sendp([Ether(dst="%s", src="02:00:00:00:00:00")/IPv6(src="3ffe:2501:200:1fff::%d", dst="3ffe:2501:200:3::%d")], iface="%s", count=4)' % (
                     mac, i + 1, i + 2, itf)
                 self.tester.scapy_append(packet)
             self.tester.scapy_execute()
             time.sleep(.5)
         elif tran_type == "IPV6&TCP":
             for i in range(16):
-                packet = r'sendp([Ether(dst="%s", src="02:00:00:00:00:00")/IPv6(src="3ffe:2501:200:1fff::%d", dst="3ffe:2501:200:3::%d")/TCP(sport=1024,dport=1024)], iface="%s")' % (
+                packet = r'sendp([Ether(dst="%s", src="02:00:00:00:00:00")/IPv6(src="3ffe:2501:200:1fff::%d", dst="3ffe:2501:200:3::%d")/TCP(sport=1024,dport=1024)], iface="%s", count=4)' % (
                     mac, i + 1, i + 2, itf)
                 self.tester.scapy_append(packet)
             self.tester.scapy_execute()
             time.sleep(.5)
         elif tran_type == "IPV6&UDP":
             for i in range(16):
-                packet = r'sendp([Ether(dst="%s", src="02:00:00:00:00:00")/IPv6(src="3ffe:2501:200:1fff::%d", dst="3ffe:2501:200:3::%d")/UDP(sport=1024,dport=1024)], iface="%s")' % (
+                packet = r'sendp([Ether(dst="%s", src="02:00:00:00:00:00")/IPv6(src="3ffe:2501:200:1fff::%d", dst="3ffe:2501:200:3::%d")/UDP(sport=1024,dport=1024)], iface="%s", count=4)' % (
                     mac, i + 1, i + 2, itf)
                 self.tester.scapy_append(packet)
             self.tester.scapy_execute()
@@ -119,17 +119,13 @@ class TestPmdrssreta(TestCase):
                     if(item.startswith("RSS hash")):
                         name, value = item.split("=", 1)
                         print name + "-" + value
+                        reta_line[name.strip()] = value.strip()
+
+                    elif(item.startswith("RSS queue")):
+                        name, value = item.split("=", 1)
+                        reta_line["queue"] = int(value.strip(),16)
 
-                reta_line[name.strip()] = value.strip()
                 reta_lines.append(reta_line)
-                reta_line = {}
-            elif len(line) != 0 and line.strip().startswith("port "):
-                rexp = r"port (\d)/queue (\d{1,2}): received (\d) packets"
-                m = re.match(rexp, line.strip())
-                if m:
-                    reta_line["port"] = m.group(1)
-                    reta_line["queue"] = m.group(2)
-            elif len(line) != 0 and line.startswith("stop"):
                 break
             else:
                 pass
@@ -153,6 +149,7 @@ class TestPmdrssreta(TestCase):
                 # compute the hash result using simple XOR.
                 hash_index_tmp = 0
                 index_tmp = tmp_reta_line["RSS hash"].strip("0x")
+                index_tmp = index_tmp.zfill(8)
                 index_tmp = textwrap.wrap(index_tmp,2)
                 index_tmp = [hex(int(index,16)) for index in index_tmp]
                 for index in  index_tmp:
@@ -215,12 +212,20 @@ class TestPmdrssreta(TestCase):
 
         # test with different rss queues
         for queue in testQueues:
-            if(queue == 16):
-                self.pmdout.start_testpmd(
-                    "all", "--rxq=%d --txq=%d" % (queue, queue), socket=self.ports_socket)
+            if(self.nic in ["cavium_a063", "cavium_a064"]):
+                if(queue == 16):
+                    self.pmdout.start_testpmd(
+                        "all", "--rxq=%d --txq=%d --rx-offloads=0x00080000" % (queue, queue), socket=self.ports_socket)
+                else:
+                    self.pmdout.start_testpmd(
+                        "all", "--mbcache=128 --rxq=%d --txq=%d --rx-offloads=0x00080000" % (queue, queue), socket=self.ports_socket)
             else:
-                self.pmdout.start_testpmd(
-                    "all", "--mbcache=128 --rxq=%d --txq=%d" % (queue, queue), socket=self.ports_socket)
+                if(queue == 16):
+                    self.pmdout.start_testpmd(
+                        "all", "--rxq=%d --txq=%d" % (queue, queue), socket=self.ports_socket)
+                else:
+                    self.pmdout.start_testpmd(
+                        "all", "--mbcache=128 --rxq=%d --txq=%d" % (queue, queue), socket=self.ports_socket)
 
             for iptype, rsstype in iptypes.items():
                 self.dut.send_expect("set verbose 8", "testpmd> ")
-- 
1.8.3.1


                 reply	other threads:[~2019-12-13 11:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1576236403-24341-1-git-send-email-nareddy@marvell.com \
    --to=nareddy@marvell.com \
    --cc=dts@dpdk.org \
    --cc=pvukkisala@marvell.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).