From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id A3B743DC for ; Thu, 9 Mar 2017 07:58:02 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Mar 2017 22:58:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,267,1486454400"; d="scan'208";a="1106508169" Received: from unknown (HELO dpdk-fedora20.icx.intel.com) ([10.240.176.135]) by orsmga001.jf.intel.com with ESMTP; 08 Mar 2017 22:58:00 -0800 From: "xu,huilong" To: dts@dpdk.org Cc: "xu,huilong" Date: Thu, 9 Mar 2017 14:59:24 +0800 Message-Id: <1489042764-8999-2-git-send-email-huilongx.xu@intel.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1489042764-8999-1-git-send-email-huilongx.xu@intel.com> References: <1489042764-8999-1-git-send-email-huilongx.xu@intel.com> Subject: [dts] [PATCH V2 2/2] add dynamic config bonding rss hash test case X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Mar 2017 06:58:03 -0000 Signed-off-by: xu,huilong --- tests/TestSuite_pmdrss_hash.py | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/tests/TestSuite_pmdrss_hash.py b/tests/TestSuite_pmdrss_hash.py index 78ae34d..5ab8b6b 100644 --- a/tests/TestSuite_pmdrss_hash.py +++ b/tests/TestSuite_pmdrss_hash.py @@ -429,7 +429,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): """ @@ -650,6 +650,39 @@ class TestPmdrssHash(TestCase): self.send_packet_symmetric(itf, iptype) self.dut.send_expect("quit", "# ", 30) + def test_dynamic_rss_bond_config(self): + 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.verify(bond_device_id > 1, "not enought port for bonded test") + + 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) + + 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 + + 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("quit","# ", 30) + def tear_down(self): """ -- 1.9.3