[dts] [PATCH 2/2] project_dpdk: move driver specific configurations to a separate method

Ali Alnubani alialnu at mellanox.com
Sun Jan 7 17:01:12 CET 2018


Enable both MLX4 and MLX5 PMDs before compiling dpdk, and do that
in a separate method.

Signed-off-by: Ali Alnubani <alialnu at mellanox.com>
---
 framework/project_dpdk.py | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/framework/project_dpdk.py b/framework/project_dpdk.py
index 6bc47f2..1f673c9 100644
--- a/framework/project_dpdk.py
+++ b/framework/project_dpdk.py
@@ -71,11 +71,9 @@ class DPDKdut(Dut):
 
         self.set_rxtx_mode()
 
-        # Enable MLNX driver before installing dpdk
         drivername = load_global_setting(HOST_DRIVER_SETTING)
-        if drivername == DRIVERS['ConnectX4']:
-            self.send_expect("sed -i -e 's/CONFIG_RTE_LIBRTE_MLX5_PMD=n/"
-                             + "CONFIG_RTE_LIBRTE_MLX5_PMD=y/' config/common_base", "# ", 30)
+
+        self.set_driver_specific_configurations(drivername)
 
         if not self.skip_setup:
             self.build_install_dpdk(target)
@@ -431,6 +429,16 @@ class DPDKdut(Dut):
         # No blacklist option in FreeBSD
         return blacklist
 
+    def set_driver_specific_configurations(self, drivername):
+        """
+        Set configurations required for specific drivers before compilation.
+        """
+        # 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)
 
 class DPDKtester(Tester):
 
-- 
2.7.4



More information about the dts mailing list