test suite reviews and discussions
 help / color / mirror / Atom feed
* [DTS][PATCH V1 00/10] add functions to test MEV
@ 2023-07-16  9:07 Jin Ling
  2023-07-16  9:07 ` [DTS][PATCH V1 01/10] conf/crbs.cfg: add parameters Jin Ling
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Jin Ling @ 2023-07-16  9:07 UTC (permalink / raw)
  To: dts; +Cc: Jin Ling

Jin Ling (10):
  conf/crbs.cfg: add parameters to connect mev and acc via serial port
  execution.cfg: add parameters to choose datapath and create vport when
    running test scripts
  framework/config: save the serial port connection information of imc
    and acc  to the self.crb
  framework/crb:modify code when pexpect contains '#', replace '#' with
    'mev-acc'
  framework/dts: add global variables add
    'test_mev','test_acc','queue_model','vport','rx_vport' to config
    datapath and vport when executing cases
  framework/dut: add new functions to set up test mev env will set up
    the test env of mev when creating a dut according the global var
    'test_mev'
  framework/pmd_output: optimize function start_testpmd add code to
    create cmdline for running testpmd
  framework/project_dpdk: optimize code Optimizing functions to prevent
    errors when testing with mev
  framework/settings: add drivers and NICs for mev
  framework/ssh_pexpect: optimize the code to get output Filtered
    control characters in minicom output

 conf/crbs.cfg             |   4 ++
 execution.cfg             |  12 +++-
 framework/config.py       |  10 ++++
 framework/crb.py          |   6 ++
 framework/dts.py          |  25 +++++++-
 framework/dut.py          | 121 +++++++++++++++++++++++++++++++++++---
 framework/pmd_output.py   |   3 +
 framework/project_dpdk.py |  21 +++++--
 framework/settings.py     |   9 ++-
 framework/ssh_pexpect.py  |  18 ++++--
 10 files changed, 207 insertions(+), 22 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [DTS][PATCH V1 01/10] conf/crbs.cfg: add parameters
  2023-07-16  9:07 [DTS][PATCH V1 00/10] add functions to test MEV Jin Ling
@ 2023-07-16  9:07 ` Jin Ling
  2023-07-16  9:07 ` [DTS][PATCH V1 02/10] execution.cfg: add parameters to choose datapath and create vport when running test scripts Jin Ling
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Jin Ling @ 2023-07-16  9:07 UTC (permalink / raw)
  To: dts; +Cc: Jin Ling

    Add parameters to connect mev and acc via serial port

Signed-off-by: Jin Ling <jin.ling@intel.com>
---
 conf/crbs.cfg | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/conf/crbs.cfg b/conf/crbs.cfg
index a12e60a4..051c5d9e 100644
--- a/conf/crbs.cfg
+++ b/conf/crbs.cfg
@@ -19,6 +19,10 @@ dut_user=root
 dut_passwd=
 os=linux
 dut_arch=
+dut_acc_port = 
+dut_acc_baudrate = 
+dut_imc_port = /dev/ttyUSB2 
+dut_imc_baudrate = 460800
 tester_ip=xxx.xxx.xxx.xxx
 tester_passwd=
 ixia_group=
-- 
2.34.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [DTS][PATCH V1 02/10] execution.cfg: add parameters to choose datapath and create vport when running test scripts
  2023-07-16  9:07 [DTS][PATCH V1 00/10] add functions to test MEV Jin Ling
  2023-07-16  9:07 ` [DTS][PATCH V1 01/10] conf/crbs.cfg: add parameters Jin Ling
@ 2023-07-16  9:07 ` Jin Ling
  2023-07-16  9:07 ` [DTS][PATCH V1 03/10] framework/config: save the serial port connection info of imc and acc to the self.crb Jin Ling
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Jin Ling @ 2023-07-16  9:07 UTC (permalink / raw)
  To: dts; +Cc: Jin Ling

Signed-off-by: Jin Ling <jin.ling@intel.com>
---
 execution.cfg | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/execution.cfg b/execution.cfg
index 1507527c..fcc2cbe7 100644
--- a/execution.cfg
+++ b/execution.cfg
@@ -6,5 +6,15 @@ build_type=meson
 test_suites=
     hello_world,
 targets=
