From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9929DA0350; Sun, 28 Jun 2020 08:36:32 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 82DC61C10A; Sun, 28 Jun 2020 08:36:32 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id D26331C036 for ; Sun, 28 Jun 2020 08:36:30 +0200 (CEST) IronPort-SDR: AWxxaBlH/7hFyzaylqoQH30qKwHgR2BeFQBiFmuxU8xJAXoQ4UnGtoH5SZPVwYzgJwpYd58blz YToIfqCp8sPg== X-IronPort-AV: E=McAfee;i="6000,8403,9665"; a="143263943" X-IronPort-AV: E=Sophos;i="5.75,290,1589266800"; d="scan'208";a="143263943" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jun 2020 23:36:29 -0700 IronPort-SDR: iQen81dOVXet3VGmIX1msc9gJSEfV1WSEZALUq0w8t12RyYDHspgRjGYzOolH6Vj0z5Us329ow 1Dfcj/s9aqfQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,290,1589266800"; d="scan'208";a="480436745" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga005.fm.intel.com with ESMTP; 27 Jun 2020 23:36:29 -0700 Received: from fmsmsx126.amr.corp.intel.com (10.18.125.43) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sat, 27 Jun 2020 23:36:29 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by FMSMSX126.amr.corp.intel.com (10.18.125.43) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sat, 27 Jun 2020 23:36:29 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.85]) by shsmsx102.ccr.corp.intel.com ([169.254.2.36]) with mapi id 14.03.0439.000; Sun, 28 Jun 2020 14:36:26 +0800 From: "Tu, Lijuan" To: "Peng, Yuan" , "dts@dpdk.org" CC: "Peng, Yuan" Thread-Topic: [dts] [PATCH v2] add a max number case to iavf_fdir Thread-Index: AQHWSEI8mduDJpecmUG2AuF+6K1xxqjtnFOQ Date: Sun, 28 Jun 2020 06:36:25 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BC65917@SHSMSX101.ccr.corp.intel.com> References: <1592820844-18157-1-git-send-email-yuan.peng@intel.com> In-Reply-To: <1592820844-18157-1-git-send-email-yuan.peng@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dts] [PATCH v2] add a max number case to iavf_fdir 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: , Errors-To: dts-bounces@dpdk.org Sender: "dts" Applied failed, Applying: add a max number case to iavf_fdir error: patch failed: test_plans/iavf_fdir_test_plan.rst:2689 error: test_plans/iavf_fdir_test_plan.rst: patch does not apply error: patch failed: tests/TestSuite_iavf_fdir.py:1381 error: tests/TestSuite_iavf_fdir.py: patch does not apply Patch failed at 0001 add a max number case to iavf_fdir -----Original Message----- From: dts On Behalf Of Peng Yuan Sent: 2020=1B$BG/=1B(B6=1B$B7n=1B(B22=1B$BF|=1B(B 18:14 To: dts@dpdk.org Cc: Peng, Yuan Subject: [dts] [PATCH v2] add a max number case to iavf_fdir From: pengyuan Add a max number case to iavf_fdir_test_plan.rst Add a max number case to T= estSuite_iavf_fdir.py Signed-off-by: pengyuan diff --git a/test_plans/iavf_fdir_test_plan.rst b/test_plans/iavf_fdir_test= _plan.rst index a201b9d..9cf5efe 100644 --- a/test_plans/iavf_fdir_test_plan.rst +++ b/test_plans/iavf_fdir_test_plan.rst @@ -2689,7 +2689,7 @@ Test case: Max number =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D All the max number cases are designed ba= sed on 2*100G NIC. If the hardware is 4*25G NIC, the guaranteed rule number of PF is 512. -So in subcase 3, there can be created at most 14848 rules on 1pf and 2vfs. +So in subcase 3 and subcase 4, there can be created at most 14848 rules on= 1pf and 2vfs. =20 Subcase 1: 14336 rules on 1 vf ------------------------------ @@ -2764,11 +2764,13 @@ Subcase 2: 14336 rules on 2 vfs of 2pfs =20 5. verify matched packet received without FDIR matched ID. =20 -Subcase 3: 15360 rules on 1pf and 2vfs --------------------------------------- +Subcase 3: 1025 rules on 1pf and 14335 rules on 2vfs +---------------------------------------------------- each pf can create 1024 rules at least in 2 ports card. +each pf can create 512 rules at least in 4 ports card. there are 14k rules shared by pfs and vfs. -so 1 pf and 2 vfs can create 15360 rules at most. +so 1 pf and 2 vfs can create 15360 rules at most on 2 ports card. +1 pf and 2 vfs can create 14848 rules at most on 4 ports card. =20 1. create 1025 rules on pf0:: =20 @@ -2830,7 +2832,79 @@ so 1 pf and 2 vfs can create 15360 rules at most. =20 8. verify matched packet received without FDIR matched ID. =20 -Subcase 4: 128 profiles +Subcase 4: 15360 rules on 1pf and 0 rules on 2vfs +------------------------------------------------- +each pf can create 1024 rules at least in 2 ports card. +each pf can create 512 rules at least in 4 ports card. +there are 14k rules shared by pfs and vfs. +so 1 pf and 2 vfs can create 15360 rules at most on 2 ports card. +1 pf and 2 vfs can create 14848 rules at most on 4 ports card. +so if create 15360/14848 rules on 1 pf, there can't create rule on vf succ= essfully. + +1. create 15360 rules on pf0:: + + ethtool -N enp134s0f0 flow-type tcp4 src-ip 192.168.0.0 dst-ip 192.168= .100.2 src-port 32 dst-port 33 action 8 + ethtool -N enp134s0f0 flow-type tcp4 src-ip 192.168.0.1 dst-ip 192.168= .100.2 src-port 32 dst-port 33 action 8 + ...... + ethtool -N enp134s0f0 flow-type tcp4 src-ip 192.168.57.255 dst-ip=20 + 192.168.100.2 src-port 32 dst-port 33 action 8 + + all the rules can be created successfully:: + + Added rule with ID + +2. failed to create one more rule on pf0:: + + ethtool -N enp134s0f0 flow-type tcp4 src-ip 192.168.58.0 dst-ip=20 + 192.168.100.2 src-port 32 dst-port 33 action 8 + +3. start testpmd on vf00 and vf10:: + + ./testpmd -c 0xf -n 6 -w 86:01.0 -w 86:11.0 --file-prefix=3Dvf00 --=20 + -i --rxq=3D4 --txq=3D4 + + create 1 rule on vf00:: + + flow create 0 ingress pattern eth / ipv4 src is 192.168.0.20 dst is=20 + 192.168.0.0 / end actions queue index 1 / mark / end + + failed to create the rule, check there is no rule listed. + + create 1 rule on vf10:: + + flow create 1 ingress pattern eth / ipv4 src is 192.168.0.20 dst is=20 + 192.168.0.0 / end actions queue index 1 / mark / end + + failed to create the rule, check there is no rule listed. + +4. delete 1 rule on pf0:: + + ethtool -N enp134s0f0 delete + +5. create 1 rule on vf00:: + + flow create 0 ingress pattern eth / ipv4 src is 192.168.0.20 dst is=20 + 192.168.55.254 / end actions queue index 1 / mark / end + + the rule can be created successfully. + + create 1 rule on vf10:: + + flow create 1 ingress pattern eth / ipv4 src is 192.168.0.20 dst is=20 + 192.168.0.0 / end actions queue index 1 / mark / end + + failed to create the rule, check there is no rule listed. + +6. send matched packet to vf00, it can be redirected to queue 1 with FDIR = matched ID=3D0x0. + send matched packet to vf10, it is received without FDIR matched ID. + +7. delete 1 more rule on pf0:: + + ethtool -N enp134s0f0 delete + +8. create 1 rule on vf10:: + + flow create 1 ingress pattern eth / ipv4 src is 192.168.0.20 dst is=20 + 192.168.0.0 / end actions queue index 1 / mark / end + + the rule can be created successfully. + +9. send matched packet to vf00, it can be redirected to queue 1 with FDIR = matched ID=3D0x0. + send matched packet to vf10, it can be redirected to queue 1 with FDIR = matched ID=3D0x0. + +Subcase 5: 128 profiles ----------------------- =20 1. create 16 vfs on pf0:: diff --git a/tests/TestSuite_iavf_fdir.py b/tests/TestSuite_iavf_fdir.py in= dex 2ea411c..f1adc0f 100644 --- a/tests/TestSuite_iavf_fdir.py +++ b/tests/TestSuite_iavf_fdir.py @@ -1381,7 +1381,7 @@ class TestIAVFFdir(TestCase): """ remove and reload the ice driver """ - self.dut.send_expect("rmmod ice", "# ", 20) + self.dut.send_expect("rmmod ice", "# ", 40) ice_driver_file_location =3D self.suite_config["ice_driver_file_lo= cation"] self.dut.send_expect("insmod %s" % ice_driver_file_location, "# ") self.dut.send_expect("ifconfig %s up" % self.tester_iface0, "# ", = 15) @@ -2320,6 +2320,13 @@ class TestIAVFFdir(TestCase): out_14336 =3D self.send_pkts_getouput(pkts=3Dpkt_14336, pf_id=3D0) rfc.check_iavf_fdir_mark(out_14336, pkt_num=3D1, check_param=3D{"p= ort_id": 0, "queue": 5}, stats=3DFalse) =20 + # delete one rule of vf0 + self.dut.send_expect("flow destroy 0 rule 0", "testpmd> ", timeout= =3D200) + self.create_fdir_rule(rule_0_vf1, check_stats=3DTrue) + pkt_0_vf1 =3D 'Ether(dst=3D"00:11:22:33:44:66")/IP(src=3D"192.168.= 0.20",dst=3D"192.168.56.0")/Raw("x" * 80)' + out_0_vf1 =3D self.send_pkts_getouput(pkts=3Dpkt_0_vf1, pf_id=3D0) + rfc.check_iavf_fdir_mark(out_0_vf1, pkt_num=3D1,=20 + check_param=3D{"port_id": 1, "mark_id": 0, "queue": 5}, stats=3DTrue) + # flush all the rules self.dut.send_expect("flow flush 0", "testpmd> ", timeout=3D200) self.check_fdir_rule(port_id=3D0, stats=3DFalse) @@ -2329,11 +2336= ,9 @@ class TestIAVFFdir(TestCase): rfc.check_iavf_fdir_mark(out_14335, pkt_num=3D1, check_param=3D{"p= ort_id": 0, "mark_id": 0, "queue": 5}, stats=3DFalse) =20 self.create_fdir_rule(rule_14336_vf0, check_stats=3DTrue) - self.create_fdir_rule(rule_0_vf1, check_stats=3DTrue) out_14336 =3D self.send_pkts_getouput(pkts=3Dpkt_14336, pf_id=3D0) rfc.check_iavf_fdir_mark(out_14336, pkt_num=3D1, check_param=3D{"p= ort_id": 0, "mark_id": 0, "queue": 5}, stats=3DTrue) =20 - def test_maxnum_14336rules_2vf(self): """ vfs share 14336 rules table @@ -2424,40 +2429,38 @@ class TestIAVFFdir(TestCase): self.dut.kill_all() self.session_secondary =3D self.dut.new_session() =20 - #create 1025 rules on pf0 - src_file =3D 'iavf_fdir_15360_kernel_rules' + #create 1025 rules on pf1 + src_file =3D 'create_1025_kernel_rules' flows=3Dopen(self.src_file_dir + src_file,mode=3D'w') count=3D0 if self.nic in ["columbiaville_100g"]: for i in range(4): for j in range(256): - flows.write('ethtool -N enp134s0f1 flow-type tcp4 src-= ip 192.168.%d.%d dst-ip 192.168.100.2 src-port 32 dst-port 33 action 8 \n'%= (i,j)) + flows.write('ethtool -N %s flow-type tcp4 src-ip=20 + 192.168.%d.%d dst-ip 192.168.100.2 src-port 32 dst-port 33 action 8=20 + \n' % (self.pf1_intf,i,j)) count=3Dcount+1 - flows.write('ethtool -N enp134s0f1 flow-type tcp4 src-ip 192.1= 68.100.0 dst-ip 192.168.100.2 src-port 32 dst-port 33 action 8 \n') + flows.write('ethtool -N %s flow-type tcp4 src-ip=20 + 192.168.100.0 dst-ip 192.168.100.2 src-port 32 dst-port 33 action 8=20 + \n' % self.pf1_intf) count=3Dcount+1 flows.close() self.verify(count =3D=3D 1025, "failed to create 1025 fdir rul= es on pf.") elif self.nic in ["columbiaville_25g"]: for i in range(2): for j in range(256): - flows.write('ethtool -N enp134s0f1 flow-type tcp4 src-= ip 192.168.%d.%d dst-ip 192.168.100.2 src-port 32 dst-port 33 action 8 \n'%= (i,j)) + flows.write('ethtool -N %s flow-type tcp4 src-ip=20 + 192.168.%d.%d dst-ip 192.168.100.2 src-port 32 dst-port 33 action 8=20 + \n' % (self.pf1_intf,i,j)) count=3Dcount+1 - flows.write('ethtool -N enp134s0f1 flow-type tcp4 src-ip 192.1= 68.100.0 dst-ip 192.168.100.2 src-port 32 dst-port 33 action 8 \n') + flows.write('ethtool -N %s flow-type tcp4 src-ip=20 + 192.168.100.0 dst-ip 192.168.100.2 src-port 32 dst-port 33 action 8=20 + \n' % self.pf1_intf) count=3Dcount+1 flows.close() self.verify(count =3D=3D 513, "failed to create 1025 fdir rule= s on pf.") self.dut.session.copy_file_to(self.src_file_dir + src_file, self.d= ut_file_dir) - # create 1025 rules on pf0 - fkr =3D open(self.dut_file_dir + "iavf_fdir_15360_kernel_rules", "= r+") + # create 1025 rules on pf1 + fkr =3D open(self.dut_file_dir + src_file, "r+") kernel_rules =3D fkr.read() fkr.close() - self.dut.send_expect(kernel_rules, "# ", 300) - # write the kernel rules result to file - fkw =3D open("1025_kernel_rules_result.txt", "w") - fkw.write(self.dut.send_expect("ethtool -n %s" % self.pf1_intf, "#= ", 300)) + self.dut.send_expect(kernel_rules, "# ") + time.sleep(15) =20 #create 1 rule on vf00, and 14334 rules on vf01 - src_file_vf =3D 'iavf_fdir_15360_vf_rules' + src_file_vf =3D 'create_14335_rules_on_2vfs' flows =3D open(self.src_file_dir + src_file_vf, mode=3D'w') flows.write('flow create 0 ingress pattern eth / ipv4 src is 192.1= 68.0.20 dst is 192.168.0.0 / end actions queue index 5 / mark / end \n') count=3D1 @@ -2494,7 +2497,6 @@ class TestIAVFFdir(TestCase): =20 # delete a rule on pf0 self.session_secondary.send_expect("ethtool -N %s delete 14847" % = self.pf1_intf, "# ") - time.sleep(3) =20 # then can create one more rule on vf01 self.create_fdir_rule(rule_14334_vf1, check_stats=3DTrue) @@ -2511= ,6 +2513,88 @@ class TestIAVFFdir(TestCase): self.dut.send_expect("quit", "# ") self.dut.close_session(self.session_secondary) self.re_load_ice_driver() + self.setup_2pf_4vf_env() + + def test_maxnum_15360rules_1pf_0_rules_vf(self): + """ + 2*100G NIC, each pf can create 1024 rules at least, vfs share 1433= 6 rules table + 4*25G NIC, each pf can create 512 rules at least, vfs share 14336 = rules table + so if 2*25G NIC, max number is 14848 on 1pf and vfs. + create 15360/14848 rules on pf1, check failed to create rule on vf= 00 and vf10 + """ + self.dut.kill_all() + self.session_secondary =3D self.dut.new_session() + + #create 15360 rules on pf1 + src_file =3D 'create_15360_kernel_rules' + flows=3Dopen(self.src_file_dir + src_file,mode=3D'w') + count=3D0 + if self.nic in ["columbiaville_100g"]: + for i in range(60): + for j in range(256): + flows.write('ethtool -N %s flow-type tcp4 src-ip 192.1= 68.%d.%d dst-ip 192.168.100.2 src-port 32 dst-port 33 action 8 \n' % (self.= pf1_intf,i,j)) + count=3Dcount+1 + flows.close() + self.verify(count =3D=3D 15360, "failed to create 15360 fdir r= ules on pf.") + elif self.nic in ["columbiaville_25g"]: + for i in range(58): + for j in range(256): + flows.write('ethtool -N %s flow-type tcp4 src-ip 192.1= 68.%d.%d dst-ip 192.168.100.2 src-port 32 dst-port 33 action 8 \n' % (self.= pf1_intf,i,j)) + count=3Dcount+1 + flows.close() + self.verify(count =3D=3D 14848, "failed to create 14848 fdir r= ules on pf.") + self.dut.session.copy_file_to(self.src_file_dir + src_file, self.d= ut_file_dir) + # create 15360 rules on pf1 + fkr =3D open(self.dut_file_dir + src_file, "r+") + kernel_rules =3D fkr.read() + fkr.close() + self.dut.send_expect(kernel_rules, "# ") + time.sleep(200) + # failed to create 1 more rule on pf1 + self.dut.send_expect("ethtool -N %s flow-type tcp4 src-ip 192.168.= 100.0 dst-ip 192.168.100.2 src-port 32 dst-port 33 action 8" % self.pf1_int= f, "Cannot insert RX class rule: No space left on device") + # start testpmd with creating rules in commandline + eal_param =3D "-c f -n 6 -w %s -w %s" % (self.sriov_vfs_pf0[0].pci= ,self.sriov_vfs_pf1[0].pci) + command =3D "./%s/app/testpmd %s -- -i %s" % (self.dut.target, eal= _param, "--rxq=3D16 --txq=3D16") + self.dut.send_expect(command, "testpmd> ", 20) + + self.config_testpmd() + rule_0_vf00 =3D "flow create 0 ingress pattern eth / ipv4 src is 1= 92.168.0.20 dst is 192.168.56.0 / end actions queue index 5 / mark / end" + pkt_0_vf00 =3D 'Ether(dst=3D"00:11:22:33:44:55")/IP(src=3D"192.168= .0.20",dst=3D"192.168.56.0")/Raw("x" * 80)' + rule_0_vf10 =3D "flow create 1 ingress pattern eth / ipv4 src is 1= 92.168.0.20 dst is 192.168.56.0 / end actions queue index 5 / mark / end" + pkt_0_vf10 =3D 'Ether(dst=3D"00:11:22:33:44:77")/IP(src=3D"192.168= .0.20",dst=3D"192.168.56.0")/Raw("x" * 80)' + + #failed to create rule on vf00 and vf10 + self.create_fdir_rule(rule_0_vf00, check_stats=3DFalse) + self.create_fdir_rule(rule_0_vf10, check_stats=3DFalse) + self.check_rule_number(port_id=3D0, num=3D0) + self.check_rule_number(port_id=3D1, num=3D0) + + # delete a rule on pf1 + self.session_secondary.send_expect("ethtool -N %s delete 14847"=20 + % self.pf1_intf, "# ") + + # then can create one rule on vf00 + self.create_fdir_rule(rule_0_vf00, check_stats=3DTrue) + self.create_fdir_rule(rule_0_vf10, check_stats=3DFalse) + self.check_rule_number(port_id=3D0, num=3D1) + self.check_rule_number(port_id=3D1, num=3D0) + + # delete a rule on pf1 + self.session_secondary.send_expect("ethtool -N %s delete 14846"=20 + % self.pf1_intf, "# ") + + # then can create one rule on vf10 + self.create_fdir_rule(rule_0_vf10, check_stats=3DTrue) + self.check_rule_number(port_id=3D1, num=3D1) + + out_0_vf00 =3D self.send_pkts_getouput(pkts=3Dpkt_0_vf00, pf_id=3D= 0) + rfc.check_iavf_fdir_mark(out_0_vf00, pkt_num=3D1,=20 + check_param=3D{"port_id": 0, "mark_id": 0, "queue": 5}, stats=3DTrue) + + out_0_vf10 =3D self.send_pkts_getouput(pkts=3Dpkt_0_vf10, pf_id=3D= 1) + rfc.check_iavf_fdir_mark(out_0_vf10, pkt_num=3D1,=20 + check_param=3D{"port_id": 1, "mark_id": 0, "queue": 5}, stats=3DTrue) + + self.dut.send_expect("quit", "# ") + self.dut.close_session(self.session_secondary) + self.re_load_ice_driver() + self.setup_2pf_4vf_env() =20 def test_maxnum_128_profiles(self): """ @@ -3270,7 +3354,11 @@ class TestIAVFFdir(TestCase): def tear_down(self): # destroy all flow rule on port 0 self.dut.kill_all() + if getattr(self, 'session_secondary', None): + self.dut.close_session(self.session_secondary) + if getattr(self, 'session_third', None): + self.dut.close_session(self.session_third) =20 def tear_down_all(self): - self.destroy_env() self.dut.kill_all() + self.destroy_env() -- 2.14.3