test suite reviews and discussions
 help / color / mirror / Atom feed
From: Jun Dong <junx.dong@intel.com>
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	[thread overview]
Message-ID: <20220225054337.3668-4-junx.dong@intel.com> (raw)
In-Reply-To: <20220225054337.3668-1-junx.dong@intel.com>

Makefile builds have been deprecated, so:
- Removed makefile handle codes.
- Update context code structure after removed makefile relation codes.

Signed-off-by: Jun Dong <junx.dong@intel.com>
---
 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


  parent reply	other threads:[~2022-02-25  5:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-25  5:43 [dts] [V2 0/4] removed makefile relation content Jun Dong
2022-02-25  5:43 ` [dts] [V2 1/4] executions/execution*: removed makefile from configure Jun Dong
2022-02-25  5:43 ` [dts] [V2 2/4] doc/dts_gsg: removed makefile from user guide document Jun Dong
2022-02-25  5:43 ` Jun Dong [this message]
2022-02-25  5:43 ` [dts] [V2 4/4] tests/*: removed makefile from test suite Jun Dong
2022-02-27 14:27   ` Tu, Lijuan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220225054337.3668-4-junx.dong@intel.com \
    --to=junx.dong@intel.com \
    --cc=dts@dpdk.org \
    --cc=lijuan.tu@intel.com \
    --cc=qingx.sun@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).