-    x86_64-native-linuxapp-gcc
+    #   on acc: 
+    # arm64-intel-linux-gcc 
+    #  on host: 
+    x86_64-native-linuxapp-gcc 
 parameters=nic_type=cfg:func=true
+# test_mev =True
+# test_acc =True
+# rx_mode=novector
+# # # rx_mode=AVX512
+# queue_model=splitq
+# vport=0-1
+# rx_vport=0
\ No newline at end of file
-- 
2.34.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [DTS][PATCH V1 03/10] framework/config: save the serial port connection info of imc and acc to the self.crb
  2023-07-16  9:07 [DTS][PATCH V1 00/10] add functions to test MEV Jin Ling
  2023-07-16  9:07 ` [DTS][PATCH V1 01/10] conf/crbs.cfg: add parameters Jin Ling
  2023-07-16  9:07 ` [DTS][PATCH V1 02/10] execution.cfg: add parameters to choose datapath and create vport when running test scripts Jin Ling
@ 2023-07-16  9:07 ` Jin Ling
  2023-07-16  9:07 ` [DTS][PATCH V1 04/10] framework/crb:modify code when pexpect contains '#', replace '#' with 'mev-acc' Jin Ling
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Jin Ling @ 2023-07-16  9:07 UTC (permalink / raw)
  To: dts; +Cc: Jin Ling

Signed-off-by: Jin Ling <jin.ling@intel.com>
---
 framework/config.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/framework/config.py b/framework/config.py
index 2cd95ff2..cc5d9041 100644
--- a/framework/config.py
+++ b/framework/config.py
@@ -294,6 +294,16 @@ class CrbsConf(UserConf):
                     crb["pass"] = value
                 elif key == "os":
                     crb["OS"] = value
+                elif key == "dut_acc_port":
+                    crb["ACC PORT"] = value
+                elif key == "dut_acc_baudrate":
+                    crb["ACC BAUDRATE"] = value
+                elif key == "dut_imc_port":
+                    crb["IMC PORT"] = value
+                elif key == "dut_imc_baudrate":
+                    crb["IMC BAUDRATE"] = value
+                elif key == "dut_imc_ip":
+                    crb["IMC IP"] = value
                 elif key == "tester_ip":
                     crb["tester IP"] = value
                 elif key == "tester_passwd":
-- 
2.34.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [DTS][PATCH V1 04/10] framework/crb:modify code when pexpect contains '#', replace '#' with 'mev-acc'
  2023-07-16  9:07 [DTS][PATCH V1 00/10] add functions to test MEV Jin Ling
                   ` (2 preceding siblings ...)
  2023-07-16  9:07 ` [DTS][PATCH V1 03/10] framework/config: save the serial port connection info of imc and acc to the self.crb Jin Ling
@ 2023-07-16  9:07 ` Jin Ling
  2023-07-16  9:07 ` [DTS][PATCH V1 05/10] framework/dts: add global variables Jin Ling
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Jin Ling @ 2023-07-16  9:07 UTC (permalink / raw)
  To: dts; +Cc: Jin Ling

Signed-off-by: Jin Ling <jin.ling@intel.com>
---
 framework/crb.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/framework/crb.py b/framework/crb.py
index 9e3b0a58..0cd95553 100644
--- a/framework/crb.py
+++ b/framework/crb.py
@@ -103,6 +103,12 @@ class Crb(object):
         if trim_whitespace:
             expected = expected.strip()
 
+        try:
+            if "#" in cmds and self.acc_test_session !=None:
+                expected = "mev-acc"
+        except:
+            pass
+        
         # sometimes there will be no alt_session like VM dut
         if alt_session and self.alt_session:
             return self.alt_session.session.send_expect(cmds, expected, timeout, verify)
-- 
2.34.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [DTS][PATCH V1 05/10] framework/dts: add global variables
  2023-07-16  9:07 [DTS][PATCH V1 00/10] add functions to test MEV Jin Ling
                   ` (3 preceding siblings ...)
  2023-07-16  9:07 ` [DTS][PATCH V1 04/10] framework/crb:modify code when pexpect contains '#', replace '#' with 'mev-acc' Jin Ling
