test suite reviews and discussions
 help / color / mirror / Atom feed
From: Ali Alnubani <alialnu@mellanox.com>
To: dts@dpdk.org
Cc: rasland@mellanox.com
Subject: [dts] [PATCH 2/2] project_dpdk: move driver specific configurations to a separate method
Date: Sun,  7 Jan 2018 18:01:12 +0200	[thread overview]
Message-ID: <1515340872-1236-3-git-send-email-alialnu@mellanox.com> (raw)
In-Reply-To: <1515340872-1236-1-git-send-email-alialnu@mellanox.com>

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

Signed-off-by: Ali Alnubani <alialnu@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

  parent reply	other threads:[~2018-01-07 16:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-07 16:01 [dts] [PATCH 0/2] add and update support for Mellanox nics Ali Alnubani
2018-01-07 16:01 ` [dts] [PATCH 1/2] settings: update mellanox's nics and their identifiers Ali Alnubani
2018-01-07 16:01 ` Ali Alnubani [this message]
2018-01-09 13:14 ` [dts] [PATCH 0/2] add and update support for Mellanox nics Liu, Yong

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=1515340872-1236-3-git-send-email-alialnu@mellanox.com \
    --to=alialnu@mellanox.com \
    --cc=dts@dpdk.org \
    --cc=rasland@mellanox.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).