From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 21C2FA034C; Fri, 25 Feb 2022 06:43:52 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 15DFF41169; Fri, 25 Feb 2022 06:43:52 +0100 (CET) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 4428B41169 for ; Fri, 25 Feb 2022 06:43:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645767830; x=1677303830; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=eAjWfEw0m7YGD0emlYNr/jC4vRybT2J8goP0R4QhkGI=; b=epby8RxZzhbLOghsmEngfPLdR6/J9NdSjQXRp+OiMXsGUQvEq6tYAgWg fYQASGy5A6MAEvNkIdjafn0nPJZOGl9cGQl3weWqlOaC+ExsFZ0hEupuT QHo7zqktn36g51FFY3DkxBy51o2ZiV5MFjSoQLcOZZSeP4As+gbLB3wkf upUyQs27jRjY4vDl6924biXWScS+yWZHa+KUsAYz/KE62kfOlQmjF+3wP EFXO3l3yJB0RxuntYHh2510OBKah3IMuAVgCL/ruIn9H4pwH6ZodUGWR4 UU2kHFyNbyS+IPL/4OxuWTslctPZ7MI7QU8XAnxxglZufXTOgKLjwgCt0 A==; X-IronPort-AV: E=McAfee;i="6200,9189,10268"; a="313145112" X-IronPort-AV: E=Sophos;i="5.90,135,1643702400"; d="scan'208";a="313145112" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Feb 2022 21:43:49 -0800 X-IronPort-AV: E=Sophos;i="5.90,135,1643702400"; d="scan'208";a="592347271" Received: from shwdenpg197.ccr.corp.intel.com ([10.253.109.70]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Feb 2022 21:43:48 -0800 From: Jun Dong To: dts@dpdk.org Cc: lijuan.tu@intel.com, qingx.sun@intel.com, junx.dong@intel.com Subject: [dts] [V2 3/4] framework/*: removed makefile from framework Date: Fri, 25 Feb 2022 13:43:36 +0800 Message-Id: <20220225054337.3668-4-junx.dong@intel.com> X-Mailer: git-send-email 2.33.1.windows.1 In-Reply-To: <20220225054337.3668-1-junx.dong@intel.com> References: <20220225054337.3668-1-junx.dong@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Makefile builds have been deprecated, so: - Removed makefile handle codes. - Update context code structure after removed makefile relation codes. Signed-off-by: Jun Dong --- framework/dts.py | 12 --- framework/dut.py | 4 +- framework/project_dpdk.py | 157 +++++--------------------------------- framework/settings.py | 1 - framework/virt_dut.py | 7 +- 5 files changed, 19 insertions(+), 162 deletions(-) diff --git a/framework/dts.py b/framework/dts.py index 1baddb84..ca6bb322 100644 --- a/framework/dts.py +++ b/framework/dts.py @@ -95,18 +95,6 @@ def dts_parse_param(config, section, log_handler): parameters = config.get(section, 'parameters').split(':') drivername = config.get(section, 'drivername').split('=')[-1] - # get the build method, default is meson - try: - buildtype = config.get(section, 'build_type').split('=')[-1] - except: - buildtype = 'meson' - - if buildtype == 'makefile': - log_handler.warning("Makefile builds have been deprecated and will be removed in the next release.") - log_handler.warning("Please switch to using meson builds.") - - buildtype = buildtype.lower() - settings.save_global_setting(settings.HOST_BUILD_TYPE_SETTING, buildtype) driver = drivername.split(':') if len(driver) == 2: diff --git a/framework/dut.py b/framework/dut.py index 2a4d8f3b..321a652b 100644 --- a/framework/dut.py +++ b/framework/dut.py @@ -238,9 +238,7 @@ class Dut(Crb): if use_shared_lib == 'true' and shared_lib_path and 'Virt' not in str(self): eal_str = eal_str + ' -d {} '.format(shared_lib_path) rx_mode = settings.load_global_setting(settings.DPDK_RXMODE_SETTING) - build_type = settings.load_global_setting(settings.HOST_BUILD_TYPE_SETTING) - if build_type == 'meson' and ('other_eal_param' not in config or - 'force-max-simd-bitwidth' not in config['other_eal_param']): + if 'other_eal_param' not in config or 'force-max-simd-bitwidth' not in config['other_eal_param']: if rx_mode == 'novector': eal_str = eal_str + ' --force-max-simd-bitwidth=64 ' elif rx_mode == 'sse': diff --git a/framework/project_dpdk.py b/framework/project_dpdk.py index fc004e45..f6cf6aa6 100644 --- a/framework/project_dpdk.py +++ b/framework/project_dpdk.py @@ -38,7 +38,6 @@ from .logger import getLogger from .settings import ( DPDK_RXMODE_SETTING, DRIVERS, - HOST_BUILD_TYPE_SETTING, HOST_DRIVER_MODE_SETTING, HOST_DRIVER_SETTING, HOST_SHARED_LIB_PATH, @@ -72,10 +71,6 @@ class DPDKdut(Dut): Set hugepage on DUT and install modules required by DPDK. Configure default ixgbe PMD function. """ - # get apps name of current build type - self.build_type = load_global_setting(HOST_BUILD_TYPE_SETTING) - if self.build_type not in self.apps_name_conf: - raise Exception('please config the apps name in app_name.cfg of build type:%s' % self.build_type) self.target = target self.set_toolchain(target) @@ -89,7 +84,7 @@ class DPDKdut(Dut): self.set_driver_specific_configurations(drivername) - self.apps_name = self.apps_name_conf[self.build_type] + self.apps_name = self.apps_name_conf['meson'] # use the dut target directory instead of 'target' string in app name for app in self.apps_name: cur_app_path = self.apps_name[app].replace('target', self.target) @@ -198,60 +193,23 @@ class DPDKdut(Dut): """ Set default RX/TX PMD function, the rx mode scalar/full/novector are supported dynamically since DPDK 20.11, - The DPDK version should be <=20.08 when compiling DPDK by makefile to use these rx modes, Rx mode avx512 is only supported in DPDK 20.11 and later version. """ mode = load_global_setting(DPDK_RXMODE_SETTING) - build_type = load_global_setting(HOST_BUILD_TYPE_SETTING) - if build_type == 'makefile': - if mode == 'scalar': - self.set_build_options({'RTE_LIBRTE_I40E_INC_VECTOR': 'n', - 'RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC': 'y'}) - elif mode == 'full': - self.set_build_options({'RTE_LIBRTE_I40E_INC_VECTOR': 'n', - 'RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC': 'n'}) - elif mode == 'novector': - self.set_build_options({'RTE_IXGBE_INC_VECTOR': 'n', - 'RTE_LIBRTE_I40E_INC_VECTOR': 'n'}) - elif mode == 'avx512': - self.logger.warning(RED('*********AVX512 is not supported by makefile!!!********')) - else: - if mode == 'avx512': - out = self.send_expect('lscpu | grep avx512', '#') - if 'avx512f' not in out or 'no-avx512f' in out: - self.logger.warning(RED('*********The DUT CPU do not support AVX512 test!!!********')) - self.logger.warning(RED('*********Now set the rx_mode to default!!!**********')) - save_global_setting(DPDK_RXMODE_SETTING, 'default') + if mode == 'avx512': + out = self.send_expect('lscpu | grep avx512', '#') + if 'avx512f' not in out or 'no-avx512f' in out: + self.logger.warning(RED('*********The DUT CPU do not support AVX512 test!!!********')) + self.logger.warning(RED('*********Now set the rx_mode to default!!!**********')) + save_global_setting(DPDK_RXMODE_SETTING, 'default') def set_package(self, pkg_name="", patch_list=[]): self.package = pkg_name self.patches = patch_list def set_build_options(self, config_parms, config_file=''): - build_type = load_global_setting(HOST_BUILD_TYPE_SETTING) - set_build_options = getattr(self, 'set_build_options_%s' % (build_type)) - set_build_options(config_parms, config_file) - - def set_build_options_makefile(self, config_parms, config_file=''): - """ - Set dpdk build options of makefile - """ - if len(config_parms) == 0: - return; - if config_file == '': - config_file = 'config/common_base' - - for key in config_parms.keys(): - value = config_parms[key] - if isinstance(value, int): - self.send_expect("sed -i -e 's/CONFIG_%s=.*$/CONFIG_%s=%d/' %s" % (key, key, value, config_file), "# ") - else: - if value == '': - value = 'y' - elif len(value) > 1: - value = '\\"%s\\"' % value - self.send_expect("sed -i -e 's/CONFIG_%s=.*$/CONFIG_%s=%s/' %s" % (key, key, value, config_file), "# ") + self.set_build_options_meson(config_parms, config_file) def set_build_options_meson(self, config_parms, config_file=''): """ @@ -284,13 +242,12 @@ class DPDKdut(Dut): Build DPDK source code with specified target. """ use_shared_lib = load_global_setting(HOST_SHARED_LIB_SETTING) - shared_lib_path = load_global_setting(HOST_SHARED_LIB_PATH) if use_shared_lib == 'true' and 'Virt' not in str(self): self.set_build_options({'RTE_BUILD_SHARED_LIB': 'y'}) - - build_type = load_global_setting(HOST_BUILD_TYPE_SETTING) - build_install_dpdk = getattr(self, 'build_install_dpdk_%s_%s' % (self.get_os_type(), build_type)) - build_install_dpdk(target, extra_options) + if self.get_os_type() == 'linux': + self.build_install_dpdk_linux_meson(target, extra_options) + elif self.get_os_type() == 'freebsd': + self.build_install_dpdk_freebsd_meson(target, extra_options) def build_install_dpdk_linux_meson(self, target, extra_options): """ @@ -339,32 +296,6 @@ class DPDKdut(Dut): for mod in kmod: self.send_expect("cp %s %s/kmod/" % (mod, target), "# ") - def build_install_dpdk_linux_makefile(self, target, extra_options): - """ - Build DPDK source code on linux with specified target. - """ - build_time = 600 - if "icc" in target: - build_time = 900 - # clean all - self.send_expect("rm -rf " + target, "#") - self.send_expect("rm -rf %s" % r'./app/test/test_resource_c.res.o' , "#") - self.send_expect("rm -rf %s" % r'./app/test/test_resource_tar.res.o' , "#") - self.send_expect("rm -rf %s" % r'./app/test/test_pci_sysfs.res.o' , "#") - - self.set_build_options({'RTE_EAL_IGB_UIO': 'y'}) - - # compile - out = self.send_expect("make -j %d install T=%s %s MAKE_PAUSE=n" % - (self.number_of_cores, target, extra_options), "# ", build_time) - if("Error" in out or "No rule to make" in out): - self.logger.error("ERROR - try without '-j'") - # if Error try to execute make without -j option - out = self.send_expect("make install T=%s %s MAKE_PAUSE=n" % (target, extra_options), "# ", build_time*4) - - assert ("Error" not in out), "Compilation error..." - assert ("No rule to make" not in out), "No rule to make error..." - def build_install_dpdk_freebsd_meson(self, target, extra_options): # meson build same as linux self.build_install_dpdk_linux_meson(target, extra_options) @@ -375,29 +306,6 @@ class DPDKdut(Dut): if not isinstance(out, int) and len(out) > 0: self.send_expect("cp %s %s/kmod/" % (out, target), "# ") - def build_install_dpdk_freebsd_makefile(self, target, extra_options): - """ - Build DPDK source code on Freebsd with specified target. - """ - # clean all - self.send_expect("rm -rf " + target, "#") - self.send_expect("rm -rf %s" % r'./app/test/test_resource_c.res.o' , "#") - self.send_expect("rm -rf %s" % r'./app/test/test_resource_tar.res.o' , "#") - self.send_expect("rm -rf %s" % r'./app/test/test_pci_sysfs.res.o' , "#") - build_time = 180 - # compile - out = self.send_expect("make -j %d install T=%s MAKE_PAUSE=n" % (self.number_of_cores, - target), - "#", build_time) - if("Error" in out or "No rule to make" in out): - self.logger.error("ERROR - try without '-j'") - # if Error try to execute make without -j option - out = self.send_expect("make install T=%s MAKE_PAUSE=n" % target, - "#", build_time) - - assert ("Error" not in out), "Compilation error..." - assert ("No rule to make" not in out), "No rule to make error..." - def prepare_package(self): if not self.skip_setup: session_info = None @@ -528,9 +436,10 @@ class DPDKdut(Dut): """ Build dpdk sample applications. """ - build_type = load_global_setting(HOST_BUILD_TYPE_SETTING) - build_dpdk_apps = getattr(self, 'build_dpdk_apps_%s_%s' % (self.get_os_type(), build_type)) - return build_dpdk_apps(folder, extra_options) + if self.get_os_type() == 'linux': + return self.build_dpdk_apps_linux_meson(folder, extra_options) + elif self.get_os_type() == 'freebsd': + return self.build_dpdk_apps_freebsd_meson(folder, extra_options) def build_dpdk_apps_linux_meson(self, folder, extra_options): """ @@ -581,37 +490,10 @@ class DPDKdut(Dut): return out - def build_dpdk_apps_linux_makefile(self, folder, extra_options): - """ - Build dpdk sample applications on linux. - """ - # icc compile need more time - if 'icc' in self.target: - timeout = 300 - else: - timeout = 90 - self.send_expect("rm -rf %s" % r'./app/test/test_resource_c.res.o' , "#") - self.send_expect("rm -rf %s" % r'./app/test/test_resource_tar.res.o' , "#") - self.send_expect("rm -rf %s" % r'./app/test/test_pci_sysfs.res.o' , "#") - return self.send_expect("make -j %d -C %s %s" % (self.number_of_cores, - folder, extra_options), - "# ", timeout) - def build_dpdk_apps_freebsd_meson(self, folder, extra_options): # meson build same as linux return self.build_dpdk_apps_linux_meson(folder, extra_options) - def build_dpdk_apps_freebsd_makefile(self, folder, extra_options): - """ - Build dpdk sample applications on Freebsd. - """ - self.send_expect("rm -rf %s" % r'./app/test/test_resource_c.res.o' , "#") - self.send_expect("rm -rf %s" % r'./app/test/test_resource_tar.res.o' , "#") - self.send_expect("rm -rf %s" % r'./app/test/test_pci_sysfs.res.o' , "#") - return self.send_expect("make -j %d -C %s %s" % (self.number_of_cores, - folder, extra_options), - "# ", 180) - def get_blocklist_string(self, target, nic): """ Get block list command string. @@ -647,12 +529,7 @@ class DPDKdut(Dut): """ # Enable Mellanox drivers if drivername == "mlx5_core" or drivername == "mlx4_core": - self.send_expect("sed -i -e 's/CONFIG_RTE_LIBRTE_MLX5_PMD=n/" - + "CONFIG_RTE_LIBRTE_MLX5_PMD=y/' config/common_base", "# ", 30) - self.send_expect("sed -i -e 's/CONFIG_RTE_LIBRTE_MLX4_PMD=n/" - + "CONFIG_RTE_LIBRTE_MLX5_PMD=y/' config/common_base", "# ", 30) - self.set_build_options({'RTE_LIBRTE_MLX5_PMD': 'y', - 'RTE_LIBRTE_MLX5_PMD': 'y'}) + self.set_build_options({'RTE_LIBRTE_MLX5_PMD': 'y'}) class DPDKtester(Tester): diff --git a/framework/settings.py b/framework/settings.py index e80fa66f..8b06ffac 100644 --- a/framework/settings.py +++ b/framework/settings.py @@ -250,7 +250,6 @@ PERF_SETTING = "DTS_PERF_ONLY" FUNC_SETTING = "DTS_FUNC_ONLY" HOST_DRIVER_SETTING = "DTS_HOST_DRIVER" HOST_DRIVER_MODE_SETTING = "DTS_HOST_DRIVER_MODE" -HOST_BUILD_TYPE_SETTING = "DTS_HOST_BUILD_TYPE" HOST_NIC_SETTING = "DTS_HOST_NIC" HOST_SHARED_LIB_SETTING = "DTS_HOST_SHARED_LIB" HOST_SHARED_LIB_PATH = "DTS_HOST_SHARED_LIB_PATH" diff --git a/framework/virt_dut.py b/framework/virt_dut.py index 7164c522..003c1d05 100644 --- a/framework/virt_dut.py +++ b/framework/virt_dut.py @@ -40,7 +40,6 @@ from .config import AppNameConf, PortConf from .dut import Dut from .project_dpdk import DPDKdut from .settings import ( - HOST_BUILD_TYPE_SETTING, LOG_NAME_SEP, NICS, get_netdev, @@ -231,11 +230,7 @@ class VirtDut(DPDKdut): name_cfg = AppNameConf() self.apps_name_conf = name_cfg.load_app_name_conf() - # get apps name of current build type - build_type = load_global_setting(HOST_BUILD_TYPE_SETTING) - if build_type not in self.apps_name_conf: - raise Exception('please config the apps name in app_name.cfg of build type:%s' % build_type) - self.apps_name = self.apps_name_conf[build_type] + self.apps_name = self.apps_name_conf['meson'] # use the dut target directory instead of 'target' string in app name for app in self.apps_name: cur_app_path = self.apps_name[app].replace('target', self.target) -- 2.33.1.windows.1