@ 2023-07-16  9:07 ` Jin Ling
  2023-07-16  9:07 ` [DTS][PATCH V1 06/10] framework/dut: add new functions to set up test mev env Jin Ling
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Jin Ling @ 2023-07-16  9:07 UTC (permalink / raw)
  To: dts; +Cc: Jin Ling

    add'test_mev','test_acc','queue_model','vport','rx_vport' to config datapath and
vport when executing cases.

Signed-off-by: Jin Ling <jin.ling@intel.com>
---
 framework/dts.py | 25 ++++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)

diff --git a/framework/dts.py b/framework/dts.py
index f540256d..45aa632d 100644
--- a/framework/dts.py
+++ b/framework/dts.py
@@ -145,10 +145,33 @@ def dts_parse_config(config, section):
         dcf_mode = config.get(section, "dcf_mode").strip().lower()
     except:
         dcf_mode = ""
+    try:
+        test_mev = config.get(section, "test_mev").strip().lower()
+    except:
+        test_mev=""
+    try:
+        test_acc = config.get(section, "test_acc").strip().lower()
+    except:
+        test_acc=""
+    try :
+        queue_model = config.get(section, "queue_model").strip().lower()
+    except:
+        queue_model = ""
+    try :
+        vport = config.get(section, "vport").strip().lower()
+    except:
+        vport = ""
+    try :
+        rx_vport = config.get(section, "rx_vport").strip().lower()
+    except:
+        rx_vport = "0"
 
     settings.save_global_setting(settings.DPDK_RXMODE_SETTING, rx_mode)
     settings.save_global_setting(settings.DPDK_DCFMODE_SETTING, dcf_mode)
-
+    settings.save_global_setting(settings.DPDK_QUEUE_MODEL_SETTING, queue_model)
+    settings.save_global_setting(settings.DPDK_VPORT_SETTING, vport)
+    settings.save_global_setting(settings.DPDK_RX_VPORT_SETTING, rx_vport)
+    settings.save_global_setting(settings.DPDK_TEST_MEV_SETTING, test_mev)
     suite_list_dedup = {}
     ## suite_list_dedup[suite_name] := { True | Set | ... }
     ## True := All Cases to Run
-- 
2.34.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [DTS][PATCH V1 06/10] framework/dut: add new functions to set up test mev env
  2023-07-16  9:07 [DTS][PATCH V1 00/10] add functions to test MEV Jin Ling
                   ` (4 preceding siblings ...)
  2023-07-16  9:07 ` [DTS][PATCH V1 05/10] framework/dts: add global variables Jin Ling
@ 2023-07-16  9:07 ` Jin Ling
  2023-07-16  9:07 ` [DTS][PATCH V1 07/10] framework/pmd_output: optimize function start_testpmd Jin Ling
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Jin Ling @ 2023-07-16  9:07 UTC (permalink / raw)
  To: dts; +Cc: Jin Ling

    will set up the test env of mev when creating a dut according the global var 'test_mev'.

Signed-off-by: Jin Ling <jin.ling@intel.com>
---
 framework/dut.py | 121 +++++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 113 insertions(+), 8 deletions(-)

diff --git a/framework/dut.py b/framework/dut.py
index 0adb2786..8a7884f0 100644
--- a/framework/dut.py
+++ b/framework/dut.py
@@ -6,6 +6,7 @@ import os
 import re
 import threading
 import time
+import copy
 from typing import Dict, List, Optional, Union
 from uuid import uuid4
 
@@ -15,11 +16,13 @@ from nics.net_device import GetNicObj
 from .config import AppNameConf, PortConf
 from .crb import Crb
 from .exception import ParameterInvalidException
-from .settings import LOG_NAME_SEP, NICS
+from .settings import LOG_NAME_SEP, NICS,DPDK_TEST_MEV_SETTING,\
+    DPDK_QUEUE_MODEL_SETTING,DPDK_VPORT_SETTING,DPDK_RX_VPORT_SETTING
 from .ssh_connection import SSHConnection
 from .test_result import ResultTable
 from .utils import RED, remove_old_rsa_key
 from .virt_resource import VirtResource
+from .logger import getLogger
 
 
 class Dut(Crb):
@@ -62,7 +65,10 @@ class Dut(Crb):
         self.apps_name = {}
         self.dpdk_version = ""
         self.nic = None
