* [dts] [PATCH V3 1/2] add link bonding rss dynamic config test plane @ 2017-05-15 3:57 xu,huilong 2017-05-15 3:57 ` [dts] [PATCH V3] fix user space ethtool failed case xu,huilong 2017-05-15 3:57 ` [dts] [PATCH V3 2/2] add link bond slave dynamic config test case xu,huilong 0 siblings, 2 replies; 4+ messages in thread From: xu,huilong @ 2017-05-15 3:57 UTC (permalink / raw) To: dts; +Cc: xu,huilong add a new case in pmd rss hash test plane. in new dpdk, bond device support rss hash config. Signed-off-by: xu,huilong <huilongx.xu@intel.com> --- test_plans/pmdrss_hash_test_plan.rst | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/test_plans/pmdrss_hash_test_plan.rst b/test_plans/pmdrss_hash_test_plan.rst index 4922d3b..eda7103 100644 --- a/test_plans/pmdrss_hash_test_plan.rst +++ b/test_plans/pmdrss_hash_test_plan.rst @@ -149,4 +149,23 @@ Test Case: test_simple_symmetric The same as the above two test cases. Just pay attention to set the hash function to "simple xor" +Test Case: test_dynamic_rss_bond_config +================================= +This case test bond slaves will auto sync rss hash config, so it only support fortville nic. +#1. set up testpmd woth fortville NICs:: +./testpmd -c f -n 4 -- -i --portmask 0x3 --txqflags=0 +#2 creat bond device with mode 3:: + create bonded device 3 0 +#3 add slave to bond device:: + add bonding slave 0 2 + add bonding slave 1 2 +#4 get default hash algorithm on slave:: + get_hash_global_config 0 + get_hash_global_config 1 +#5 set hash algorithm on slave 0:: + set_hash_global_config 0 simple_xor ipv4-other enable +#6 get hash algorithm on slave 0 and 1:: + get_hash_global_config 0 + get_hash_global_config 1 +#7 check slave 0 and 1 use same hash algorithm -- 1.9.3 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [dts] [PATCH V3] fix user space ethtool failed case 2017-05-15 3:57 [dts] [PATCH V3 1/2] add link bonding rss dynamic config test plane xu,huilong @ 2017-05-15 3:57 ` xu,huilong 2017-05-15 3:57 ` [dts] [PATCH V3 2/2] add link bond slave dynamic config test case xu,huilong 1 sibling, 0 replies; 4+ messages in thread From: xu,huilong @ 2017-05-15 3:57 UTC (permalink / raw) To: dts; +Cc: xu,huilong update list: 1. update user space ethtool compile error, becauese the example path update in dpdk already 2. kernel space ethtool dump nic eeprom file size differnet dpdk user space ethtool, so should cat out dpdk ethtool dump nic eeprom file and the file size same with kernel ethtool. then use file md5 check the file is same Signed-off-by: xu,huilong <huilongx.xu@intel.com> --- tests/TestSuite_userspace_ethtool.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/TestSuite_userspace_ethtool.py b/tests/TestSuite_userspace_ethtool.py index 937a9e5..40d9c9e 100644 --- a/tests/TestSuite_userspace_ethtool.py +++ b/tests/TestSuite_userspace_ethtool.py @@ -61,7 +61,7 @@ class TestUserspaceEthtool(TestCase, IxiaPacketGenerator): self.verify("Error" not in out, "compilation error 1") self.verify("No such file" not in out, "compilation error 2") - path = "./examples/ethtool/ethtool-app/ethtool-app/%s/ethtool" % self.target + path = "./examples/ethtool/ethtool-app/%s/ethtool" % self.target self.cmd = "%s -c f -n %d" % (path, self.dut.get_memory_channels()) # pause frame basic configuration @@ -370,7 +370,9 @@ class TestUserspaceEthtool(TestCase, IxiaPacketGenerator): self.dut.send_expect("ethtool --eeprom-dump %s raw on > %s" % (intf, ethtool_eeprom), "# ") # wait for file ready time.sleep(2) - portinfo['ethtool_eeprom'] = ethtool_eeprom + dpdk_eeprom_size = int(self.dut.send_expect('stat -c %%s %s' % portinfo['eeprom_file'], '# ')) + self.dut.send_expect('dd if=%s of=%s bs=%d count=1' % (ethtool_eeprom, "ethtool_eeprom_%d_cat.bin" % index, dpdk_eeprom_size), "#") + portinfo['ethtool_eeprom'] = "ethtool_eeprom_%d_cat.bin" % index # bind to original driver portinfo['net_dev'].bind_driver(portinfo['ori_driver']) @@ -499,8 +501,10 @@ class TestUserspaceEthtool(TestCase, IxiaPacketGenerator): for index in range(len(self.ports)): port = self.ports[index] ori_rx_pkts, _ = self.strip_portstats(index) + time.sleep(10) # stop port self.dut.send_expect("stop %d" % index, "EthApp>") + time.sleep(10) # check packet not forwarded when port is stop pkt = Packet() tester_port = self.tester.get_local_port(port) -- 1.9.3 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [dts] [PATCH V3 2/2] add link bond slave dynamic config test case 2017-05-15 3:57 [dts] [PATCH V3 1/2] add link bonding rss dynamic config test plane xu,huilong 2017-05-15 3:57 ` [dts] [PATCH V3] fix user space ethtool failed case xu,huilong @ 2017-05-15 3:57 ` xu,huilong 2017-05-15 5:11 ` Liu, Yong 1 sibling, 1 reply; 4+ messages in thread From: xu,huilong @ 2017-05-15 3:57 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 different V2 patch: update code style and add some comments in test case Signed-off-by: xu,huilong <huilongx.xu@intel.com> --- tests/TestSuite_pmdrss_hash.py | 41 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/tests/TestSuite_pmdrss_hash.py b/tests/TestSuite_pmdrss_hash.py index 78ae34d..dcff1c0 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,40 @@ 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] 4+ messages in thread
* Re: [dts] [PATCH V3 2/2] add link bond slave dynamic config test case 2017-05-15 3:57 ` [dts] [PATCH V3 2/2] add link bond slave dynamic config test case xu,huilong @ 2017-05-15 5:11 ` Liu, Yong 0 siblings, 0 replies; 4+ messages in thread From: Liu, Yong @ 2017-05-15 5:11 UTC (permalink / raw) To: xu,huilong, dts Huilong, Please check with pep8 rule. On 05/15/2017 11:57 AM, xu,huilong wrote: > update list: > 1 add link bond slave dynamic config test case > 2 use two port for this suite > > different V2 patch: > update code style and add some comments in test case > > Signed-off-by: xu,huilong <huilongx.xu@intel.com> > --- > tests/TestSuite_pmdrss_hash.py | 41 ++++++++++++++++++++++++++++++++++++++--- > 1 file changed, 38 insertions(+), 3 deletions(-) > > diff --git a/tests/TestSuite_pmdrss_hash.py b/tests/TestSuite_pmdrss_hash.py > index 78ae34d..dcff1c0 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"]: Please add space between two elements. > 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,40 @@ 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) Please add space line between functions. > def tear_down(self): > """ > Run after each test case. ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-05-15 5:23 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2017-05-15 3:57 [dts] [PATCH V3 1/2] add link bonding rss dynamic config test plane xu,huilong 2017-05-15 3:57 ` [dts] [PATCH V3] fix user space ethtool failed case xu,huilong 2017-05-15 3:57 ` [dts] [PATCH V3 2/2] add link bond slave dynamic config test case xu,huilong 2017-05-15 5:11 ` Liu, Yong
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).