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 2A35CA054F; Tue, 18 Feb 2020 12:50:17 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E40241D513; Tue, 18 Feb 2020 12:50:16 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id B15D81D511 for ; Tue, 18 Feb 2020 12:50:15 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Feb 2020 03:50:14 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,456,1574150400"; d="scan'208";a="224114887" Received: from unknown (HELO dpdk-lijuan.sh.intel.com) ([10.67.119.192]) by orsmga007.jf.intel.com with ESMTP; 18 Feb 2020 03:50:12 -0800 From: Lijuan Tu To: dts@dpdk.org Cc: Lijuan Tu Date: Wed, 19 Feb 2020 03:59:01 +0800 Message-Id: <1582055941-27657-1-git-send-email-lijuan.tu@intel.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dts] [PATCH V2] tests/vf_l3fwd: add a case for fvl iavf 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" * add a new test case: kernel_pf_dpdk_iavf_perf * fix mapping of pf/vf driver Signed-off-by: Lijuan Tu --- tests/TestSuite_vf_l3fwd.py | 50 +++++++++++++++++++++++++++++++++------------ 1 file changed, 37 insertions(+), 13 deletions(-) diff --git a/tests/TestSuite_vf_l3fwd.py b/tests/TestSuite_vf_l3fwd.py index 760b920..2aa3041 100644 --- a/tests/TestSuite_vf_l3fwd.py +++ b/tests/TestSuite_vf_l3fwd.py @@ -107,27 +107,26 @@ class TestVfL3fwd(TestCase): """ self.setup_vf_env_flag = 0 - def setup_vf_env(self, host_driver='default'): + def setup_vf_env(self, host_driver='default', vf_driver='vfio-pci'): """ require enough PF ports,using kernel or dpdk driver, create 1 VF from each PF. """ + if host_driver != "default" and host_driver != "igb_uio": + self.logger.error("only support kernel driver and igb_uio!") self.used_dut_port = [port for port in self.dut_ports] self.sriov_vfs_port = [] for i in valports: - if host_driver != '': - self.dut.generate_sriov_vfs_by_port(self.used_dut_port[i], 1) - else: - self.dut.generate_sriov_vfs_by_port(self.used_dut_port[i], 1, host_driver) + self.dut.generate_sriov_vfs_by_port(self.used_dut_port[i], 1, host_driver) sriov_vfs_port = self.dut.ports_info[self.used_dut_port[i]]['vfs_port'] self.sriov_vfs_port.append(sriov_vfs_port) # bind vf to vf driver try: for i in valports: for port in self.sriov_vfs_port[i]: - port.bind_driver(self.vf_driver) + port.bind_driver(vf_driver) time.sleep(1) # set vf mac address. - if host_driver == '': + if host_driver == 'default': for i in valports: pf_intf = self.dut.ports_info[i]['port'].get_interface_name() self.dut.send_expect("ip link set %s vf 0 mac %s" % (pf_intf, self.vfs_mac[i]), "#") @@ -260,11 +259,11 @@ class TestVfL3fwd(TestCase): self.dut.close_session(l3fwd_session) self.result_table_print() - def measure_vf_performance(self, host_driver='default'): + def measure_vf_performance(self, host_driver='default', vf_driver='vfio-pci'): """ start l3fwd and run the perf test """ - self.setup_vf_env(host_driver) + self.setup_vf_env(host_driver, vf_driver) eal_param = "" for i in valports: eal_param += " -w " + self.sriov_vfs_port[i][0].pci @@ -281,17 +280,42 @@ class TestVfL3fwd(TestCase): for j in range(self.queue): queue_config += "({0}, {1}, {2})," .format(i, j, core_list[m]) m += 1 - cmdline = "./examples/l3fwd/build/l3fwd -c {0} -n 4 {1} -- -p {2} --config '{3}' ". \ + cmdline = "./examples/l3fwd/build/l3fwd -c {0} -n 4 {1} -- -p {2} --config '{3}' --parse-ptype". \ format(core_mask, eal_param, port_mask, queue_config) self.perf_test(cmdline) - def test_perf_kernel_pf_dpdk_vf_perf_host_only(self): + def get_kernel_pf_vf_driver(self): + if self.vf_driver == "igb_uio" or self.vf_driver == "vfio-pci": + vf_driver = self.vf_driver + elif self.drivername == "igb_uio" or self.drivername == "vfio-pci": + vf_driver = self.drivername + else: + vf_driver = "vfio-pci" + return vf_driver - self.measure_vf_performance(host_driver='') + def test_perf_kernel_pf_dpdk_vf_perf_host_only(self): + self.measure_vf_performance(host_driver='default', vf_driver=self.get_kernel_pf_vf_driver()) def test_perf_dpdk_pf_dpdk_vf_perf_host_only(self): + if self.drivername != "igb_uio": + self.logger.warning("Use igb_uio as host driver for testing instead of %s" % self.drivername) + + self.measure_vf_performance(host_driver='igb_uio', vf_driver='igb_uio') + + def test_perf_kernel_pf_dpdk_iavf_perf_host_only(self): + self.verify_supported_nic() + self.build_iavf() + self.dut.build_dpdk_apps("./examples/l3fwd") + self.measure_vf_performance(host_driver='default', vf_driver=self.get_kernel_pf_vf_driver()) + + def verify_supported_nic(self): + for idx in self.dut_ports: + self.verify(self.dut.ports_info[idx]['port'].default_driver == 'i40e', 'The case is only designed for Fortville') - self.measure_vf_performance(host_driver=self.vf_driver) + def build_iavf(self): + self.dut.send_expect("sed -i '/{ RTE_PCI_DEVICE(IAVF_INTEL_VENDOR_ID, IAVF_DEV_ID_ADAPTIVE_VF) },/a { RTE_PCI_DEVICE(IAVF_INTEL_VENDOR_ID, IAVF_DEV_ID_VF) },' drivers/net/iavf/iavf_ethdev.c", "# ") + self.dut.send_expect("sed -i -e '/I40E_DEV_ID_VF/s/0x154C/0x164C/g' drivers/net/i40e/base/i40e_devids.h", "# ") + self.dut.build_install_dpdk(self.target) def set_fields(self): """ -- 1.8.3.1