-
+        self.test_mev = settings.load_global_setting(DPDK_TEST_MEV_SETTING).lower()
+        # self.test_acc = settings.load_global_setting(DPDK_TEST_ACC_SETTING).lower()
+        if self.test_mev=="true":
+            self.set_up_mev_test_env()
     def filter_cores_from_crb_cfg(self):
         # get core list from crbs.cfg
         core_list = []
@@ -327,11 +333,13 @@ class Dut(Crb):
         self.load_portconf()
         self.mount_procfs()
         # auto detect network topology
-        self.map_available_ports()
+        # self.map_available_ports()
         # disable tester port ipv6
         self.disable_tester_ipv6()
         self.get_nic_configurations()
-
+        self.get_mev_nic_configurations()
+        # auto detect network topology
+        self.map_available_ports()
         # print latest ports_info
         for port_info in self.ports_info:
             self.logger.info(port_info)
@@ -354,6 +362,24 @@ class Dut(Crb):
             if self.nic.default_driver == "ice":
                 self.get_nic_pkg(retry_times)
 
+    def get_mev_nic_configurations(self):
+        if self.test_mev=="true":
+            self.vport=settings.load_global_setting(DPDK_VPORT_SETTING).lower()
+            try:
+                vport = self.vport.split("-")
+                vport = list(range(int(vport[0]),int(vport[1])+1))
+            except:
+                vport = [int(self.vport),]
+
+            if len(vport) > 1 :
+                for i in range(len(vport)-1):
+                    dut_port_info = copy.copy(self.ports_info[0])
+                    tester_port_info = copy.copy(self.tester.ports_info[0])
+                    dut_port_info["mac"] = self.ports_info[0]["mac"].replace("0",str(i+1),2)
+                    self.ports_info.append(dut_port_info)
+                    self.tester.ports_info.append(tester_port_info)
+                    # self.port_info[i+1]["pci"] = ""
+
     def get_nic_pkg(self, retry_times=3):
         self.nic.pkg = self.nic.get_nic_pkg()
         while not self.nic.pkg.get("type") and retry_times > 0:
@@ -1379,9 +1405,65 @@ class Dut(Crb):
         Recover all resource before crb exit
         """
         self.enable_tester_ipv6()
+        try:
+            self.bak_session.send_expect("pkill minicom","#")
+        except:
+            pass
+        self.close()
         self.close()
         self.logger.logger_exit()
-
+    
+    def create_imc_test_session(self):
+        self.imc_test_session = SSHConnection(host=self.crb["section"],session_name="imc",username="root",password="tester")
+        self.imc_test_session.init_log(getLogger("dut_imc_session"))
+        self.imc_test_session.send_expect("export TERM=linux-c-nc","#")
+        out = self.imc_test_session.send_command(f"sudo minicom -D {self.crb['IMC PORT']} -b {self.crb['IMC BAUDRATE']} -w")
+        while "root@mev-imc" not in out:
+            if "locked" in out:
+                self.bak_session.send_command("ps -ef | grep 'minicom -D %s' | grep -v grep | awk '{print $2}' | xargs kill -9"%(self.crb['IMC PORT']))
+                out = self.imc_test_session.send_command(f"sudo minicom -D {self.crb['IMC PORT']} -b {self.crb['IMC BAUDRATE']}")
+            elif "login" in out:
+                out = self.imc_test_session.send_command("root")
+            else:
+                out = self.imc_test_session.send_command("\n")
+        self.logger.info("create imc test session successfully")
+
+    def create_acc_test_session(self):
+        self.acc_test_session = SSHConnection(host=self.crb["section"],session_name="acc",username="root",password="tester")
+        self.acc_test_session.init_log(getLogger("dut_acc_session"))
+        self.acc_test_session.send_expect("export TERM=linux-c-nc","#")
+        out = self.acc_test_session.send_command(f"sudo minicom -D {self.crb['ACC PORT']} -b {self.crb['ACC BAUDRATE']}")
+        # out = self.send_command(f"ssh 192.168.0.2")
+        while "root@mev-acc" not in out:
+            if "locked" in out:
+                self.bak_session.send_command("ps -ef | grep 'minicom -D %s' | grep -v grep | awk '{print $2}' | xargs kill -9"%(self.crb['ACC PORT']))
+                out = self.acc_test_session.send_command(f"sudo minicom -D {self.crb['ACC PORT']} -b {self.crb['ACC BAUDRATE']}")
+            elif "login" in out:
+                out = self.acc_test_session.send_command("root")
+            else:
+                out = self.acc_test_session.send_command("\n")
+        self.acc_test_session.logger.info("login acc successfully")
+    def mev_config_rx_port(self, out):
+        rx_vport = settings.load_global_setting(DPDK_RX_VPORT_SETTING).lower()
+        try:
+            # self.ports_info[int(rx_vport)]['mac'] = re.findall(f'Port {rx_vport}: (.{17})\\r',out)[0]
+            mac = re.findall("Port %s: (.{17})\\r"%(rx_vport),out)[0]
+        except:
+            # self.ports_info[int(rx_vport)]['mac'] = re.findall('Address:(.{17})',out)[0]
+            mac = re.findall('Address:(.{17})',out)[0]
+        output = self.imc_test_session.send_command("cli_client --query --config --verbose")
+        vsi_id = re.findall("vsi_id: 0x(\w+).*is_created: yes.*mac addr: %s"%(mac.lower()),output)
+        self.imc_test_session.send_command("devmem 0x202920C100 64 0x80%s"%(vsi_id[0]))
+
+    def  set_up_mev_test_env(self):
+        if self.test_mev == "true":
+            self.bak_session = SSHConnection(host=self.crb["section"],session_name="bak",username="root",password="tester")
+            self.bak_session.init_log(getLogger("dut_bak"))
+            self.create_imc_test_session()
+            if self.crb["ACC PORT"] != "" and  self.crb["ACC BAUDRATE"] != "" and  self.crb["IP"] == self.crb["section"]:
+                self.create_acc_test_session()
+                self.session = self.acc_test_session
+                self.alt_session = self.acc_test_session
 
 class _EalParameter(object):
     def __init__(
@@ -1428,6 +1510,7 @@ class _EalParameter(object):
         param other_eal_param: user defined DPDK eal parameters, eg:
                         other_eal_param='--single-file-segments';
         """
