From patchwork Tue Feb 21 14:50:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Li, HongboX" X-Patchwork-Id: 124263 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 710A741CF8; Tue, 21 Feb 2023 07:33:09 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 678584315A; Tue, 21 Feb 2023 07:33:09 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id E63E140E5A for ; Tue, 21 Feb 2023 07:33:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676961188; x=1708497188; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=VCH6o5ZZ4+YpGRo3CH4yAuTbi1XHH2/3cef/uVrY6SQ=; b=FNSrZAVh54yvJTIsTk4eWMid3aNvyTe9l9+pBdqBevVGUm9ZAN0fpynp 7MDieAeirSXpIWqtueP1r5pgIUyiEQCXcFwIF0cjapRb8zt+iTDJlLQ96 qNkbc8OO70Q5BJQXh/vmYeD2hOhUCIZ3M7b4HlX1GCKnD6nCooRzOUl3w XPdGcUh3ZMKOitpGi75iq2/i3mgB0xhH6aSW8aVA5A37qZh4uK39qLH5L gq1jzZRWyXjurP8yowKEM8AcyEoL9dOL4HO3m3GtTdvmDjlqDqDnNjXOP PwIBIJp5lycl227dsf/owj+XahaW/5kmXAcVSztN9/F7lmjhcKwS1FUyJ g==; X-IronPort-AV: E=McAfee;i="6500,9779,10627"; a="330275965" X-IronPort-AV: E=Sophos;i="5.97,314,1669104000"; d="scan'208";a="330275965" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Feb 2023 22:33:07 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10627"; a="1000483904" X-IronPort-AV: E=Sophos;i="5.97,314,1669104000"; d="scan'208";a="1000483904" Received: from unknown (HELO localhost.localdomain) ([10.239.252.93]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Feb 2023 22:33:05 -0800 From: Hongbo Li To: dts@dpdk.org Cc: Hongbo Li Subject: [dts][PATCH V1 1/2] test_plans/ice_dcf_switch_filter: optimize max vfs script Date: Tue, 21 Feb 2023 22:50:58 +0800 Message-Id: <20230221145059.10655-1-hongbox.li@intel.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 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 Change the method of obtaining the maximum number of VF that can be created on one PF Signed-off-by: Hongbo Li --- .../ice_dcf_switch_filter_test_plan.rst | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/test_plans/ice_dcf_switch_filter_test_plan.rst b/test_plans/ice_dcf_switch_filter_test_plan.rst index 63ef56e0..488683b0 100644 --- a/test_plans/ice_dcf_switch_filter_test_plan.rst +++ b/test_plans/ice_dcf_switch_filter_test_plan.rst @@ -2791,40 +2791,42 @@ are dropped. Test case: Max vfs ================== -Description: 256 VFs can be created on a IntelĀ® Ethernet 800 Series NIC, if 2*100G NIC, each PF -can create 128 VFs, else if 4*25G NIC, each PF can create 64 VFs. This -case is used to test when all VFs on a PF are used, switch filter rules can work. +Description: This case is used to test when all VFs on a PF are used, switch filter rules can work. This case is designed based on 4*25G NIC. -1. generate 64 VFs on PF:: +1.Query the maximum number of VF that can be created by each PF:: + + cat /sys/bus/pci/devices/0000\:18\:00.0/sriov_totalvfs + +2. generate 64 VFs on PF:: echo 64 > /sys/bus/pci/devices/0000:18:00.0/sriov_numvfs -2. Get the interface name of the VFs, for example:: +3. Get the interface name of the VFs, for example:: ./usertools/dpdk-devbind.py -s 0000:18:01.1 'Ethernet Adaptive Virtual Function 1889' if=enp24s1f1 drv=iavf unused=igb_uio -3. Start the 64 VFs in the kernel, for example:: +4. Start the 64 VFs in the kernel, for example:: ifconfig enp24s1f1 up -4. Set VF0 as trust:: +5. Set VF0 as trust:: ip link set enp24s0f0 vf 0 trust on -5. bind VF0 to dpdk driver:: +6. bind VF0 to dpdk driver:: ./usertools/dpdk-devbind.py -b vfio-pci 0000:18:01.0 -6. launch dpdk on VF0, and request DCF mode, representing VF1 to VF63:: +7. launch dpdk on VF0, and request DCF mode, representing VF1 to VF63:: ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 0xf -n 4 \ -a 0000:18:01.0,cap=dcf,representor=[1-63] \ -- -i -7. set a switch rule to each VF from DCF, totally 63 rules:: +8. set a switch rule to each VF from DCF, totally 63 rules:: testpmd> flow create 0 ingress pattern eth / ipv4 src is 192.168.0.1 / tcp / end actions represented_port ethdev_port_id 1 / end testpmd> flow create 0 ingress pattern eth / ipv4 src is 192.168.0.2 / tcp / end actions represented_port ethdev_port_id 2 / end @@ -2835,7 +2837,7 @@ This case is designed based on 4*25G NIC. check the rules exist in the list. -8. send matched packets:: +9. send matched packets:: sendp([Ether(dst="68:05:ca:8d:ed:a8")/IP(src="192.168.0.1")/TCP()/Raw("X"*480)], iface="ens786f0", count=1) sendp([Ether(dst="68:05:ca:8d:ed:a8")/IP(src="192.168.0.2")/TCP()/Raw("X"*480)], iface="ens786f0", count=1) @@ -2862,7 +2864,7 @@ This case is designed based on 4*25G NIC. check the packets are not to any VF. -9. verify rules can be destroyed:: +10. verify rules can be destroyed:: testpmd> flow flush 0 testpmd> flow list 0 @@ -4467,4 +4469,4 @@ Subcase 4: MAC_IPV4_NVGRE_MAC_IPV4_UDP + L4 MASK + single vf testpmd> flow list 0 check the rules not exist in the list. - send matched packets, check port 1 can not receive the packet. \ No newline at end of file + send matched packets, check port 1 can not receive the packet. From patchwork Tue Feb 21 14:50:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Li, HongboX" X-Patchwork-Id: 124264 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 95C1741CF8; Tue, 21 Feb 2023 07:33:10 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 91CCB43163; Tue, 21 Feb 2023 07:33:10 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id AB16C40E5A for ; Tue, 21 Feb 2023 07:33:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676961188; x=1708497188; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=oABYbbhJD/wlXyvCncAdVCwhEhLE8g/p0lWmuJ1fGaE=; b=QQAWIu9HL8tS7l8OHqMnSopS+cvgKhlmFBAbzjGNKYnHQbhys63Rct65 ruflhXS86ZTtS+/uJlSiY+syRi9LlvRpsQ+Op3gariNu+2+AWiSQpWKB4 rtRu4y+mGScUtrP9HC5PJUjS7Ho0Ard5oF1ZTzGcXtO5JEMx7bFP/gXDS 0P/4Ubex0xvQdoVsgOyVD3jKsZwALTDYhRx+3Qsiojmc45ywJREqHFPV+ mjhT8dqqsId4w5gnyFtEJleIjLe1rT1BkALSO4W40K/tBLxvSVkd8XBtM UXtshKbHAKddyjQYJYFRN2c9mpJKB01ClGIfzQUj/cKopwy4Np8mQlD69 Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10627"; a="330275968" X-IronPort-AV: E=Sophos;i="5.97,314,1669104000"; d="scan'208";a="330275968" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Feb 2023 22:33:08 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10627"; a="1000483914" X-IronPort-AV: E=Sophos;i="5.97,314,1669104000"; d="scan'208";a="1000483914" Received: from unknown (HELO localhost.localdomain) ([10.239.252.93]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Feb 2023 22:33:07 -0800 From: Hongbo Li To: dts@dpdk.org Cc: Hongbo Li Subject: [dts][PATCH V1 2/2] tests/ice_dcf_switch_filter: optimize max vfs script Date: Tue, 21 Feb 2023 22:50:59 +0800 Message-Id: <20230221145059.10655-2-hongbox.li@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230221145059.10655-1-hongbox.li@intel.com> References: <20230221145059.10655-1-hongbox.li@intel.com> X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 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 Change the method of obtaining the maximum number of VF that can be created on one PF Signed-off-by: Hongbo Li --- tests/TestSuite_ice_dcf_switch_filter.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/tests/TestSuite_ice_dcf_switch_filter.py b/tests/TestSuite_ice_dcf_switch_filter.py index 3560d065..4a84d084 100644 --- a/tests/TestSuite_ice_dcf_switch_filter.py +++ b/tests/TestSuite_ice_dcf_switch_filter.py @@ -2951,10 +2951,21 @@ class ICEDCFSwitchFilterTest(TestCase): def test_max_vfs(self): # get max vfs number - port_count = (1, 1, 2, 4, 4)[len(self.dut_ports)] - max_vf_number = int(256 / (port_count)) - # set up max_vf_number vfs on 1 pf environment self.used_dut_port_0 = self.dut_ports[0] + self.domain_id_0 = self.dut.ports_info[self.used_dut_port_0]["port"].domain_id + self.bus_id_0 = self.dut.ports_info[self.used_dut_port_0]["port"].bus_id + self.devfun_id_0 = self.dut.ports_info[self.used_dut_port_0]["port"].devfun_id + cmd_max_vfs = ( + "cat /sys/bus/pci/devices/" + + self.domain_id_0 + + "\\:" + + self.bus_id_0 + + "\\:" + + self.devfun_id_0 + + "/sriov_totalvfs" + ) + max_vf_number = int(self.dut.send_expect(cmd_max_vfs, "#")) + # set up max_vf_number vfs on 1 pf environment self.pf0_intf = self.dut.ports_info[self.used_dut_port_0]["intf"] out = self.dut.send_expect("ethtool -i %s" % self.pf0_intf, "#") # generate max_vf_number VFs on PF0