From: "Yao, BingX Y" <bingx.y.yao@intel.com>
To: "Peng, Yuan" <yuan.peng@intel.com>, "dts@dpdk.org" <dts@dpdk.org>
Cc: "Peng, Yuan" <yuan.peng@intel.com>
Subject: Re: [dts] [PATCH v2] tests: add check items for symmetric cases
Date: Wed, 30 Jan 2019 02:41:56 +0000 [thread overview]
Message-ID: <95BCD24840F32441BEA74E0F8A31839E04EF1260@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <1548225976-22823-1-git-send-email-yuan.peng@intel.com>
Testyed-by: yaobing <bingx.y.yao@intel.com>
-----Original Message-----
From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Peng Yuan
Sent: Wednesday, January 23, 2019 2:46 PM
To: dts@dpdk.org
Cc: Peng, Yuan <yuan.peng@intel.com>
Subject: [dts] [PATCH v2] tests: add check items for symmetric cases
Add check items for symmetric cases of TestSuite_pmdrss_hash.py
Signed-off-by: Peng Yuan <yuan.peng@intel.com>
diff --git a/tests/TestSuite_pmdrss_hash.py b/tests/TestSuite_pmdrss_hash.py index 07c47b4..60c9819 100644
--- a/tests/TestSuite_pmdrss_hash.py
+++ b/tests/TestSuite_pmdrss_hash.py
@@ -41,9 +41,23 @@ import random
import re
import utils
-testQueues = [16]
+queue = 16
reta_entries = []
reta_num = 128
+iptypes = {'ipv4-sctp': 'sctp',
+ 'ipv4-other': 'ip',
+ 'ipv4-frag': 'ip',
+ 'ipv4-udp': 'udp',
+ 'ipv4-tcp': 'tcp',
+ # this hash not support in dpdk2.0
+ # 'l2_payload':'ether',
+ 'ipv6-other': 'ip',
+ 'ipv6-sctp': 'sctp',
+ 'ipv6-udp': 'udp',
+ 'ipv6-tcp': 'tcp',
+ 'ipv6-frag': 'ip'
+ }
+
# Use scapy to send packets with different source and dest ip.
# and collect the hash result of five tuple and the queue id.
from test_case import TestCase
@@ -389,19 +403,23 @@ class TestPmdrssHash(TestCase):
i = 0
for tmp_reta_line in reta_lines:
- status = "true"
+ status = "false"
# compute the hash result of five tuple into the 7 LSBs value.
hash_index = int(tmp_reta_line["RSS hash"], 16) % reta_num
-
- if(i % 2 == 1):
- if(pre_RSS_hash == tmp_reta_line["RSS hash"]):
- status = "true"
- result.insert((i - 1) / 2, 0)
- else:
- status = "fail"
- result.insert((i - 1) / 2, 1)
- pre_RSS_hash = tmp_reta_line["RSS hash"]
-
+ if(reta_entries[hash_index] == int(tmp_reta_line["queue"])):
+ status = "true"
+ result.insert(i, 0)
+ if(i % 2 == 1):
+ if(pre_RSS_hash == tmp_reta_line["RSS hash"]):
+ status = "true"
+ result.insert(len(reta_lines) + (i - 1) / 2, 0)
+ else:
+ status = "fail"
+ result.insert(len(reta_lines) + (i - 1) / 2, 1)
+ pre_RSS_hash = tmp_reta_line["RSS hash"]
+ else:
+ status = "fail"
+ result.insert(i, 1)
self.result_table_add(
[i, tmp_reta_line["RSS hash"], hash_index, reta_entries[hash_index], tmp_reta_line["queue"], status])
i = i + 1
@@ -417,19 +435,30 @@ class TestPmdrssHash(TestCase):
self.verify(self.nic in ["fortville_eagle", "fortville_spirit",
"fortville_spirit_single", "redrockcanyou", "atwood",
- "boulderrapid", "fortpark_TLV", "fortville_25g"],
+ "boulderrapid", "fortpark_TLV", "fortville_25g",
+ "niantic"],
"NIC Unsupported: " + str(self.nic))
global reta_num
+ global iptypes
+
if self.nic in ["fortville_eagle", "fortville_spirit", "fortville_spirit_single", "fortpark_TLV", "fortville_25g"]:
reta_num = 512
elif self.nic in ["niantic"]:
reta_num = 128
+ iptypes = {'ipv4-other': 'ip',
+ 'ipv4-frag': 'ip',
+ 'ipv4-udp': 'udp',
+ 'ipv4-tcp': 'tcp',
+ 'ipv6-other': 'ip',
+ 'ipv6-udp': 'udp',
+ 'ipv6-tcp': 'tcp',
+ 'ipv6-frag': 'ip'
+ }
elif self.nic in ["redrockcanyou", "atwood", "boulderrapid"]:
reta_num = 128
else:
self.verify(False, "NIC Unsupported:%s" % str(self.nic))
ports = self.dut.get_ports(self.nic)
- self.verify(len(ports) >= 2, "Not enough ports available")
+ self.verify(len(ports) >= 1, "Not enough ports available")
def set_up(self):
"""
@@ -442,49 +471,35 @@ class TestPmdrssHash(TestCase):
localPort = self.tester.get_local_port(dutPorts[0])
itf = self.tester.get_interface(localPort)
global reta_num
- iptypes = {'ipv4-sctp': 'sctp',
- 'ipv4-other': 'ip',
- 'ipv4-frag': 'ip',
- 'ipv4-udp': 'udp',
- 'ipv4-tcp': 'tcp',
- # this hash not support in dpdk2.0
- # 'l2_payload':'ether',
- 'ipv6-other': 'ip',
- 'ipv6-sctp': 'sctp',
- 'ipv6-udp': 'udp',
- 'ipv6-tcp': 'tcp',
- 'ipv6-frag': 'ip'
- }
+ global iptypes
self.dut.kill_all()
# test with different rss queues
- for queue in testQueues:
+ self.dut.send_expect(
+ "./%s/app/testpmd -c fffff -n %d -- -i --coremask=0xffffe --rxq=%d --txq=%d" %
+ (self.target, self.dut.get_memory_channels(), queue,
+ queue), "testpmd> ", 120)
+
+ for iptype, rsstype in iptypes.items():
+ self.dut.send_expect("set verbose 8", "testpmd> ")
+ self.dut.send_expect("set fwd rxonly", "testpmd> ")
self.dut.send_expect(
- "./%s/app/testpmd -c fffff -n %d -- -i --coremask=0xffffe --rxq=%d --txq=%d" %
- (self.target, self.dut.get_memory_channels(), queue, queue), "testpmd> ", 120)
+ "set nbcore %d" % (queue + 1), "testpmd> ")
- for iptype, rsstype in iptypes.items():
- self.dut.send_expect("set verbose 8", "testpmd> ")
- self.dut.send_expect("set fwd rxonly", "testpmd> ")
+ self.dut.send_expect("port stop all", "testpmd> ")
+ self.dut.send_expect(
+ "set_hash_global_config 0 toeplitz %s enable" % iptype, "testpmd> ")
+ self.dut.send_expect("port start all", "testpmd> ")
+ out = self.dut.send_expect(
+ "port config all rss %s" % rsstype, "testpmd> ")
+ self.verify("error" not in out, "Configuration of RSS hash failed: Invalid argument")
+ # configure the reta with specific mappings.
+ for i in range(reta_num):
+ reta_entries.insert(i, random.randint(0, queue - 1))
self.dut.send_expect(
- "set nbcore %d" % (queue + 1), "testpmd> ")
+ "port config 0 rss reta (%d,%d)" % (i,
+ reta_entries[i]), "testpmd> ")
- self.dut.send_expect("port stop all", "testpmd> ")
- # self.dut.send_expect("port config all rss ip", "testpmd> ")
- self.dut.send_expect(
- "set_hash_global_config 0 toeplitz %s enable" % iptype, "testpmd> ")
- self.dut.send_expect("port start all", "testpmd> ")
- out = self.dut.send_expect(
- "port config all rss %s" % rsstype, "testpmd> ")
- self.verify("error" not in out, "Configuration of RSS hash failed: Invalid argument")
- # configure the reta with specific mappings.
- for i in range(reta_num):
- reta_entries.insert(i, random.randint(0, queue - 1))
- self.dut.send_expect(
- "port config 0 rss reta (%d,%d)" % (i, reta_entries[i]), "testpmd> ")
-
- self.send_packet(itf, iptype)
+ self.send_packet(itf, iptype)
self.dut.send_expect("quit", "# ", 30)
@@ -493,72 +508,48 @@ class TestPmdrssHash(TestCase):
localPort = self.tester.get_local_port(dutPorts[0])
itf = self.tester.get_interface(localPort)
global reta_num
- iptypes = {'ipv4-sctp': 'sctp',
- 'ipv4-other': 'ip',
- 'ipv4-frag': 'ip',
- 'ipv4-udp': 'udp',
- 'ipv4-tcp': 'tcp',
- # this hash not support in dpdk2.0
- # 'l2_payload':'ether',
- 'ipv6-other': 'ip',
- 'ipv6-sctp': 'sctp',
- 'ipv6-udp': 'udp',
- 'ipv6-tcp': 'tcp',
- 'ipv6-frag': 'ip'
- }
+ global iptypes
self.dut.kill_all()
# test with different rss queues
- for queue in testQueues:
- self.dut.send_expect(
- "./%s/app/testpmd -c fffff -n %d -- -i --coremask=0xffffe --rxq=%d --txq=%d" %
- (self.target, self.dut.get_memory_channels(), queue, queue), "testpmd> ", 120)
+ self.dut.send_expect(
+ "./%s/app/testpmd -c fffff -n %d -- -i --coremask=0xffffe --rxq=%d --txq=%d" %
+ (self.target, self.dut.get_memory_channels(), queue,
+ queue), "testpmd> ", 120)
- for iptype, rsstype in iptypes.items():
- self.dut.send_expect("set verbose 8", "testpmd> ")
- self.dut.send_expect("set fwd rxonly", "testpmd> ")
- self.dut.send_expect(
- "set nbcore %d" % (queue + 1), "testpmd> ")
+ for iptype, rsstype in iptypes.items():
+ self.dut.send_expect("set verbose 8", "testpmd> ")
+ self.dut.send_expect("set fwd rxonly", "testpmd> ")
+ self.dut.send_expect(
+ "set nbcore %d" % (queue + 1), "testpmd> ")
- self.dut.send_expect("port stop all", "testpmd> ")
- self.dut.send_expect(
- "set_hash_global_config 0 toeplitz %s enable" % iptype, "testpmd> ")
+ self.dut.send_expect("port stop all", "testpmd> ")
+ self.dut.send_expect(
+ "set_hash_global_config 0 toeplitz %s enable" % iptype, "testpmd> ")
+ self.dut.send_expect(
+ "set_sym_hash_ena_per_port 0 enable", "testpmd> ")
+ self.dut.send_expect("port start all", "testpmd> ")
+ out = self.dut.send_expect(
+ "port config all rss %s" % rsstype, "testpmd> ")
+ self.verify("error" not in out, "Configuration of RSS hash
+ failed: Invalid argument")
+
+ # configure the reta with specific mappings.
+ for i in range(reta_num):
+ reta_entries.insert(i, random.randint(0, queue - 1))
self.dut.send_expect(
- "set_sym_hash_ena_per_port 0 enable", "testpmd> ")
- self.dut.send_expect("port start all", "testpmd> ")
- out = self.dut.send_expect(
- "port config all rss %s" % rsstype, "testpmd> ")
- self.verify("error" not in out, "Configuration of RSS hash failed: Invalid argument")
+ "port config 0 rss reta (%d,%d)" % (i,
+ reta_entries[i]), "testpmd> ")
- # configure the reta with specific mappings.
- for i in range(reta_num):
- reta_entries.insert(i, random.randint(0, queue - 1))
- self.dut.send_expect(
- "port config 0 rss reta (%d,%d)" % (i, reta_entries[i]), "testpmd> ")
+ self.send_packet_symmetric(itf, iptype)
- self.send_packet_symmetric(itf, iptype)
-
- self.dut.send_expect("quit", "# ", 30)
+ self.dut.send_expect("quit", "# ", 30)
def test_simple(self):
dutPorts = self.dut.get_ports(self.nic)
localPort = self.tester.get_local_port(dutPorts[0])
itf = self.tester.get_interface(localPort)
global reta_num
- iptypes = {'ipv4-sctp': 'sctp',
- 'ipv4-other': 'ip',
- 'ipv4-frag': 'ip',
- 'ipv4-udp': 'udp',
- 'ipv4-tcp': 'tcp',
- # this hass not support in dpdk 2.0
- # 'l2_payload':'ether',
- 'ipv6-other': 'ip',
- 'ipv6-sctp': 'sctp',
- 'ipv6-udp': 'udp',
- 'ipv6-tcp': 'tcp',
- 'ipv6-frag': 'ip'
- }
+ global iptypes
+
if self.kdriver in ["fm10k"]:
iptypes.pop('ipv4-sctp')
iptypes.pop('ipv6-sctp')
@@ -566,36 +557,34 @@ class TestPmdrssHash(TestCase):
self.dut.kill_all()
# test with different rss queues
- for queue in testQueues:
+ self.dut.send_expect(
+ "./%s/app/testpmd -c fffff -n %d -- -i --coremask=0xffffe --rxq=%d --txq=%d" %
+ (self.target, self.dut.get_memory_channels(), queue,
+ queue), "testpmd> ", 120)
+
+ for iptype, rsstype in iptypes.items():
+ self.logger.info("***********************%s rss test********************************" % iptype)
+ self.dut.send_expect("set verbose 8", "testpmd> ")
+ self.dut.send_expect("set fwd rxonly", "testpmd> ")
self.dut.send_expect(
- "./%s/app/testpmd -c fffff -n %d -- -i --coremask=0xffffe --rxq=%d --txq=%d" %
- (self.target, self.dut.get_memory_channels(), queue, queue), "testpmd> ", 120)
+ "set nbcore %d" % (queue + 1), "testpmd> ")
- for iptype, rsstype in iptypes.items():
- self.logger.info("***********************%s rss test********************************" % iptype)
- self.dut.send_expect("set verbose 8", "testpmd> ")
- self.dut.send_expect("set fwd rxonly", "testpmd> ")
+ self.dut.send_expect("port stop all", "testpmd> ")
+ # some nic not support change hash algorithm
+ if self.kdriver not in ["fm10k"]:
+ self.dut.send_expect(
+ "set_hash_global_config 0 simple_xor %s enable" % iptype, "testpmd> ")
+ self.dut.send_expect("port start all", "testpmd> ")
+ out = self.dut.send_expect(
+ "port config all rss %s" % rsstype, "testpmd> ")
+ self.verify("error" not in out, "Configuration of RSS hash failed: Invalid argument")
+ # configure the reta with specific mappings.
+ for i in range(reta_num):
+ reta_entries.insert(i, random.randint(0, queue - 1))
self.dut.send_expect(
- "set nbcore %d" % (queue + 1), "testpmd> ")
-
- self.dut.send_expect("port stop all", "testpmd> ")
- # some nic not support change hash algorithm
- if self.kdriver not in ["fm10k"]:
- self.dut.send_expect(
- "set_hash_global_config 0 simple_xor %s enable" % iptype, "testpmd> ")
- self.dut.send_expect("port start all", "testpmd> ")
- out = self.dut.send_expect(
- "port config all rss %s" % rsstype, "testpmd> ")
- self.verify("error" not in out, "Configuration of RSS hash failed: Invalid argument")
- # configure the reta with specific mappings.
- for i in range(reta_num):
- reta_entries.insert(i, random.randint(0, queue - 1))
- self.dut.send_expect(
- "port config 0 rss reta (%d,%d)" % (i, reta_entries[i]), "testpmd> ")
-
- self.send_packet(itf, iptype)
-
- self.dut.send_expect("quit", "# ", 30)
+ "port config 0 rss reta (%d,%d)" % (i, reta_entries[i]), "testpmd> ")
+ self.send_packet(itf, iptype)
+
+ self.dut.send_expect("quit", "# ", 30)
def test_simple_symmetric(self):
@@ -603,57 +592,46 @@ class TestPmdrssHash(TestCase):
localPort = self.tester.get_local_port(dutPorts[0])
itf = self.tester.get_interface(localPort)
global reta_num
- iptypes = {'ipv4-sctp': 'sctp',
- 'ipv4-other': 'ip',
- 'ipv4-frag': 'ip',
- 'ipv4-udp': 'udp',
- 'ipv4-tcp': 'tcp',
- # this hash not support in dpdk2.0
- # 'l2_payload':'ether',
- 'ipv6-other': 'ip',
- 'ipv6-sctp': 'sctp',
- 'ipv6-udp': 'udp',
- 'ipv6-tcp': 'tcp',
- 'ipv6-frag': 'ip'
- }
+ global iptypes
self.dut.kill_all()
# test with different rss queues
- for queue in testQueues:
- self.dut.send_expect(
- "./%s/app/testpmd -c fffff -n %d -- -i --coremask=0xffffe --rxq=%d --txq=%d" %
- (self.target, self.dut.get_memory_channels(), queue, queue), "testpmd> ", 120)
+ self.dut.send_expect(
+ "./%s/app/testpmd -c fffff -n %d -- -i --coremask=0xffffe --rxq=%d --txq=%d" %
+ (self.target, self.dut.get_memory_channels(), queue,
+ queue), "testpmd> ", 120)
- for iptype, rsstype in iptypes.items():
- self.dut.send_expect("set verbose 8", "testpmd> ")
- self.dut.send_expect("set fwd rxonly", "testpmd> ")
- self.dut.send_expect(
- "set nbcore %d" % (queue + 1), "testpmd> ")
+ for iptype, rsstype in iptypes.items():
+ self.dut.send_expect("set verbose 8", "testpmd> ")
+ self.dut.send_expect("set fwd rxonly", "testpmd> ")
+ self.dut.send_expect(
+ "set nbcore %d" % (queue + 1), "testpmd> ")
- self.dut.send_expect("port stop all", "testpmd> ")
- # self.dut.send_expect("port config all rss ip", "testpmd> ")
- self.dut.send_expect(
- "set_hash_global_config 0 simple_xor %s enable" % iptype, "testpmd> ")
+ self.dut.send_expect("port stop all", "testpmd> ")
+ self.dut.send_expect(
+ "set_hash_global_config 0 simple_xor %s enable" % iptype, "testpmd> ")
+ self.dut.send_expect(
+ "set_sym_hash_ena_per_port 0 enable", "testpmd> ")
+ self.dut.send_expect("port start all", "testpmd> ")
+
+ out = self.dut.send_expect(
+ "port config all rss %s" % rsstype, "testpmd> ")
+ self.verify("error" not in out, "Configuration of RSS hash failed: Invalid argument")
+ # configure the reta with specific mappings.
+ for i in range(reta_num):
+ reta_entries.insert(i, random.randint(0, queue - 1))
self.dut.send_expect(
- "set_sym_hash_ena_per_port 0 enable", "testpmd> ")
- self.dut.send_expect("port start all", "testpmd> ")
-
- out = self.dut.send_expect(
- "port config all rss %s" % rsstype, "testpmd> ")
- self.verify("error" not in out, "Configuration of RSS hash failed: Invalid argument")
- # configure the reta with specific mappings.
- for i in range(reta_num):
- reta_entries.insert(i, random.randint(0, queue - 1))
- self.dut.send_expect(
- "port config 0 rss reta (%d,%d)" % (i, reta_entries[i]), "testpmd> ")
+ "port config 0 rss reta (%d,%d)" % (i, reta_entries[i]), "testpmd> ")
+ self.send_packet_symmetric(itf, iptype)
- self.send_packet_symmetric(itf, iptype)
-
- self.dut.send_expect("quit", "# ", 30)
+ self.dut.send_expect("quit", "# ", 30)
def test_dynamic_rss_bond_config(self):
# setup testpmd and finish bond config
+ self.verify(self.nic in ["fortville_eagle", "fortville_spirit",
+ "fortpark_TLV", "fortville_25g"],
+ "NIC Unsupported: " + str(self.nic))
+
self.dut.send_expect("./%s/app/testpmd -c f -n 4 -- -i" % self.target, "testpmd> ", 120)
out = self.dut.send_expect("create bonded device 3 0", "testpmd> ", 30)
bond_device_id = int(re.search("port \d+", out).group().split(" ")[-1].strip())
--
2.5.0
next prev parent reply other threads:[~2019-01-30 2:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-23 6:46 Peng Yuan
2019-01-30 2:41 ` Yao, BingX Y [this message]
2019-01-30 3:07 ` Tu, Lijuan
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=95BCD24840F32441BEA74E0F8A31839E04EF1260@shsmsx102.ccr.corp.intel.com \
--to=bingx.y.yao@intel.com \
--cc=dts@dpdk.org \
--cc=yuan.peng@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).