+        self.test_mev=settings.load_global_setting(DPDK_TEST_MEV_SETTING).lower()
         self.os_type = dut.get_os_type()
         self.fixed_prefix = fixed_prefix
         self.socket = socket
@@ -1561,7 +1644,12 @@ class _EalParameter(object):
             for port_info in self.dut.ports_info:
                 pci_list.append("%s %s" % (allow_option, port_info["pci"]))
         self.dut.logger.info(pci_list)
-        return " ".join(pci_list)
+        # return " ".join(pci_list)
+        if self.test_mev =="true":
+            mev_port_options = self._get_mev_port_options()
+            return f"'' '.join(pci_list),{mev_port_options}"
+        else:
+            return " ".join(pci_list)
 
     def _make_b_ports_param(self) -> str:
         b_pci_list = []
@@ -1638,8 +1726,11 @@ class _EalParameter(object):
         port_mac_addr = self.dut.ports_info[port]["pci"] if type(port) == int else port
         port_param = f"{allow_option} {port_mac_addr}"
         port_option = self._get_port_options_from_config(port)
-        if port_option:
-            port_param = f"{port_param},{port_option}"
+        # if port_option:
+        #     port_param = f"{port_param},{port_option}"
+        mev_port_options = self._get_mev_port_options()
+        if port_option or mev_port_options:
+            port_param = f"{port_param},{mev_port_options},{port_option}"
         return port_param
 
     def _get_port_options_from_config(self, port: Union[str, int]) -> str:
@@ -1680,3 +1771,17 @@ class _EalParameter(object):
             ]
         )
         return _eal_str
+
+
+    def _get_mev_port_options(self):
+        if self.test_mev == "true":
+            self.queue_model = settings.load_global_setting(DPDK_QUEUE_MODEL_SETTING)
+            self.vport = settings.load_global_setting(DPDK_VPORT_SETTING)
+            port_options_dict = {
+            "splitq":f"vport={self.vport}",
+            "singleq":f"vport={self.vport},rx_single=1,tx_single=1",
+        }
+            out = port_options_dict[self.queue_model]
+            return out
+        else:
+            return ""
-- 
2.34.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [DTS][PATCH V1 07/10] framework/pmd_output: optimize function start_testpmd
  2023-07-16  9:07 [DTS][PATCH V1 00/10] add functions to test MEV Jin Ling
                   ` (5 preceding siblings ...)
  2023-07-16  9:07 ` [DTS][PATCH V1 06/10] framework/dut: add new functions to set up test mev env Jin Ling
