* [dts] PATCH V4] fix check packet failure by lldp have different packet size
2017-05-23 6:31 [dts] [PATCH V4 1/2] add link bonding rss dynamic config test plane xu,huilong
@ 2017-05-23 6:31 ` xu,huilong
2017-05-25 10:41 ` Liu, Yong
2017-05-23 6:31 ` [dts] PATCH V4 2/2] add link bond slave dynamic config test case xu,huilong
1 sibling, 1 reply; 5+ messages in thread
From: xu,huilong @ 2017-05-23 6:31 UTC (permalink / raw)
To: dts; +Cc: xu,huilong
fortville will send different size lldp packet, so should update chcek function.
now we know lldp size is 110 or 100 in dpdk17.05 by debug.
Signed-off-by: xu,huilong <huilongx.xu@intel.com>
---
framework/pmd_output.py | 7 ++++++-
framework/settings.py | 2 +-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/framework/pmd_output.py b/framework/pmd_output.py
index ca361a7..260f42c 100644
--- a/framework/pmd_output.py
+++ b/framework/pmd_output.py
@@ -203,7 +203,12 @@ class PmdOutput():
so should used (tx_bytes - exp_bytes) % PROTOCOL_PACKET_SIZE['lldp']
for check tx_bytes count right
"""
- return not (tx_bytes - exp_bytes) % PROTOCOL_PACKET_SIZE['lldp']
+ # error_flage is true means tx_bytes different with expect bytes
+ error_flage = 1
+ for size in PROTOCOL_PACKET_SIZE['lldp']:
+ error_flage = error_flage and (tx_bytes - exp_bytes) % size
+
+ return not error_flage
def get_port_vlan_offload(self, port_id):
"""
diff --git a/framework/settings.py b/framework/settings.py
index 342314d..f0f3c8f 100644
--- a/framework/settings.py
+++ b/framework/settings.py
@@ -173,7 +173,7 @@ HEADER_SIZE = {
dpdk send protocol packet size.
"""
PROTOCOL_PACKET_SIZE = {
- 'lldp': 110,
+ 'lldp': [110, 100],
}
"""
--
1.9.3
^ permalink raw reply [flat|nested] 5+ messages in thread
* [dts] PATCH V4 2/2] add link bond slave dynamic config test case
2017-05-23 6:31 [dts] [PATCH V4 1/2] add link bonding rss dynamic config test plane xu,huilong
2017-05-23 6:31 ` [dts] PATCH V4] fix check packet failure by lldp have different packet size xu,huilong
@ 2017-05-23 6:31 ` xu,huilong
2017-05-25 10:46 ` Liu, Yong
1 sibling, 1 reply; 5+ messages in thread
From: xu,huilong @ 2017-05-23 6:31 UTC (permalink / raw)
To: dts; +Cc: xu,huilong
update list:
1 add link bond slave dynamic config test case
2 use two port for this suite
Signed-off-by: xu,huilong <huilongx.xu@intel.com>
---
| 42 +++++++++++++++++++++++++++++++++++++++---
1 file changed, 39 insertions(+), 3 deletions(-)
--git a/tests/TestSuite_pmdrss_hash.py b/tests/TestSuite_pmdrss_hash.py
index 78ae34d..83bac40 100644
--- a/tests/TestSuite_pmdrss_hash.py
+++ b/tests/TestSuite_pmdrss_hash.py
@@ -417,10 +417,11 @@ class TestPmdrssHash(TestCase):
"""
self.verify(self.nic in ["fortville_eagle", "fortville_spirit",
- "fortville_spirit_single", "redrockcanyou", "atwood", "boulderrapid", "fortpark_TLV"],
+ "fortville_spirit_single", "redrockcanyou", "atwood",
+ "boulderrapid", "fortpark_TLV", "fortville_25g"],
"NIC Unsupported: " + str(self.nic))
global reta_num
- if self.nic in ["fortville_eagle", "fortville_spirit", "fortville_spirit_single", "fortpark_TLV"]:
+ 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
@@ -429,7 +430,7 @@ class TestPmdrssHash(TestCase):
else:
self.verify(False, "NIC Unsupported:%s" % str(self.nic))
ports = self.dut.get_ports(self.nic)
- self.verify(len(ports) >= 1, "Not enough ports available")
+ self.verify(len(ports) >= 2, "Not enough ports available")
def set_up(self):
"""
@@ -651,6 +652,41 @@ class TestPmdrssHash(TestCase):
self.dut.send_expect("quit", "# ", 30)
+ def test_dynamic_rss_bond_config(self):
+
+ # setup testpmd and finish bond config
+ self.dut.send_expect("./%s/app/testpmd -c f -n 4 -- -i --txqflags=0" % 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())
+
+ self.dut.send_expect("add bonding slave 0 %d" % bond_device_id, "testpmd>", 30)
+ self.dut.send_expect("add bonding slave 1 %d" % bond_device_id, "testpmd>", 30)
+
+ # get slave device default rss hash algorithm
+ out = self.dut.send_expect("get_hash_global_config 0", "testpmd>")
+ slave0_hash_function = re.search("Hash function is .+", out).group().split(" ")[-1].strip()
+ out = self.dut.send_expect("get_hash_global_config 1", "testpmd>")
+ slave1_hash_function = re.search("Hash function is .+", out).group().split(" ")[-1].strip()
+ self.verify(slave0_hash_function == slave1_hash_function, "default hash function not match")
+
+ new_hash_function = ""
+ for hash_function in ["toeplitz", "simple_xor"]:
+ if slave0_hash_function[-3:].lower() != hash_function[-3:]:
+ new_hash_function = hash_function
+ # update slave 0 rss hash algorithm and get slave 0 and slave 1 rss new hash algorithm
+ self.dut.send_expect("set_hash_global_config 0 %s ipv4-other enable" % new_hash_function, "testpmd>")
+ out = self.dut.send_expect("get_hash_global_config 0", "testpmd>")
+ slave0_new_hash_function = re.search("Hash function is .+", out).group().split(" ")[-1].strip()
+ out = self.dut.send_expect("get_hash_global_config 1", "testpmd>")
+ slave1_new_hash_function = re.search("Hash function is .+", out).group().split(" ")[-1].strip()
+
+ self.verify(slave0_new_hash_function == slave1_new_hash_function, "bond slave auto sync hash function failed")
+ self.verify(slave0_new_hash_function[-3:].lower() == new_hash_function[-3:], "changed slave hash function failed")
+
+ self.dut.send_expect("remove bonding slave 0 %d" % bond_device_id, "testpmd>", 30)
+ self.dut.send_expect("remove bonding slave 1 %d" % bond_device_id, "testpmd>", 30)
+ self.dut.send_expect("quit","# ", 30)
+
def tear_down(self):
"""
Run after each test case.
--
1.9.3
^ permalink raw reply [flat|nested] 5+ messages in thread