@ 2023-07-16  9:07 ` Jin Ling
  2023-07-16  9:07 ` [DTS][PATCH V1 08/10] framework/project_dpdk: optimize code Jin Ling
  2023-07-16  9:07 ` [DTS][PATCH V1 09/10] framework/settings: add drivers and NICs for mev Jin Ling
  8 siblings, 0 replies; 10+ messages in thread
From: Jin Ling @ 2023-07-16  9:07 UTC (permalink / raw)
  To: dts; +Cc: Jin Ling

    add code to create cmdline for running testpmd

Signed-off-by: Jin Ling <jin.ling@intel.com>
---
 framework/pmd_output.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/framework/pmd_output.py b/framework/pmd_output.py
index c8e8b50f..865476ea 100644
--- a/framework/pmd_output.py
+++ b/framework/pmd_output.py
@@ -135,6 +135,7 @@ class PmdOutput:
             config["ports"] = [
                 self.dut.ports_info[i]["pci"] for i in range(len(self.dut.ports_info))
             ]
+            config["ports"]=list(set(config["ports"]))
         all_eal_param = self.dut.create_eal_parameters(
             fixed_prefix=fixed_prefix, socket=socket, **config
         )
@@ -145,6 +146,8 @@ class PmdOutput:
         if self.session != self.dut:
             self.session.send_expect("cd %s" % self.dut.base_dir, "# ")
         out = self.session.send_expect(command, expected, timeout)
+        if self.dut.test_mev == "true":
+            self.dut.mev_config_rx_port(out=out)
         self.command = command
         # wait 10s to ensure links getting up before test start.
         sleep(10)
-- 
2.34.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [DTS][PATCH V1 08/10] framework/project_dpdk: optimize code
  2023-07-16  9:07 [DTS][PATCH V1 00/10] add functions to test MEV Jin Ling
                   ` (6 preceding siblings ...)
  2023-07-16  9:07 ` [DTS][PATCH V1 07/10] framework/pmd_output: optimize function start_testpmd Jin Ling
@ 2023-07-16  9:07 ` Jin Ling
  2023-07-16  9:07 ` [DTS][PATCH V1 09/10] framework/settings: add drivers and NICs for mev Jin Ling
  8 siblings, 0 replies; 10+ messages in thread
From: Jin Ling @ 2023-07-16  9:07 UTC (permalink / raw)
  To: dts; +Cc: Jin Ling

    Optimizing functions to prevent errors when testing with mev

Signed-off-by: Jin Ling <jin.ling@intel.com>
---
 framework/project_dpdk.py | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/framework/project_dpdk.py b/framework/project_dpdk.py
index 3f34ee02..732eea12 100644
--- a/framework/project_dpdk.py
+++ b/framework/project_dpdk.py
@@ -98,9 +98,14 @@ class DPDKdut(Dut):
                     "echo 1 > /sys/module/vfio/parameters/enable_unsafe_noiommu_mode",
                     "#",
                 )
-            out = self.send_expect("ls /sys/module|grep vfio_pci", "#")
-            assert "vfio_pci" in out, "load vfio_pci failed"
-
+            # out = self.send_expect("ls /sys/module|grep vfio_pci", "#")
+            # assert "vfio_pci" in out, "load vfio_pci failed"
+            if "mev" not in self.nic.name:
+                out = self.send_expect("ls /sys/module|grep vfio_pci", "#")
+                assert "vfio_pci" in out , "load vfio_pci failed"
+            
+            
+            
         elif drivername == "uio_pci_generic":
             self.send_expect("modprobe uio", "#", 70)
             self.send_expect("modprobe uio_pci_generic", "#", 70)
@@ -415,9 +420,13 @@ class DPDKdut(Dut):
 
         current_nic = 0
         for port_info in self.ports_info:
-            if nics_to_bind is None or current_nic in nics_to_bind:
-                binding_list += "%s " % (port_info["pci"])
-            current_nic += 1
+            # if nics_to_bind is None or current_nic in nics_to_bind:
+            #     binding_list += "%s " % (port_info["pci"])
+            if port_info["pci"] not in binding_list:
+                if nics_to_bind is None or current_nic in nics_to_bind:
+                    binding_list += "%s " % (port_info["pci"])
+                current_nic += 1
+            # current_nic += 1
 
         bind_script_path = self.get_dpdk_bind_script()
         return self.send_expect(
-- 
2.34.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [DTS][PATCH V1 09/10] framework/settings: add drivers and NICs for mev
  2023-07-16  9:07 [DTS][PATCH V1 00/10] add functions to test MEV Jin Ling
                   ` (7 preceding siblings ...)
  2023-07-16  9:07 ` [DTS][PATCH V1 08/10] framework/project_dpdk: optimize code Jin Ling
@ 2023-07-16  9:07 ` Jin Ling
  8 siblings, 0 replies; 10+ messages in thread
From: Jin Ling @ 2023-07-16  9:07 UTC (permalink / raw)
  To: dts; +Cc: Jin Ling

Signed-off-by: Jin Ling <jin.ling@intel.com>
---
 framework/settings.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/framework/settings.py b/framework/settings.py
index 1a561dda..b4a912e2 100644
--- a/framework/settings.py
+++ b/framework/settings.py
@@ -98,6 +98,8 @@ NICS = {
     "corigine_4000_pf": "1da8:4000",
     "corigine_6000_pf": "1da8:6000",
     "corigine_6000_vf": "1da8:6003",
+    "mev-idpf": "8086:1452",
+    "mev-cpfl": "8086:1453",
 }
 
 ETH_700_SERIES = (
@@ -193,6 +195,8 @@ DRIVERS = {
     "corigine_4000_pf": "nfp",
     "corigine_6000_pf": "nfp",
     "corigine_6000_vf": "nfp_vf",
+    "mev-idpf":"idpf",
+    "mev-cpfl":"cpfl",
 }
 
 """
@@ -267,7 +271,10 @@ DTS_ERROR_ENV = "DTS_RUNNING_ERROR"
 DTS_CFG_FOLDER = "DTS_CFG_FOLDER"
 DTS_PARALLEL_SETTING = "DTS_PARALLEL_ENABLE"
 UPDATE_EXPECTED = "DTS_UPDATE_EXPECTED_ENABLE"
-
+DPDK_QUEUE_MODEL_SETTING= "DTS_TEST_QUEUE_MODEL"
+DPDK_VPORT_SETTING = "DTS_TEST_VPORT"
+DPDK_RX_VPORT_SETTING = "DTS_TEST_RX_VPORT"
+DPDK_TEST_MEV_SETTING = "DTS_TEST_MEV"
 
 """
 DTS global error table
-- 
2.34.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-07-16  9:08 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-16  9:07 [DTS][PATCH V1 00/10] add functions to test MEV Jin Ling
2023-07-16  9:07 ` [DTS][PATCH V1 01/10] conf/crbs.cfg: add parameters Jin Ling
2023-07-16  9:07 ` [DTS][PATCH V1 02/10] execution.cfg: add parameters to choose datapath and create vport when running test scripts Jin Ling
2023-07-16  9:07 ` [DTS][PATCH V1 03/10] framework/config: save the serial port connection info of imc and acc to the self.crb Jin Ling
2023-07-16  9:07 ` [DTS][PATCH V1 04/10] framework/crb:modify code when pexpect contains '#', replace '#' with 'mev-acc' Jin Ling
2023-07-16  9:07 ` [DTS][PATCH V1 05/10] framework/dts: add global variables Jin Ling
2023-07-16  9:07 ` [DTS][PATCH V1 06/10] framework/dut: add new functions to set up test mev env Jin Ling
2023-07-16  9:07 ` [DTS][PATCH V1 07/10] framework/pmd_output: optimize function start_testpmd Jin Ling
2023-07-16  9:07 ` [DTS][PATCH V1 08/10] framework/project_dpdk: optimize code Jin Ling
2023-07-16  9:07 ` [DTS][PATCH V1 09/10] framework/settings: add drivers and NICs for mev Jin Ling

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).