test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH 1/6] framework: crb :add some parameters and check_Mellanox_pci function to identify mellanox device
@ 2015-10-27  6:07 Raslan Darawsheh
  2015-10-27  6:07 ` [dts] [PATCH 2/6] framework:dut : excluding mellanox NICs from beeing binded Raslan Darawsheh
                   ` (6 more replies)
  0 siblings, 7 replies; 18+ messages in thread
From: Raslan Darawsheh @ 2015-10-27  6:07 UTC (permalink / raw)
  To: dts; +Cc: rdarawsheh

From: Raslsn Darawsheh <rdarawsheh@asaltech.com>

Signed-off-by: Raslsn Darawsheh <rdarawsheh@asaltech.com>
---
 framework/crb.py | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/framework/crb.py b/framework/crb.py
index fcbd7d9..0acec3b 100644
--- a/framework/crb.py
+++ b/framework/crb.py
@@ -33,7 +33,7 @@ import time
 import dts
 import re
 import os
-from settings import TIMEOUT, IXIA
+from settings import TIMEOUT, IXIA, NICS
 
 """
 CRB (customer reference board) basic functions and handlers
@@ -54,6 +54,9 @@ class Crb(object):
         self.skip_setup = False
         self.serializer = serializer
         self.ports_info = None
+        self.isMellanox = False
+        self.mellanoxPortCount = 0
+        self.mellanoxCardType = None
 
     def send_expect(self, cmds, expected, timeout=TIMEOUT,
                     alt_session=False, verify=False):
@@ -79,6 +82,19 @@ class Crb(object):
 
         return self.session.send_command(cmds, timeout)
 
+    def check_Mellanox_pci(self,pci_bus,pci_id):
+        """
+        check if the PCI is Mellanox device or not
+        its used to set a flag to handle Mellanox ports differently
+        """
+        out = self.send_expect("lspci -nn | grep -i "  + pci_bus, "# ")
+        if "Mell" in out:
+            self.isMellanox =True
+            if NICS['ConnectX_4'] in out:
+                self.mellanoxCardType = "cx4"
+            else:
+                self.mellanoxCardType = "cx3"
+
     def get_session_output(self, timeout=TIMEOUT):
         """
         Get session output message before timeout
@@ -196,6 +212,11 @@ class Crb(object):
         rexp = r"([\da-f]{2}:[\da-f]{2}.\d{1}) .*Eth.*?ernet .*?([\da-f]{4}:[\da-f]{4})"
         pattern = re.compile(rexp)
         match = pattern.findall(out)
+        out = self.send_expect(
+                        "lspci -nn ", "# ", alt_session=True)
+        rexp = r"([\da-f]{2}:[\da-f]{2}.\d{1}) Network .*?([\da-f]{4}:[\da-f]{4})"
+        pattern = re.compile(rexp)
+        match += pattern.findall(out)
         self.pci_devices_info = []
         for i in range(len(match)):
             self.pci_devices_info.append((match[i][0], match[i][1]))
-- 
1.8.3.1

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

* [dts] [PATCH 2/6] framework:dut : excluding mellanox NICs from beeing binded
  2015-10-27  6:07 [dts] [PATCH 1/6] framework: crb :add some parameters and check_Mellanox_pci function to identify mellanox device Raslan Darawsheh
@ 2015-10-27  6:07 ` Raslan Darawsheh
  2015-10-27  6:07 ` [dts] [PATCH 3/6] framework:settings :adding new defines for ConnectX_3_Pro and ConnectX_4 and there drivers Raslan Darawsheh
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 18+ messages in thread
From: Raslan Darawsheh @ 2015-10-27  6:07 UTC (permalink / raw)
  To: dts; +Cc: rdarawsheh

From: Raslsn Darawsheh <rdarawsheh@asaltech.com>

Signed-off-by: Raslsn Darawsheh <rdarawsheh@asaltech.com>
---
 framework/dut.py | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

diff --git a/framework/dut.py b/framework/dut.py
index 70bd146..5776270 100644
--- a/framework/dut.py
+++ b/framework/dut.py
@@ -224,7 +224,7 @@ class Dut(Crb):
             pci_id = port['type']
             # get device driver
             driver = settings.get_nic_driver(pci_id)
-            if driver is not None:
+            if driver is not None and self.isMellanox == False:
                 # unbind device driver
                 addr_array = pci_bus.split(':')
                 bus_id = addr_array[0]
@@ -241,7 +241,10 @@ class Dut(Crb):
                 itf = port.get_interface_name()
                 self.send_expect("ifconfig %s up" % itf, "# ")
             else:
-                self.logger.info("NOT FOUND DRIVER FOR PORT (%s|%s)!!!" % (pci_bus, pci_id))
+                if self.isMellanox:
+                    self.logger.info("Mellanox Driver Doesn't support unbinding")
+                else:
+                    self.logger.info("NOT FOUND DRIVER FOR PORT (%s|%s)!!!" % (pci_bus, pci_id))
 
     def setup_memory(self, hugepages=-1):
         """
@@ -334,7 +337,10 @@ class Dut(Crb):
             self.logger.info("Not nic need bind driver: %s" % driver)
             return
 
-        self.send_expect('tools/dpdk_nic_bind.py %s' % binding_list, '# ')
+        if self.isMellanox:
+            pass
+        else:
+            self.send_expect('tools/dpdk_nic_bind.py %s' % binding_list, '# ')
 
     def unbind_interfaces_linux(self, nics_to_bind=None):
         """
@@ -358,7 +364,10 @@ class Dut(Crb):
             self.logger.info("Not nic need unbind driver")
             return
 
-        self.send_expect('tools/dpdk_nic_bind.py %s' % binding_list, '# ', 30)
+        if self.isMellanox:
+            pass
+        else:
+            self.send_expect('tools/dpdk_nic_bind.py %s' % binding_list, '# ', 30)
 
     def get_ports(self, nic_type='any', perf=None, socket=None):
         """
@@ -658,6 +667,9 @@ class Dut(Crb):
             port = NetDevice(self, bus_id, devfun_id)
             numa = port.socket
             # store the port info to port mapping
+            self.check_Mellanox_pci(pci_bus,pci_id)
+            if self.isMellanox and self.mellanoxCardType == "cx3":
+                self.ports_info.append({'port': port,'pci': pci_bus, 'type': pci_id, 'numa': numa})
             self.ports_info.append(
                 {'port': port, 'pci': pci_bus, 'type': pci_id, 'numa': numa})
 
@@ -780,6 +792,8 @@ class Dut(Crb):
                 if key in port_cfg:
                     if key in port and port_cfg[key].lower() != port[key].lower():
                         self.logger.warning("CONFIGURED %s NOT SAME AS SCANNED!!!" % (key.upper()))
+                        if self.isMellanox :
+                            continue
                     port[key] = port_cfg[key].lower()
 
     def map_available_ports(self):
-- 
1.8.3.1

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

* [dts] [PATCH 3/6] framework:settings :adding new defines for ConnectX_3_Pro and ConnectX_4 and there drivers
  2015-10-27  6:07 [dts] [PATCH 1/6] framework: crb :add some parameters and check_Mellanox_pci function to identify mellanox device Raslan Darawsheh
  2015-10-27  6:07 ` [dts] [PATCH 2/6] framework:dut : excluding mellanox NICs from beeing binded Raslan Darawsheh
@ 2015-10-27  6:07 ` Raslan Darawsheh
  2015-10-27  6:07 ` [dts] [PATCH 4/6] framewark:project_dpdk : Enable MLX4 and MLX5 PMD's before compiling and disable binding Raslan Darawsheh
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 18+ messages in thread
From: Raslan Darawsheh @ 2015-10-27  6:07 UTC (permalink / raw)
  To: dts; +Cc: rdarawsheh

From: Raslsn Darawsheh <rdarawsheh@asaltech.com>

Signed-off-by: Raslsn Darawsheh <rdarawsheh@asaltech.com>
---
 framework/settings.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/framework/settings.py b/framework/settings.py
index 6b02e4d..964ee87 100644
--- a/framework/settings.py
+++ b/framework/settings.py
@@ -73,6 +73,8 @@ NICS = {
     'fortville_spirit': '8086:1583',
     'fortville_spirit_single': '8086:1584',
     'redrockcanyou': '8086:15a4',
+    'ConnectX_3_Pro': '15b3:1007',
+    'ConnectX_4' : '15b3:1013',
 }
 
 DRIVERS = {
@@ -103,6 +105,8 @@ DRIVERS = {
     'fortville_spirit': 'i40e',
     'fortville_spirit_single': 'i40e',
     'redrockcanyou': 'fm10k',
+    'ConnectX_3_Pro': 'mlx4',
+    'ConnectX_4': 'mlx5',
 }
 
 """
-- 
1.8.3.1

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

* [dts] [PATCH 4/6] framewark:project_dpdk : Enable MLX4 and MLX5 PMD's before compiling and disable binding
  2015-10-27  6:07 [dts] [PATCH 1/6] framework: crb :add some parameters and check_Mellanox_pci function to identify mellanox device Raslan Darawsheh
  2015-10-27  6:07 ` [dts] [PATCH 2/6] framework:dut : excluding mellanox NICs from beeing binded Raslan Darawsheh
  2015-10-27  6:07 ` [dts] [PATCH 3/6] framework:settings :adding new defines for ConnectX_3_Pro and ConnectX_4 and there drivers Raslan Darawsheh
@ 2015-10-27  6:07 ` Raslan Darawsheh
  2015-10-27  6:07 ` [dts] [PATCH 5/6] framework:net_device : adding function get_interface_name_Mellanox to get the ConnectX_3_Pro interfaces Raslan Darawsheh
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 18+ messages in thread
From: Raslan Darawsheh @ 2015-10-27  6:07 UTC (permalink / raw)
  To: dts; +Cc: rdarawsheh

From: Raslsn Darawsheh <rdarawsheh@asaltech.com>

Signed-off-by: Raslsn Darawsheh <rdarawsheh@asaltech.com>
---
 framework/project_dpdk.py | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/framework/project_dpdk.py b/framework/project_dpdk.py
index e0009d3..a51a2a4 100644
--- a/framework/project_dpdk.py
+++ b/framework/project_dpdk.py
@@ -160,6 +160,11 @@ class DPDKdut(Dut):
         """
         # clean all
         self.send_expect("rm -rf " + target, "#")
+        # if Configured device is a Mellanox then need to enable MLX4 PMD
+        if self.isMellanox and self.mellanoxCardType == "cx3" :
+            self.send_expect("sed -i '/CONFIG_RTE_LIBRTE_MLX4_PMD=n/c\CONFIG_RTE_LIBRTE_MLX4_PMD=y' config/common_linuxapp" ,"#")
+        elif self.isMellanox and self.mellanoxCardType == "cx4" :
+            self.send_expect("sed -i '/CONFIG_RTE_LIBRTE_MLX5_PMD=n/c\CONFIG_RTE_LIBRTE_MLX5_PMD=y' config/common_linuxapp","#")
 
         # compile
         out = self.send_expect("make -j install T=%s %s" % (target, extra_options), "# ", 120)
@@ -269,7 +274,10 @@ class DPDKdut(Dut):
                 binding_list += '%s ' % (port_info['pci'])
             current_nic += 1
 
-        self.send_expect('tools/dpdk_nic_bind.py %s' % binding_list, '# ')
+        if self.isMellanox:
+            pass
+        else:
+            self.send_expect('tools/dpdk_nic_bind.py %s' % binding_list, '# ')
 
     def unbind_interfaces_linux(self, nics_to_bind=None):
         """
@@ -284,7 +292,10 @@ class DPDKdut(Dut):
                 binding_list += '%s ' % (port_info['pci'])
             current_nic += 1
 
-        self.send_expect('tools/dpdk_nic_bind.py %s' % binding_list, '# ', 30)
+        if self.isMellanox:
+            pass
+        else:
+            self.send_expect('tools/dpdk_nic_bind.py %s' % binding_list, '# ', 30)
 
     def build_dpdk_apps(self, folder, extra_options=''):
         """
-- 
1.8.3.1

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

* [dts] [PATCH 5/6] framework:net_device : adding function get_interface_name_Mellanox to get the ConnectX_3_Pro interfaces
  2015-10-27  6:07 [dts] [PATCH 1/6] framework: crb :add some parameters and check_Mellanox_pci function to identify mellanox device Raslan Darawsheh
                   ` (2 preceding siblings ...)
  2015-10-27  6:07 ` [dts] [PATCH 4/6] framewark:project_dpdk : Enable MLX4 and MLX5 PMD's before compiling and disable binding Raslan Darawsheh
@ 2015-10-27  6:07 ` Raslan Darawsheh
  2015-10-27  6:07 ` [dts] [PATCH 6/6] framework:tester: adding ConnectX_3_Pro second port to the list of ports Raslan Darawsheh
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 18+ messages in thread
From: Raslan Darawsheh @ 2015-10-27  6:07 UTC (permalink / raw)
  To: dts; +Cc: rdarawsheh

From: Raslsn Darawsheh <rdarawsheh@asaltech.com>

Signed-off-by: Raslsn Darawsheh <rdarawsheh@asaltech.com>
---
 framework/net_device.py | 39 ++++++++++++++++++++++++++++++++-------
 1 file changed, 32 insertions(+), 7 deletions(-)

diff --git a/framework/net_device.py b/framework/net_device.py
index 37495bd..ac121cc 100644
--- a/framework/net_device.py
+++ b/framework/net_device.py
@@ -127,17 +127,42 @@ class NetDevice(object):
         Get interface name of specified pci device.
         Cal this function will update intf_name everytime
         """
-        get_interface_name = getattr(
-            self, 'get_interface_name_%s' %
-            self.__get_os_type())
-        out = get_interface_name(self.bus_id, self.devfun_id, self.current_driver)
-        if "No such file or directory" in out:
-            self.intf_name = 'N/A'
+        if self.crb.isMellanox and self.crb.mellanoxCardType == "cx3":
+            self.intf_name = self.get_interface_name_Mellanox(self.bus_id,self.devfun_id)
         else:
-            self.intf_name = out
+            get_interface_name = getattr(
+                self, 'get_interface_name_%s' %
+                self.__get_os_type())
+            out = get_interface_name(self.bus_id, self.devfun_id, self.current_driver)
+            if "No such file or directory" in out:
+                self.intf_name = 'N/A'
+            else:
+                self.intf_name = out
 
         return self.intf_name
 
+    def get_interface_name_Mellanox(self,bus_id,devfun_id):
+        """
+        Get interface name of specified pci device for Mellanox.
+        """
+        command = 'ls --color=never /sys/bus/pci/devices/0000:%s:%s/net' % (bus_id, devfun_id)
+        out = self.crb.send_expect(command, '# ', verify=True)
+
+        if out == -1:
+            name = ""
+        else:
+            if self.crb.mellanoxPortCount == 0 :
+                name = out.split()[0]
+                self.crb.mellanoxPortCount = 1
+            else :
+                if len(out.split()) < 2 :
+                    self.crb.isMellanox = False
+                    name = out.split()[0]
+                    return name
+                name = out.split()[1]
+                self.crb.mellanoxPortCount = 0
+        return name
+
     def get_interface_name_linux(self, bus_id, devfun_id, driver):
         """
         Get interface name of specified pci device on linux.
-- 
1.8.3.1

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

* [dts] [PATCH 6/6] framework:tester: adding ConnectX_3_Pro second port to the list of ports
  2015-10-27  6:07 [dts] [PATCH 1/6] framework: crb :add some parameters and check_Mellanox_pci function to identify mellanox device Raslan Darawsheh
                   ` (3 preceding siblings ...)
  2015-10-27  6:07 ` [dts] [PATCH 5/6] framework:net_device : adding function get_interface_name_Mellanox to get the ConnectX_3_Pro interfaces Raslan Darawsheh
@ 2015-10-27  6:07 ` Raslan Darawsheh
  2015-10-27  6:07 ` [dts] [PATCH] fix queue start/stop case failed Raslan Darawsheh
  2015-10-29  2:00 ` [dts] [PATCH 1/6] framework: crb :add some parameters and check_Mellanox_pci function to identify mellanox device Xu, HuilongX
  6 siblings, 0 replies; 18+ messages in thread
From: Raslan Darawsheh @ 2015-10-27  6:07 UTC (permalink / raw)
  To: dts; +Cc: rdarawsheh

From: Raslsn Darawsheh <rdarawsheh@asaltech.com>

Signed-off-by: Raslsn Darawsheh <rdarawsheh@asaltech.com>
---
 framework/tester.py | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/framework/tester.py b/framework/tester.py
index de0bc24..cfab247 100644
--- a/framework/tester.py
+++ b/framework/tester.py
@@ -211,6 +211,7 @@ class Tester(Crb):
         try:
             for (pci_bus, pci_id) in self.pci_devices_info:
                 addr_array = pci_bus.split(':')
+                self.check_Mellanox_pci(pci_bus,pci_id)
                 port = NetDevice(self, addr_array[0], addr_array[1])
                 itf = port.get_interface_name()
                 self.enable_ipv6(itf)
@@ -309,6 +310,17 @@ class Tester(Crb):
                                     'intf': intf,
                                     'mac': macaddr,
                                     'ipv6': ipv6})
+            self.check_Mellanox_pci(pci_bus,pci_id)
+            if self.isMellanox and self.mellanoxCardType == "cx3" :
+                intf1 = port.get_interface_name()
+                macaddr1 = port.get_mac_addr()
+                ipv6_port2 = port.get_ipv6_addr()
+                self.ports_info.append({'port': port,
+                                        'pci': pci_bus,
+                                        'type': pci_id,
+                                        'intf': intf1,
+                                        'mac': macaddr1,
+                                        'ipv6': ipv6_port2})
 
     def send_ping6(self, localPort, ipv6, mac):
         """
-- 
1.8.3.1

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

* [dts] [PATCH] fix queue start/stop case failed
  2015-10-27  6:07 [dts] [PATCH 1/6] framework: crb :add some parameters and check_Mellanox_pci function to identify mellanox device Raslan Darawsheh
                   ` (4 preceding siblings ...)
  2015-10-27  6:07 ` [dts] [PATCH 6/6] framework:tester: adding ConnectX_3_Pro second port to the list of ports Raslan Darawsheh
@ 2015-10-27  6:07 ` Raslan Darawsheh
  2015-10-29  2:00 ` [dts] [PATCH 1/6] framework: crb :add some parameters and check_Mellanox_pci function to identify mellanox device Xu, HuilongX
  6 siblings, 0 replies; 18+ messages in thread
From: Raslan Darawsheh @ 2015-10-27  6:07 UTC (permalink / raw)
  To: dts; +Cc: rdarawsheh

From: "xu,huilong" <huilongx.xu@intel.com>

sometime print can't get  received package info, used self.dut.get_session_output() replace
 self.dut.send_expect("\n", "testpmd>") get received package info

Signed-off-by: xu,huilong <huilongx.xu@intel.com>
---
 tests/TestSuite_queue_start_stop.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/TestSuite_queue_start_stop.py b/tests/TestSuite_queue_start_stop.py
index 83504ab..f59333c 100644
--- a/tests/TestSuite_queue_start_stop.py
+++ b/tests/TestSuite_queue_start_stop.py
@@ -164,7 +164,7 @@ class TestQueueStartStop(TestCase):
             self.dut.send_expect("port 1 txq 0 stop", "testpmd>")
             self.dut.send_expect("start", "testpmd>")
             self.check_forwarding([0, 1], self.nic, received=False)
-            out = self.dut.send_expect("\n", "testpmd>")
+            out = self.dut.get_session_output()
         except Exception, e:
             raise IOError("queue start/stop forward failure: %s" % e)
 
-- 
1.9.1

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

* Re: [dts] [PATCH 1/6] framework: crb :add some parameters and check_Mellanox_pci function to identify mellanox device
  2015-10-27  6:07 [dts] [PATCH 1/6] framework: crb :add some parameters and check_Mellanox_pci function to identify mellanox device Raslan Darawsheh
                   ` (5 preceding siblings ...)
  2015-10-27  6:07 ` [dts] [PATCH] fix queue start/stop case failed Raslan Darawsheh
@ 2015-10-29  2:00 ` Xu, HuilongX
  2015-10-29  8:04   ` Raslan Darawsheh
  6 siblings, 1 reply; 18+ messages in thread
From: Xu, HuilongX @ 2015-10-29  2:00 UTC (permalink / raw)
  To: Raslan Darawsheh, dts; +Cc: rdarawsheh


Hi darawsheh,
Pls see my comments as below., thanks  a lot
> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Raslan Darawsheh
> Sent: Tuesday, October 27, 2015 2:08 PM
> To: dts@dpdk.org
> Cc: rdarawsheh@asaltech.com
> Subject: [dts] [PATCH 1/6] framework: crb :add some parameters and
> check_Mellanox_pci function to identify mellanox device
> 
> From: Raslsn Darawsheh <rdarawsheh@asaltech.com>
> 
> Signed-off-by: Raslsn Darawsheh <rdarawsheh@asaltech.com>
> ---
>  framework/crb.py | 23 ++++++++++++++++++++++-
>  1 file changed, 22 insertions(+), 1 deletion(-)
> 
> diff --git a/framework/crb.py b/framework/crb.py
> index fcbd7d9..0acec3b 100644
> --- a/framework/crb.py
> +++ b/framework/crb.py
> @@ -33,7 +33,7 @@ import time
>  import dts
>  import re
>  import os
> -from settings import TIMEOUT, IXIA
> +from settings import TIMEOUT, IXIA, NICS
> 
>  """
>  CRB (customer reference board) basic functions and handlers
> @@ -54,6 +54,9 @@ class Crb(object):
>          self.skip_setup = False
>          self.serializer = serializer
>          self.ports_info = None
> +        self.isMellanox = False
> +        self.mellanoxPortCount = 0
> +        self.mellanoxCardType = None
> 
>      def send_expect(self, cmds, expected, timeout=TIMEOUT,
>                      alt_session=False, verify=False):
> @@ -79,6 +82,19 @@ class Crb(object):
> 
>          return self.session.send_command(cmds, timeout)
> 
> +    def check_Mellanox_pci(self,pci_bus,pci_id):
> +        """
> +        check if the PCI is Mellanox device or not
> +        its used to set a flag to handle Mellanox ports differently
> +        """
> +        out = self.send_expect("lspci -nn | grep -i "  + pci_bus, "# ")
> +        if "Mell" in out:
> +            self.isMellanox =True
> +            if NICS['ConnectX_4'] in out:
> +                self.mellanoxCardType = "cx4"
> +            else:
> +                self.mellanoxCardType = "cx3"
> +
>      def get_session_output(self, timeout=TIMEOUT):
>          """
>          Get session output message before timeout
> @@ -196,6 +212,11 @@ class Crb(object):
>          rexp = r"([\da-f]{2}:[\da-f]{2}.\d{1}) .*Eth.*?ernet .*?([\da-
> f]{4}:[\da-f]{4})"
>          pattern = re.compile(rexp)
>          match = pattern.findall(out)
Could you not changed this function? because it not about dts feature
It only a ssh session function, when you exec "lspci" command, freebsd os not support.
So some  case will failed on freebesd.
> +        out = self.send_expect(
> +                        "lspci -nn ", "# ", alt_session=True)
> +        rexp = r"([\da-f]{2}:[\da-f]{2}.\d{1}) Network .*?([\da-
> f]{4}:[\da-f]{4})"
> +        pattern = re.compile(rexp)
> +        match += pattern.findall(out)
>          self.pci_devices_info = []
>          for i in range(len(match)):
>              self.pci_devices_info.append((match[i][0], match[i][1]))
> --
> 1.8.3.1

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

* Re: [dts] [PATCH 1/6] framework: crb :add some parameters and check_Mellanox_pci function to identify mellanox device
  2015-10-29  2:00 ` [dts] [PATCH 1/6] framework: crb :add some parameters and check_Mellanox_pci function to identify mellanox device Xu, HuilongX
@ 2015-10-29  8:04   ` Raslan Darawsheh
  2015-10-29  8:48     ` Xu, HuilongX
  0 siblings, 1 reply; 18+ messages in thread
From: Raslan Darawsheh @ 2015-10-29  8:04 UTC (permalink / raw)
  To: Xu, HuilongX, dts; +Cc: rdarawsheh

Hi Xu, HuilongX ,

>From what I changed it seems that it's only executed over the linux OS. And there are an already "lspci" command executed inside the function. 
Can you explain more ?
Kindest regards 
Raslan Darawsheh

-----Original Message-----
From: Xu, HuilongX [mailto:huilongx.xu@intel.com] 
Sent: Thursday, October 29, 2015 4:01 AM
To: Raslan Darawsheh <rasland@mellanox.com>; dts@dpdk.org
Cc: rdarawsheh@asaltech.com
Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters and check_Mellanox_pci function to identify mellanox device


Hi darawsheh,
Pls see my comments as below., thanks  a lot
> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Raslan Darawsheh
> Sent: Tuesday, October 27, 2015 2:08 PM
> To: dts@dpdk.org
> Cc: rdarawsheh@asaltech.com
> Subject: [dts] [PATCH 1/6] framework: crb :add some parameters and 
> check_Mellanox_pci function to identify mellanox device
> 
> From: Raslsn Darawsheh <rdarawsheh@asaltech.com>
> 
> Signed-off-by: Raslsn Darawsheh <rdarawsheh@asaltech.com>
> ---
>  framework/crb.py | 23 ++++++++++++++++++++++-
>  1 file changed, 22 insertions(+), 1 deletion(-)
> 
> diff --git a/framework/crb.py b/framework/crb.py index 
> fcbd7d9..0acec3b 100644
> --- a/framework/crb.py
> +++ b/framework/crb.py
> @@ -33,7 +33,7 @@ import time
>  import dts
>  import re
>  import os
> -from settings import TIMEOUT, IXIA
> +from settings import TIMEOUT, IXIA, NICS
> 
>  """
>  CRB (customer reference board) basic functions and handlers @@ -54,6 
> +54,9 @@ class Crb(object):
>          self.skip_setup = False
>          self.serializer = serializer
>          self.ports_info = None
> +        self.isMellanox = False
> +        self.mellanoxPortCount = 0
> +        self.mellanoxCardType = None
> 
>      def send_expect(self, cmds, expected, timeout=TIMEOUT,
>                      alt_session=False, verify=False):
> @@ -79,6 +82,19 @@ class Crb(object):
> 
>          return self.session.send_command(cmds, timeout)
> 
> +    def check_Mellanox_pci(self,pci_bus,pci_id):
> +        """
> +        check if the PCI is Mellanox device or not
> +        its used to set a flag to handle Mellanox ports differently
> +        """
> +        out = self.send_expect("lspci -nn | grep -i "  + pci_bus, "# ")
> +        if "Mell" in out:
> +            self.isMellanox =True
> +            if NICS['ConnectX_4'] in out:
> +                self.mellanoxCardType = "cx4"
> +            else:
> +                self.mellanoxCardType = "cx3"
> +
>      def get_session_output(self, timeout=TIMEOUT):
>          """
>          Get session output message before timeout @@ -196,6 +212,11 
> @@ class Crb(object):
>          rexp = r"([\da-f]{2}:[\da-f]{2}.\d{1}) .*Eth.*?ernet 
> .*?([\da- f]{4}:[\da-f]{4})"
>          pattern = re.compile(rexp)
>          match = pattern.findall(out)
Could you not changed this function? because it not about dts feature It only a ssh session function, when you exec "lspci" command, freebsd os not support.
So some  case will failed on freebesd.
> +        out = self.send_expect(
> +                        "lspci -nn ", "# ", alt_session=True)
> +        rexp = r"([\da-f]{2}:[\da-f]{2}.\d{1}) Network .*?([\da-
> f]{4}:[\da-f]{4})"
> +        pattern = re.compile(rexp)
> +        match += pattern.findall(out)
>          self.pci_devices_info = []
>          for i in range(len(match)):
>              self.pci_devices_info.append((match[i][0], match[i][1]))
> --
> 1.8.3.1

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

* Re: [dts] [PATCH 1/6] framework: crb :add some parameters and check_Mellanox_pci function to identify mellanox device
  2015-10-29  8:04   ` Raslan Darawsheh
@ 2015-10-29  8:48     ` Xu, HuilongX
  2015-10-29  9:58       ` Raslan Darawsheh
  0 siblings, 1 reply; 18+ messages in thread
From: Xu, HuilongX @ 2015-10-29  8:48 UTC (permalink / raw)
  To: Raslan Darawsheh, dts; +Cc: rdarawsheh

Hi Darawsheh,
Your changed can't work on FreeBSD OS, but function "get_session_output" in crb.py need work on FreeBSD os.
Thanks a lot

> -----Original Message-----
> From: Raslan Darawsheh [mailto:rasland@mellanox.com]
> Sent: Thursday, October 29, 2015 4:05 PM
> To: Xu, HuilongX; dts@dpdk.org
> Cc: rdarawsheh@asaltech.com
> Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters and
> check_Mellanox_pci function to identify mellanox device
> 
> Hi Xu, HuilongX ,
> 
> From what I changed it seems that it's only executed over the linux OS.
> And there are an already "lspci" command executed inside the function.
> Can you explain more ?
> Kindest regards
> Raslan Darawsheh
> 
> -----Original Message-----
> From: Xu, HuilongX [mailto:huilongx.xu@intel.com]
> Sent: Thursday, October 29, 2015 4:01 AM
> To: Raslan Darawsheh <rasland@mellanox.com>; dts@dpdk.org
> Cc: rdarawsheh@asaltech.com
> Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters and
> check_Mellanox_pci function to identify mellanox device
> 
> 
> Hi darawsheh,
> Pls see my comments as below., thanks  a lot
> > -----Original Message-----
> > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Raslan Darawsheh
> > Sent: Tuesday, October 27, 2015 2:08 PM
> > To: dts@dpdk.org
> > Cc: rdarawsheh@asaltech.com
> > Subject: [dts] [PATCH 1/6] framework: crb :add some parameters and
> > check_Mellanox_pci function to identify mellanox device
> >
> > From: Raslsn Darawsheh <rdarawsheh@asaltech.com>
> >
> > Signed-off-by: Raslsn Darawsheh <rdarawsheh@asaltech.com>
> > ---
> >  framework/crb.py | 23 ++++++++++++++++++++++-
> >  1 file changed, 22 insertions(+), 1 deletion(-)
> >
> > diff --git a/framework/crb.py b/framework/crb.py index
> > fcbd7d9..0acec3b 100644
> > --- a/framework/crb.py
> > +++ b/framework/crb.py
> > @@ -33,7 +33,7 @@ import time
> >  import dts
> >  import re
> >  import os
> > -from settings import TIMEOUT, IXIA
> > +from settings import TIMEOUT, IXIA, NICS
> >
> >  """
> >  CRB (customer reference board) basic functions and handlers @@ -54,6
> > +54,9 @@ class Crb(object):
> >          self.skip_setup = False
> >          self.serializer = serializer
> >          self.ports_info = None
> > +        self.isMellanox = False
> > +        self.mellanoxPortCount = 0
> > +        self.mellanoxCardType = None
> >
> >      def send_expect(self, cmds, expected, timeout=TIMEOUT,
> >                      alt_session=False, verify=False):
> > @@ -79,6 +82,19 @@ class Crb(object):
> >
> >          return self.session.send_command(cmds, timeout)
> >
> > +    def check_Mellanox_pci(self,pci_bus,pci_id):
> > +        """
> > +        check if the PCI is Mellanox device or not
> > +        its used to set a flag to handle Mellanox ports differently
> > +        """
> > +        out = self.send_expect("lspci -nn | grep -i "  + pci_bus, "# ")
> > +        if "Mell" in out:
> > +            self.isMellanox =True
> > +            if NICS['ConnectX_4'] in out:
> > +                self.mellanoxCardType = "cx4"
> > +            else:
> > +                self.mellanoxCardType = "cx3"
> > +
> >      def get_session_output(self, timeout=TIMEOUT):
> >          """
> >          Get session output message before timeout @@ -196,6 +212,11
> > @@ class Crb(object):
> >          rexp = r"([\da-f]{2}:[\da-f]{2}.\d{1}) .*Eth.*?ernet
> > .*?([\da- f]{4}:[\da-f]{4})"
> >          pattern = re.compile(rexp)
> >          match = pattern.findall(out)
> Could you not changed this function? because it not about dts feature It
> only a ssh session function, when you exec "lspci" command, freebsd os not
> support.
> So some  case will failed on freebesd.
> > +        out = self.send_expect(
> > +                        "lspci -nn ", "# ", alt_session=True)
> > +        rexp = r"([\da-f]{2}:[\da-f]{2}.\d{1}) Network .*?([\da-
> > f]{4}:[\da-f]{4})"
> > +        pattern = re.compile(rexp)
> > +        match += pattern.findall(out)
> >          self.pci_devices_info = []
> >          for i in range(len(match)):
> >              self.pci_devices_info.append((match[i][0], match[i][1]))
> > --
> > 1.8.3.1

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

* Re: [dts] [PATCH 1/6] framework: crb :add some parameters and check_Mellanox_pci function to identify mellanox device
  2015-10-29  8:48     ` Xu, HuilongX
@ 2015-10-29  9:58       ` Raslan Darawsheh
  2015-10-29 10:10         ` Xu, HuilongX
  0 siblings, 1 reply; 18+ messages in thread
From: Raslan Darawsheh @ 2015-10-29  9:58 UTC (permalink / raw)
  To: Xu, HuilongX, dts; +Cc: rdarawsheh

Hi Xu, HuilongX,

I think you need to double check the patch, since in this patch it doesn't change anything to this function. 

Kindest regards 
Raslan Darawsheh

-----Original Message-----
From: Xu, HuilongX [mailto:huilongx.xu@intel.com] 
Sent: Thursday, October 29, 2015 10:48 AM
To: Raslan Darawsheh <rasland@mellanox.com>; dts@dpdk.org
Cc: rdarawsheh@asaltech.com
Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters and check_Mellanox_pci function to identify mellanox device

Hi Darawsheh,
Your changed can't work on FreeBSD OS, but function "get_session_output" in crb.py need work on FreeBSD os.
Thanks a lot

> -----Original Message-----
> From: Raslan Darawsheh [mailto:rasland@mellanox.com]
> Sent: Thursday, October 29, 2015 4:05 PM
> To: Xu, HuilongX; dts@dpdk.org
> Cc: rdarawsheh@asaltech.com
> Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters and 
> check_Mellanox_pci function to identify mellanox device
> 
> Hi Xu, HuilongX ,
> 
> From what I changed it seems that it's only executed over the linux OS.
> And there are an already "lspci" command executed inside the function.
> Can you explain more ?
> Kindest regards
> Raslan Darawsheh
> 
> -----Original Message-----
> From: Xu, HuilongX [mailto:huilongx.xu@intel.com]
> Sent: Thursday, October 29, 2015 4:01 AM
> To: Raslan Darawsheh <rasland@mellanox.com>; dts@dpdk.org
> Cc: rdarawsheh@asaltech.com
> Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters and 
> check_Mellanox_pci function to identify mellanox device
> 
> 
> Hi darawsheh,
> Pls see my comments as below., thanks  a lot
> > -----Original Message-----
> > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Raslan 
> > Darawsheh
> > Sent: Tuesday, October 27, 2015 2:08 PM
> > To: dts@dpdk.org
> > Cc: rdarawsheh@asaltech.com
> > Subject: [dts] [PATCH 1/6] framework: crb :add some parameters and 
> > check_Mellanox_pci function to identify mellanox device
> >
> > From: Raslsn Darawsheh <rdarawsheh@asaltech.com>
> >
> > Signed-off-by: Raslsn Darawsheh <rdarawsheh@asaltech.com>
> > ---
> >  framework/crb.py | 23 ++++++++++++++++++++++-
> >  1 file changed, 22 insertions(+), 1 deletion(-)
> >
> > diff --git a/framework/crb.py b/framework/crb.py index 
> > fcbd7d9..0acec3b 100644
> > --- a/framework/crb.py
> > +++ b/framework/crb.py
> > @@ -33,7 +33,7 @@ import time
> >  import dts
> >  import re
> >  import os
> > -from settings import TIMEOUT, IXIA
> > +from settings import TIMEOUT, IXIA, NICS
> >
> >  """
> >  CRB (customer reference board) basic functions and handlers @@ 
> > -54,6
> > +54,9 @@ class Crb(object):
> >          self.skip_setup = False
> >          self.serializer = serializer
> >          self.ports_info = None
> > +        self.isMellanox = False
> > +        self.mellanoxPortCount = 0
> > +        self.mellanoxCardType = None
> >
> >      def send_expect(self, cmds, expected, timeout=TIMEOUT,
> >                      alt_session=False, verify=False):
> > @@ -79,6 +82,19 @@ class Crb(object):
> >
> >          return self.session.send_command(cmds, timeout)
> >
> > +    def check_Mellanox_pci(self,pci_bus,pci_id):
> > +        """
> > +        check if the PCI is Mellanox device or not
> > +        its used to set a flag to handle Mellanox ports differently
> > +        """
> > +        out = self.send_expect("lspci -nn | grep -i "  + pci_bus, "# ")
> > +        if "Mell" in out:
> > +            self.isMellanox =True
> > +            if NICS['ConnectX_4'] in out:
> > +                self.mellanoxCardType = "cx4"
> > +            else:
> > +                self.mellanoxCardType = "cx3"
> > +
> >      def get_session_output(self, timeout=TIMEOUT):
> >          """
> >          Get session output message before timeout @@ -196,6 +212,11 
> > @@ class Crb(object):
> >          rexp = r"([\da-f]{2}:[\da-f]{2}.\d{1}) .*Eth.*?ernet
> > .*?([\da- f]{4}:[\da-f]{4})"
> >          pattern = re.compile(rexp)
> >          match = pattern.findall(out)
> Could you not changed this function? because it not about dts feature 
> It only a ssh session function, when you exec "lspci" command, freebsd 
> os not support.
> So some  case will failed on freebesd.
> > +        out = self.send_expect(
> > +                        "lspci -nn ", "# ", alt_session=True)
> > +        rexp = r"([\da-f]{2}:[\da-f]{2}.\d{1}) Network .*?([\da-
> > f]{4}:[\da-f]{4})"
> > +        pattern = re.compile(rexp)
> > +        match += pattern.findall(out)
> >          self.pci_devices_info = []
> >          for i in range(len(match)):
> >              self.pci_devices_info.append((match[i][0], 
> > match[i][1]))
> > --
> > 1.8.3.1

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

* Re: [dts] [PATCH 1/6] framework: crb :add some parameters and check_Mellanox_pci function to identify mellanox device
  2015-10-29  9:58       ` Raslan Darawsheh
@ 2015-10-29 10:10         ` Xu, HuilongX
  2015-11-10  6:32           ` Raslan Darawsheh
  0 siblings, 1 reply; 18+ messages in thread
From: Xu, HuilongX @ 2015-10-29 10:10 UTC (permalink / raw)
  To: Raslan Darawsheh, dts; +Cc: rdarawsheh

Hi Darawsheh,
I am very sorry, I am too careless.
Your changed in function " pci_devices_information_uncached_linux", so it's no problem 
Thanks a lot
> -----Original Message-----
> From: Raslan Darawsheh [mailto:rasland@mellanox.com]
> Sent: Thursday, October 29, 2015 5:58 PM
> To: Xu, HuilongX; dts@dpdk.org
> Cc: rdarawsheh@asaltech.com
> Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters and
> check_Mellanox_pci function to identify mellanox device
> 
> Hi Xu, HuilongX,
> 
> I think you need to double check the patch, since in this patch it doesn't
> change anything to this function.
> 
> Kindest regards
> Raslan Darawsheh
> 
> -----Original Message-----
> From: Xu, HuilongX [mailto:huilongx.xu@intel.com]
> Sent: Thursday, October 29, 2015 10:48 AM
> To: Raslan Darawsheh <rasland@mellanox.com>; dts@dpdk.org
> Cc: rdarawsheh@asaltech.com
> Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters and
> check_Mellanox_pci function to identify mellanox device
> 
> Hi Darawsheh,
> Your changed can't work on FreeBSD OS, but function "get_session_output"
> in crb.py need work on FreeBSD os.
> Thanks a lot
> 
> > -----Original Message-----
> > From: Raslan Darawsheh [mailto:rasland@mellanox.com]
> > Sent: Thursday, October 29, 2015 4:05 PM
> > To: Xu, HuilongX; dts@dpdk.org
> > Cc: rdarawsheh@asaltech.com
> > Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters and
> > check_Mellanox_pci function to identify mellanox device
> >
> > Hi Xu, HuilongX ,
> >
> > From what I changed it seems that it's only executed over the linux OS.
> > And there are an already "lspci" command executed inside the function.
> > Can you explain more ?
> > Kindest regards
> > Raslan Darawsheh
> >
> > -----Original Message-----
> > From: Xu, HuilongX [mailto:huilongx.xu@intel.com]
> > Sent: Thursday, October 29, 2015 4:01 AM
> > To: Raslan Darawsheh <rasland@mellanox.com>; dts@dpdk.org
> > Cc: rdarawsheh@asaltech.com
> > Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters and
> > check_Mellanox_pci function to identify mellanox device
> >
> >
> > Hi darawsheh,
> > Pls see my comments as below., thanks  a lot
> > > -----Original Message-----
> > > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Raslan
> > > Darawsheh
> > > Sent: Tuesday, October 27, 2015 2:08 PM
> > > To: dts@dpdk.org
> > > Cc: rdarawsheh@asaltech.com
> > > Subject: [dts] [PATCH 1/6] framework: crb :add some parameters and
> > > check_Mellanox_pci function to identify mellanox device
> > >
> > > From: Raslsn Darawsheh <rdarawsheh@asaltech.com>
> > >
> > > Signed-off-by: Raslsn Darawsheh <rdarawsheh@asaltech.com>
> > > ---
> > >  framework/crb.py | 23 ++++++++++++++++++++++-
> > >  1 file changed, 22 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/framework/crb.py b/framework/crb.py index
> > > fcbd7d9..0acec3b 100644
> > > --- a/framework/crb.py
> > > +++ b/framework/crb.py
> > > @@ -33,7 +33,7 @@ import time
> > >  import dts
> > >  import re
> > >  import os
> > > -from settings import TIMEOUT, IXIA
> > > +from settings import TIMEOUT, IXIA, NICS
> > >
> > >  """
> > >  CRB (customer reference board) basic functions and handlers @@
> > > -54,6
> > > +54,9 @@ class Crb(object):
> > >          self.skip_setup = False
> > >          self.serializer = serializer
> > >          self.ports_info = None
> > > +        self.isMellanox = False
> > > +        self.mellanoxPortCount = 0
> > > +        self.mellanoxCardType = None
> > >
> > >      def send_expect(self, cmds, expected, timeout=TIMEOUT,
> > >                      alt_session=False, verify=False):
> > > @@ -79,6 +82,19 @@ class Crb(object):
> > >
> > >          return self.session.send_command(cmds, timeout)
> > >
> > > +    def check_Mellanox_pci(self,pci_bus,pci_id):
> > > +        """
> > > +        check if the PCI is Mellanox device or not
> > > +        its used to set a flag to handle Mellanox ports differently
> > > +        """
> > > +        out = self.send_expect("lspci -nn | grep -i "  + pci_bus, "#
> ")
> > > +        if "Mell" in out:
> > > +            self.isMellanox =True
> > > +            if NICS['ConnectX_4'] in out:
> > > +                self.mellanoxCardType = "cx4"
> > > +            else:
> > > +                self.mellanoxCardType = "cx3"
> > > +
> > >      def get_session_output(self, timeout=TIMEOUT):
> > >          """
> > >          Get session output message before timeout @@ -196,6 +212,11
> > > @@ class Crb(object):
> > >          rexp = r"([\da-f]{2}:[\da-f]{2}.\d{1}) .*Eth.*?ernet
> > > .*?([\da- f]{4}:[\da-f]{4})"
> > >          pattern = re.compile(rexp)
> > >          match = pattern.findall(out)
> > Could you not changed this function? because it not about dts feature
> > It only a ssh session function, when you exec "lspci" command, freebsd
> > os not support.
> > So some  case will failed on freebesd.
> > > +        out = self.send_expect(
> > > +                        "lspci -nn ", "# ", alt_session=True)
> > > +        rexp = r"([\da-f]{2}:[\da-f]{2}.\d{1}) Network .*?([\da-
> > > f]{4}:[\da-f]{4})"
> > > +        pattern = re.compile(rexp)
> > > +        match += pattern.findall(out)
> > >          self.pci_devices_info = []
> > >          for i in range(len(match)):
> > >              self.pci_devices_info.append((match[i][0],
> > > match[i][1]))
> > > --
> > > 1.8.3.1

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

* Re: [dts] [PATCH 1/6] framework: crb :add some parameters and check_Mellanox_pci function to identify mellanox device
  2015-10-29 10:10         ` Xu, HuilongX
@ 2015-11-10  6:32           ` Raslan Darawsheh
  2015-11-10  8:12             ` Liu, Yong
  2016-01-18 11:18             ` Raslan Darawsheh
  0 siblings, 2 replies; 18+ messages in thread
From: Raslan Darawsheh @ 2015-11-10  6:32 UTC (permalink / raw)
  To: Xu, HuilongX, dts; +Cc: rdarawsheh

Hi  Xu, HuilongX , 

When do you think you will apply the patches? 

Kindest regards 
Raslan Darawsheh


-----Original Message-----
From: Xu, HuilongX [mailto:huilongx.xu@intel.com] 
Sent: Thursday, October 29, 2015 12:10 PM
To: Raslan Darawsheh; dts@dpdk.org
Cc: rdarawsheh@asaltech.com
Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters and check_Mellanox_pci function to identify mellanox device

Hi Darawsheh,
I am very sorry, I am too careless.
Your changed in function " pci_devices_information_uncached_linux", so it's no problem Thanks a lot
> -----Original Message-----
> From: Raslan Darawsheh [mailto:rasland@mellanox.com]
> Sent: Thursday, October 29, 2015 5:58 PM
> To: Xu, HuilongX; dts@dpdk.org
> Cc: rdarawsheh@asaltech.com
> Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters and 
> check_Mellanox_pci function to identify mellanox device
> 
> Hi Xu, HuilongX,
> 
> I think you need to double check the patch, since in this patch it 
> doesn't change anything to this function.
> 
> Kindest regards
> Raslan Darawsheh
> 
> -----Original Message-----
> From: Xu, HuilongX [mailto:huilongx.xu@intel.com]
> Sent: Thursday, October 29, 2015 10:48 AM
> To: Raslan Darawsheh <rasland@mellanox.com>; dts@dpdk.org
> Cc: rdarawsheh@asaltech.com
> Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters and 
> check_Mellanox_pci function to identify mellanox device
> 
> Hi Darawsheh,
> Your changed can't work on FreeBSD OS, but function "get_session_output"
> in crb.py need work on FreeBSD os.
> Thanks a lot
> 
> > -----Original Message-----
> > From: Raslan Darawsheh [mailto:rasland@mellanox.com]
> > Sent: Thursday, October 29, 2015 4:05 PM
> > To: Xu, HuilongX; dts@dpdk.org
> > Cc: rdarawsheh@asaltech.com
> > Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters 
> > and check_Mellanox_pci function to identify mellanox device
> >
> > Hi Xu, HuilongX ,
> >
> > From what I changed it seems that it's only executed over the linux OS.
> > And there are an already "lspci" command executed inside the function.
> > Can you explain more ?
> > Kindest regards
> > Raslan Darawsheh
> >
> > -----Original Message-----
> > From: Xu, HuilongX [mailto:huilongx.xu@intel.com]
> > Sent: Thursday, October 29, 2015 4:01 AM
> > To: Raslan Darawsheh <rasland@mellanox.com>; dts@dpdk.org
> > Cc: rdarawsheh@asaltech.com
> > Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters 
> > and check_Mellanox_pci function to identify mellanox device
> >
> >
> > Hi darawsheh,
> > Pls see my comments as below., thanks  a lot
> > > -----Original Message-----
> > > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Raslan 
> > > Darawsheh
> > > Sent: Tuesday, October 27, 2015 2:08 PM
> > > To: dts@dpdk.org
> > > Cc: rdarawsheh@asaltech.com
> > > Subject: [dts] [PATCH 1/6] framework: crb :add some parameters and 
> > > check_Mellanox_pci function to identify mellanox device
> > >
> > > From: Raslsn Darawsheh <rdarawsheh@asaltech.com>
> > >
> > > Signed-off-by: Raslsn Darawsheh <rdarawsheh@asaltech.com>
> > > ---
> > >  framework/crb.py | 23 ++++++++++++++++++++++-
> > >  1 file changed, 22 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/framework/crb.py b/framework/crb.py index 
> > > fcbd7d9..0acec3b 100644
> > > --- a/framework/crb.py
> > > +++ b/framework/crb.py
> > > @@ -33,7 +33,7 @@ import time
> > >  import dts
> > >  import re
> > >  import os
> > > -from settings import TIMEOUT, IXIA
> > > +from settings import TIMEOUT, IXIA, NICS
> > >
> > >  """
> > >  CRB (customer reference board) basic functions and handlers @@
> > > -54,6
> > > +54,9 @@ class Crb(object):
> > >          self.skip_setup = False
> > >          self.serializer = serializer
> > >          self.ports_info = None
> > > +        self.isMellanox = False
> > > +        self.mellanoxPortCount = 0
> > > +        self.mellanoxCardType = None
> > >
> > >      def send_expect(self, cmds, expected, timeout=TIMEOUT,
> > >                      alt_session=False, verify=False):
> > > @@ -79,6 +82,19 @@ class Crb(object):
> > >
> > >          return self.session.send_command(cmds, timeout)
> > >
> > > +    def check_Mellanox_pci(self,pci_bus,pci_id):
> > > +        """
> > > +        check if the PCI is Mellanox device or not
> > > +        its used to set a flag to handle Mellanox ports differently
> > > +        """
> > > +        out = self.send_expect("lspci -nn | grep -i "  + pci_bus, 
> > > + "#
> ")
> > > +        if "Mell" in out:
> > > +            self.isMellanox =True
> > > +            if NICS['ConnectX_4'] in out:
> > > +                self.mellanoxCardType = "cx4"
> > > +            else:
> > > +                self.mellanoxCardType = "cx3"
> > > +
> > >      def get_session_output(self, timeout=TIMEOUT):
> > >          """
> > >          Get session output message before timeout @@ -196,6 
> > > +212,11 @@ class Crb(object):
> > >          rexp = r"([\da-f]{2}:[\da-f]{2}.\d{1}) .*Eth.*?ernet
> > > .*?([\da- f]{4}:[\da-f]{4})"
> > >          pattern = re.compile(rexp)
> > >          match = pattern.findall(out)
> > Could you not changed this function? because it not about dts 
> > feature It only a ssh session function, when you exec "lspci" 
> > command, freebsd os not support.
> > So some  case will failed on freebesd.
> > > +        out = self.send_expect(
> > > +                        "lspci -nn ", "# ", alt_session=True)
> > > +        rexp = r"([\da-f]{2}:[\da-f]{2}.\d{1}) Network .*?([\da-
> > > f]{4}:[\da-f]{4})"
> > > +        pattern = re.compile(rexp)
> > > +        match += pattern.findall(out)
> > >          self.pci_devices_info = []
> > >          for i in range(len(match)):
> > >              self.pci_devices_info.append((match[i][0],
> > > match[i][1]))
> > > --
> > > 1.8.3.1

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

* Re: [dts] [PATCH 1/6] framework: crb :add some parameters and check_Mellanox_pci function to identify mellanox device
  2015-11-10  6:32           ` Raslan Darawsheh
@ 2015-11-10  8:12             ` Liu, Yong
  2016-01-18 11:18             ` Raslan Darawsheh
  1 sibling, 0 replies; 18+ messages in thread
From: Liu, Yong @ 2015-11-10  8:12 UTC (permalink / raw)
  To: Raslan Darawsheh, Xu, HuilongX, dts; +Cc: rdarawsheh

Hi Darawsheh,
As you known, dpdk2.2 has been in validation cycle. We're now busying in 
the validation task.
Your patch look has different concept of NIC handling. In DTS by now, 
CRB do not need to known which NIC is on board.
Please wait one more week. After the validation task, we will figure out 
how to handle the patch.

Best regards,
Marvin

On 11/10/2015 02:32 PM, Raslan Darawsheh wrote:
> Hi  Xu, HuilongX ,
>
> When do you think you will apply the patches?
>
> Kindest regards
> Raslan Darawsheh
>
>
> -----Original Message-----
> From: Xu, HuilongX [mailto:huilongx.xu@intel.com]
> Sent: Thursday, October 29, 2015 12:10 PM
> To: Raslan Darawsheh; dts@dpdk.org
> Cc: rdarawsheh@asaltech.com
> Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters and check_Mellanox_pci function to identify mellanox device
>
> Hi Darawsheh,
> I am very sorry, I am too careless.
> Your changed in function " pci_devices_information_uncached_linux", so it's no problem Thanks a lot
>> -----Original Message-----
>> From: Raslan Darawsheh [mailto:rasland@mellanox.com]
>> Sent: Thursday, October 29, 2015 5:58 PM
>> To: Xu, HuilongX; dts@dpdk.org
>> Cc: rdarawsheh@asaltech.com
>> Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters and
>> check_Mellanox_pci function to identify mellanox device
>>
>> Hi Xu, HuilongX,
>>
>> I think you need to double check the patch, since in this patch it
>> doesn't change anything to this function.
>>
>> Kindest regards
>> Raslan Darawsheh
>>
>> -----Original Message-----
>> From: Xu, HuilongX [mailto:huilongx.xu@intel.com]
>> Sent: Thursday, October 29, 2015 10:48 AM
>> To: Raslan Darawsheh <rasland@mellanox.com>; dts@dpdk.org
>> Cc: rdarawsheh@asaltech.com
>> Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters and
>> check_Mellanox_pci function to identify mellanox device
>>
>> Hi Darawsheh,
>> Your changed can't work on FreeBSD OS, but function "get_session_output"
>> in crb.py need work on FreeBSD os.
>> Thanks a lot
>>
>>> -----Original Message-----
>>> From: Raslan Darawsheh [mailto:rasland@mellanox.com]
>>> Sent: Thursday, October 29, 2015 4:05 PM
>>> To: Xu, HuilongX; dts@dpdk.org
>>> Cc: rdarawsheh@asaltech.com
>>> Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters
>>> and check_Mellanox_pci function to identify mellanox device
>>>
>>> Hi Xu, HuilongX ,
>>>
>>>  From what I changed it seems that it's only executed over the linux OS.
>>> And there are an already "lspci" command executed inside the function.
>>> Can you explain more ?
>>> Kindest regards
>>> Raslan Darawsheh
>>>
>>> -----Original Message-----
>>> From: Xu, HuilongX [mailto:huilongx.xu@intel.com]
>>> Sent: Thursday, October 29, 2015 4:01 AM
>>> To: Raslan Darawsheh <rasland@mellanox.com>; dts@dpdk.org
>>> Cc: rdarawsheh@asaltech.com
>>> Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters
>>> and check_Mellanox_pci function to identify mellanox device
>>>
>>>
>>> Hi darawsheh,
>>> Pls see my comments as below., thanks  a lot
>>>> -----Original Message-----
>>>> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Raslan
>>>> Darawsheh
>>>> Sent: Tuesday, October 27, 2015 2:08 PM
>>>> To: dts@dpdk.org
>>>> Cc: rdarawsheh@asaltech.com
>>>> Subject: [dts] [PATCH 1/6] framework: crb :add some parameters and
>>>> check_Mellanox_pci function to identify mellanox device
>>>>
>>>> From: Raslsn Darawsheh <rdarawsheh@asaltech.com>
>>>>
>>>> Signed-off-by: Raslsn Darawsheh <rdarawsheh@asaltech.com>
>>>> ---
>>>>   framework/crb.py | 23 ++++++++++++++++++++++-
>>>>   1 file changed, 22 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/framework/crb.py b/framework/crb.py index
>>>> fcbd7d9..0acec3b 100644
>>>> --- a/framework/crb.py
>>>> +++ b/framework/crb.py
>>>> @@ -33,7 +33,7 @@ import time
>>>>   import dts
>>>>   import re
>>>>   import os
>>>> -from settings import TIMEOUT, IXIA
>>>> +from settings import TIMEOUT, IXIA, NICS
>>>>
>>>>   """
>>>>   CRB (customer reference board) basic functions and handlers @@
>>>> -54,6
>>>> +54,9 @@ class Crb(object):
>>>>           self.skip_setup = False
>>>>           self.serializer = serializer
>>>>           self.ports_info = None
>>>> +        self.isMellanox = False
>>>> +        self.mellanoxPortCount = 0
>>>> +        self.mellanoxCardType = None
>>>>
>>>>       def send_expect(self, cmds, expected, timeout=TIMEOUT,
>>>>                       alt_session=False, verify=False):
>>>> @@ -79,6 +82,19 @@ class Crb(object):
>>>>
>>>>           return self.session.send_command(cmds, timeout)
>>>>
>>>> +    def check_Mellanox_pci(self,pci_bus,pci_id):
>>>> +        """
>>>> +        check if the PCI is Mellanox device or not
>>>> +        its used to set a flag to handle Mellanox ports differently
>>>> +        """
>>>> +        out = self.send_expect("lspci -nn | grep -i "  + pci_bus,
>>>> + "#
>> ")
>>>> +        if "Mell" in out:
>>>> +            self.isMellanox =True
>>>> +            if NICS['ConnectX_4'] in out:
>>>> +                self.mellanoxCardType = "cx4"
>>>> +            else:
>>>> +                self.mellanoxCardType = "cx3"
>>>> +
>>>>       def get_session_output(self, timeout=TIMEOUT):
>>>>           """
>>>>           Get session output message before timeout @@ -196,6
>>>> +212,11 @@ class Crb(object):
>>>>           rexp = r"([\da-f]{2}:[\da-f]{2}.\d{1}) .*Eth.*?ernet
>>>> .*?([\da- f]{4}:[\da-f]{4})"
>>>>           pattern = re.compile(rexp)
>>>>           match = pattern.findall(out)
>>> Could you not changed this function? because it not about dts
>>> feature It only a ssh session function, when you exec "lspci"
>>> command, freebsd os not support.
>>> So some  case will failed on freebesd.
>>>> +        out = self.send_expect(
>>>> +                        "lspci -nn ", "# ", alt_session=True)
>>>> +        rexp = r"([\da-f]{2}:[\da-f]{2}.\d{1}) Network .*?([\da-
>>>> f]{4}:[\da-f]{4})"
>>>> +        pattern = re.compile(rexp)
>>>> +        match += pattern.findall(out)
>>>>           self.pci_devices_info = []
>>>>           for i in range(len(match)):
>>>>               self.pci_devices_info.append((match[i][0],
>>>> match[i][1]))
>>>> --
>>>> 1.8.3.1

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

* Re: [dts] [PATCH 1/6] framework: crb :add some parameters and check_Mellanox_pci function to identify mellanox device
  2015-11-10  6:32           ` Raslan Darawsheh
  2015-11-10  8:12             ` Liu, Yong
@ 2016-01-18 11:18             ` Raslan Darawsheh
  2016-01-19  6:05               ` Liu, Yong
  1 sibling, 1 reply; 18+ messages in thread
From: Raslan Darawsheh @ 2016-01-18 11:18 UTC (permalink / raw)
  To: Xu, HuilongX, dts; +Cc: rdarawsheh

Hi  Xu, HuilongX ,

This is  a remainder of my patches to support Mellanox NICs in DTS. What should I be done with them ? 

Kindest regards 
Raslan Darawsheh

-----Original Message-----
From: Raslan Darawsheh 
Sent: Tuesday, November 10, 2015 8:33 AM
To: Xu, HuilongX <huilongx.xu@intel.com>; dts@dpdk.org
Cc: rdarawsheh@asaltech.com
Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters and check_Mellanox_pci function to identify mellanox device

Hi  Xu, HuilongX , 

When do you think you will apply the patches? 

Kindest regards 
Raslan Darawsheh


-----Original Message-----
From: Xu, HuilongX [mailto:huilongx.xu@intel.com] 
Sent: Thursday, October 29, 2015 12:10 PM
To: Raslan Darawsheh; dts@dpdk.org
Cc: rdarawsheh@asaltech.com
Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters and check_Mellanox_pci function to identify mellanox device

Hi Darawsheh,
I am very sorry, I am too careless.
Your changed in function " pci_devices_information_uncached_linux", so it's no problem Thanks a lot
> -----Original Message-----
> From: Raslan Darawsheh [mailto:rasland@mellanox.com]
> Sent: Thursday, October 29, 2015 5:58 PM
> To: Xu, HuilongX; dts@dpdk.org
> Cc: rdarawsheh@asaltech.com
> Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters and 
> check_Mellanox_pci function to identify mellanox device
> 
> Hi Xu, HuilongX,
> 
> I think you need to double check the patch, since in this patch it 
> doesn't change anything to this function.
> 
> Kindest regards
> Raslan Darawsheh
> 
> -----Original Message-----
> From: Xu, HuilongX [mailto:huilongx.xu@intel.com]
> Sent: Thursday, October 29, 2015 10:48 AM
> To: Raslan Darawsheh <rasland@mellanox.com>; dts@dpdk.org
> Cc: rdarawsheh@asaltech.com
> Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters and 
> check_Mellanox_pci function to identify mellanox device
> 
> Hi Darawsheh,
> Your changed can't work on FreeBSD OS, but function "get_session_output"
> in crb.py need work on FreeBSD os.
> Thanks a lot
> 
> > -----Original Message-----
> > From: Raslan Darawsheh [mailto:rasland@mellanox.com]
> > Sent: Thursday, October 29, 2015 4:05 PM
> > To: Xu, HuilongX; dts@dpdk.org
> > Cc: rdarawsheh@asaltech.com
> > Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters 
> > and check_Mellanox_pci function to identify mellanox device
> >
> > Hi Xu, HuilongX ,
> >
> > From what I changed it seems that it's only executed over the linux OS.
> > And there are an already "lspci" command executed inside the function.
> > Can you explain more ?
> > Kindest regards
> > Raslan Darawsheh
> >
> > -----Original Message-----
> > From: Xu, HuilongX [mailto:huilongx.xu@intel.com]
> > Sent: Thursday, October 29, 2015 4:01 AM
> > To: Raslan Darawsheh <rasland@mellanox.com>; dts@dpdk.org
> > Cc: rdarawsheh@asaltech.com
> > Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters 
> > and check_Mellanox_pci function to identify mellanox device
> >
> >
> > Hi darawsheh,
> > Pls see my comments as below., thanks  a lot
> > > -----Original Message-----
> > > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Raslan 
> > > Darawsheh
> > > Sent: Tuesday, October 27, 2015 2:08 PM
> > > To: dts@dpdk.org
> > > Cc: rdarawsheh@asaltech.com
> > > Subject: [dts] [PATCH 1/6] framework: crb :add some parameters and 
> > > check_Mellanox_pci function to identify mellanox device
> > >
> > > From: Raslsn Darawsheh <rdarawsheh@asaltech.com>
> > >
> > > Signed-off-by: Raslsn Darawsheh <rdarawsheh@asaltech.com>
> > > ---
> > >  framework/crb.py | 23 ++++++++++++++++++++++-
> > >  1 file changed, 22 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/framework/crb.py b/framework/crb.py index 
> > > fcbd7d9..0acec3b 100644
> > > --- a/framework/crb.py
> > > +++ b/framework/crb.py
> > > @@ -33,7 +33,7 @@ import time
> > >  import dts
> > >  import re
> > >  import os
> > > -from settings import TIMEOUT, IXIA
> > > +from settings import TIMEOUT, IXIA, NICS
> > >
> > >  """
> > >  CRB (customer reference board) basic functions and handlers @@
> > > -54,6
> > > +54,9 @@ class Crb(object):
> > >          self.skip_setup = False
> > >          self.serializer = serializer
> > >          self.ports_info = None
> > > +        self.isMellanox = False
> > > +        self.mellanoxPortCount = 0
> > > +        self.mellanoxCardType = None
> > >
> > >      def send_expect(self, cmds, expected, timeout=TIMEOUT,
> > >                      alt_session=False, verify=False):
> > > @@ -79,6 +82,19 @@ class Crb(object):
> > >
> > >          return self.session.send_command(cmds, timeout)
> > >
> > > +    def check_Mellanox_pci(self,pci_bus,pci_id):
> > > +        """
> > > +        check if the PCI is Mellanox device or not
> > > +        its used to set a flag to handle Mellanox ports differently
> > > +        """
> > > +        out = self.send_expect("lspci -nn | grep -i "  + pci_bus, 
> > > + "#
> ")
> > > +        if "Mell" in out:
> > > +            self.isMellanox =True
> > > +            if NICS['ConnectX_4'] in out:
> > > +                self.mellanoxCardType = "cx4"
> > > +            else:
> > > +                self.mellanoxCardType = "cx3"
> > > +
> > >      def get_session_output(self, timeout=TIMEOUT):
> > >          """
> > >          Get session output message before timeout @@ -196,6 
> > > +212,11 @@ class Crb(object):
> > >          rexp = r"([\da-f]{2}:[\da-f]{2}.\d{1}) .*Eth.*?ernet
> > > .*?([\da- f]{4}:[\da-f]{4})"
> > >          pattern = re.compile(rexp)
> > >          match = pattern.findall(out)
> > Could you not changed this function? because it not about dts 
> > feature It only a ssh session function, when you exec "lspci" 
> > command, freebsd os not support.
> > So some  case will failed on freebesd.
> > > +        out = self.send_expect(
> > > +                        "lspci -nn ", "# ", alt_session=True)
> > > +        rexp = r"([\da-f]{2}:[\da-f]{2}.\d{1}) Network .*?([\da-
> > > f]{4}:[\da-f]{4})"
> > > +        pattern = re.compile(rexp)
> > > +        match += pattern.findall(out)
> > >          self.pci_devices_info = []
> > >          for i in range(len(match)):
> > >              self.pci_devices_info.append((match[i][0],
> > > match[i][1]))
> > > --
> > > 1.8.3.1

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

* Re: [dts] [PATCH 1/6] framework: crb :add some parameters and check_Mellanox_pci function to identify mellanox device
  2016-01-18 11:18             ` Raslan Darawsheh
@ 2016-01-19  6:05               ` Liu, Yong
  2016-01-19  9:26                 ` Raslan Darawsheh
  0 siblings, 1 reply; 18+ messages in thread
From: Liu, Yong @ 2016-01-19  6:05 UTC (permalink / raw)
  To: Raslan Darawsheh, Xu, HuilongX, dts; +Cc: rdarawsheh

Hi Darawsheh,
We have some questions about your patches. In your patch, crb module will check whether Mellanox nic on board.
Crb module focus on board operations in dts design and we do not want to involve any NIC concept.
For those special NICs, we have created one folder named "nics" for place special nic modules.

Could you please list what's the incompatibilities of dts, we hope to merge in your patch without change framework design.


> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Raslan Darawsheh
> Sent: Monday, January 18, 2016 7:18 PM
> To: Xu, HuilongX; dts@dpdk.org
> Cc: rdarawsheh@asaltech.com
> Subject: Re: [dts] [PATCH 1/6] framework: crb :add some parameters and
> check_Mellanox_pci function to identify mellanox device
> 
> Hi  Xu, HuilongX ,
> 
> This is  a remainder of my patches to support Mellanox NICs in DTS. What
> should I be done with them ?
> 
> Kindest regards
> Raslan Darawsheh
> 
> -----Original Message-----
> From: Raslan Darawsheh
> Sent: Tuesday, November 10, 2015 8:33 AM
> To: Xu, HuilongX <huilongx.xu@intel.com>; dts@dpdk.org
> Cc: rdarawsheh@asaltech.com
> Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters and
> check_Mellanox_pci function to identify mellanox device
> 
> Hi  Xu, HuilongX ,
> 
> When do you think you will apply the patches?
> 
> Kindest regards
> Raslan Darawsheh
> 
> 
> -----Original Message-----
> From: Xu, HuilongX [mailto:huilongx.xu@intel.com]
> Sent: Thursday, October 29, 2015 12:10 PM
> To: Raslan Darawsheh; dts@dpdk.org
> Cc: rdarawsheh@asaltech.com
> Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters and
> check_Mellanox_pci function to identify mellanox device
> 
> Hi Darawsheh,
> I am very sorry, I am too careless.
> Your changed in function " pci_devices_information_uncached_linux", so
> it's no problem Thanks a lot
> > -----Original Message-----
> > From: Raslan Darawsheh [mailto:rasland@mellanox.com]
> > Sent: Thursday, October 29, 2015 5:58 PM
> > To: Xu, HuilongX; dts@dpdk.org
> > Cc: rdarawsheh@asaltech.com
> > Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters and
> > check_Mellanox_pci function to identify mellanox device
> >
> > Hi Xu, HuilongX,
> >
> > I think you need to double check the patch, since in this patch it
> > doesn't change anything to this function.
> >
> > Kindest regards
> > Raslan Darawsheh
> >
> > -----Original Message-----
> > From: Xu, HuilongX [mailto:huilongx.xu@intel.com]
> > Sent: Thursday, October 29, 2015 10:48 AM
> > To: Raslan Darawsheh <rasland@mellanox.com>; dts@dpdk.org
> > Cc: rdarawsheh@asaltech.com
> > Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters and
> > check_Mellanox_pci function to identify mellanox device
> >
> > Hi Darawsheh,
> > Your changed can't work on FreeBSD OS, but function "get_session_output"
> > in crb.py need work on FreeBSD os.
> > Thanks a lot
> >
> > > -----Original Message-----
> > > From: Raslan Darawsheh [mailto:rasland@mellanox.com]
> > > Sent: Thursday, October 29, 2015 4:05 PM
> > > To: Xu, HuilongX; dts@dpdk.org
> > > Cc: rdarawsheh@asaltech.com
> > > Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters
> > > and check_Mellanox_pci function to identify mellanox device
> > >
> > > Hi Xu, HuilongX ,
> > >
> > > From what I changed it seems that it's only executed over the linux OS.
> > > And there are an already "lspci" command executed inside the function.
> > > Can you explain more ?
> > > Kindest regards
> > > Raslan Darawsheh
> > >
> > > -----Original Message-----
> > > From: Xu, HuilongX [mailto:huilongx.xu@intel.com]
> > > Sent: Thursday, October 29, 2015 4:01 AM
> > > To: Raslan Darawsheh <rasland@mellanox.com>; dts@dpdk.org
> > > Cc: rdarawsheh@asaltech.com
> > > Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters
> > > and check_Mellanox_pci function to identify mellanox device
> > >
> > >
> > > Hi darawsheh,
> > > Pls see my comments as below., thanks  a lot
> > > > -----Original Message-----
> > > > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Raslan
> > > > Darawsheh
> > > > Sent: Tuesday, October 27, 2015 2:08 PM
> > > > To: dts@dpdk.org
> > > > Cc: rdarawsheh@asaltech.com
> > > > Subject: [dts] [PATCH 1/6] framework: crb :add some parameters and
> > > > check_Mellanox_pci function to identify mellanox device
> > > >
> > > > From: Raslsn Darawsheh <rdarawsheh@asaltech.com>
> > > >
> > > > Signed-off-by: Raslsn Darawsheh <rdarawsheh@asaltech.com>
> > > > ---
> > > >  framework/crb.py | 23 ++++++++++++++++++++++-
> > > >  1 file changed, 22 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/framework/crb.py b/framework/crb.py index
> > > > fcbd7d9..0acec3b 100644
> > > > --- a/framework/crb.py
> > > > +++ b/framework/crb.py
> > > > @@ -33,7 +33,7 @@ import time
> > > >  import dts
> > > >  import re
> > > >  import os
> > > > -from settings import TIMEOUT, IXIA
> > > > +from settings import TIMEOUT, IXIA, NICS
> > > >
> > > >  """
> > > >  CRB (customer reference board) basic functions and handlers @@
> > > > -54,6
> > > > +54,9 @@ class Crb(object):
> > > >          self.skip_setup = False
> > > >          self.serializer = serializer
> > > >          self.ports_info = None
> > > > +        self.isMellanox = False
> > > > +        self.mellanoxPortCount = 0
> > > > +        self.mellanoxCardType = None
> > > >
> > > >      def send_expect(self, cmds, expected, timeout=TIMEOUT,
> > > >                      alt_session=False, verify=False):
> > > > @@ -79,6 +82,19 @@ class Crb(object):
> > > >
> > > >          return self.session.send_command(cmds, timeout)
> > > >
> > > > +    def check_Mellanox_pci(self,pci_bus,pci_id):
> > > > +        """
> > > > +        check if the PCI is Mellanox device or not
> > > > +        its used to set a flag to handle Mellanox ports differently
> > > > +        """
> > > > +        out = self.send_expect("lspci -nn | grep -i "  + pci_bus,
> > > > + "#
> > ")
> > > > +        if "Mell" in out:
> > > > +            self.isMellanox =True
> > > > +            if NICS['ConnectX_4'] in out:
> > > > +                self.mellanoxCardType = "cx4"
> > > > +            else:
> > > > +                self.mellanoxCardType = "cx3"
> > > > +
> > > >      def get_session_output(self, timeout=TIMEOUT):
> > > >          """
> > > >          Get session output message before timeout @@ -196,6
> > > > +212,11 @@ class Crb(object):
> > > >          rexp = r"([\da-f]{2}:[\da-f]{2}.\d{1}) .*Eth.*?ernet
> > > > .*?([\da- f]{4}:[\da-f]{4})"
> > > >          pattern = re.compile(rexp)
> > > >          match = pattern.findall(out)
> > > Could you not changed this function? because it not about dts
> > > feature It only a ssh session function, when you exec "lspci"
> > > command, freebsd os not support.
> > > So some  case will failed on freebesd.
> > > > +        out = self.send_expect(
> > > > +                        "lspci -nn ", "# ", alt_session=True)
> > > > +        rexp = r"([\da-f]{2}:[\da-f]{2}.\d{1}) Network .*?([\da-
> > > > f]{4}:[\da-f]{4})"
> > > > +        pattern = re.compile(rexp)
> > > > +        match += pattern.findall(out)
> > > >          self.pci_devices_info = []
> > > >          for i in range(len(match)):
> > > >              self.pci_devices_info.append((match[i][0],
> > > > match[i][1]))
> > > > --
> > > > 1.8.3.1

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

* Re: [dts] [PATCH 1/6] framework: crb :add some parameters and check_Mellanox_pci function to identify mellanox device
  2016-01-19  6:05               ` Liu, Yong
@ 2016-01-19  9:26                 ` Raslan Darawsheh
  2016-01-20  9:24                   ` Liu, Yong
  0 siblings, 1 reply; 18+ messages in thread
From: Raslan Darawsheh @ 2016-01-19  9:26 UTC (permalink / raw)
  To: Liu, Yong, Xu, HuilongX, dts; +Cc: FHamad, Olga Shern, rdarawsheh

Hi, 
The following is a list of incompatibilities of dts: 
1- when getting the device information - in our CX3 NIC it doesn't have Ethernet in it.	 -- pci_devices_information_uncached_linux function. 
2- Mellanox NIC's don't support NIC binding -- bind_interfaces_linux 
3- For the CX3 NIC it has the same PCI address for the two ports . which should change the way of how interface names being retrievrd. 
4- Mellanox PMD is not enabled by default so I needed to enable it when installing DPDK. 
I also added Mellanox in the list of supported NICS. So I have 6 patches : 

[dts] [PATCH 1/6] framework: crb :add some parameters and	check_Mellanox_pci function to identify mellanox device  
[dts] [PATCH 2/6] framework:dut : excluding mellanox NICs from	beeing binded   
[dts] [PATCH 3/6] framework:settings :adding new defines for	ConnectX_3_Pro and ConnectX_4 and there drivers
[dts] [PATCH 4/6] framewark:project_dpdk : Enable MLX4 and MLX5	PMD's before compiling and disable binding   
[dts] [PATCH 5/6] framework:net_device : adding function	get_interface_name_Mellanox to get the ConnectX_3_Pro interfaces  
[dts] [PATCH 6/6] framework:tester: adding ConnectX_3_Pro second	port to the list of ports  


Kindest regards 
Raslan Darawsheh 
-----Original Message-----
From: Liu, Yong [mailto:yong.liu@intel.com] 
Sent: Tuesday, January 19, 2016 8:05 AM
To: Raslan Darawsheh <rasland@mellanox.com>; Xu, HuilongX <huilongx.xu@intel.com>; dts@dpdk.org
Cc: rdarawsheh@asaltech.com
Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters and check_Mellanox_pci function to identify mellanox device

Hi Darawsheh,
We have some questions about your patches. In your patch, crb module will check whether Mellanox nic on board.
Crb module focus on board operations in dts design and we do not want to involve any NIC concept.
For those special NICs, we have created one folder named "nics" for place special nic modules.

Could you please list what's the incompatibilities of dts, we hope to merge in your patch without change framework design.


> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Raslan Darawsheh
> Sent: Monday, January 18, 2016 7:18 PM
> To: Xu, HuilongX; dts@dpdk.org
> Cc: rdarawsheh@asaltech.com
> Subject: Re: [dts] [PATCH 1/6] framework: crb :add some parameters and 
> check_Mellanox_pci function to identify mellanox device
> 
> Hi  Xu, HuilongX ,
> 
> This is  a remainder of my patches to support Mellanox NICs in DTS. 
> What should I be done with them ?
> 
> Kindest regards
> Raslan Darawsheh
> 
> -----Original Message-----
> From: Raslan Darawsheh
> Sent: Tuesday, November 10, 2015 8:33 AM
> To: Xu, HuilongX <huilongx.xu@intel.com>; dts@dpdk.org
> Cc: rdarawsheh@asaltech.com
> Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters and 
> check_Mellanox_pci function to identify mellanox device
> 
> Hi  Xu, HuilongX ,
> 
> When do you think you will apply the patches?
> 
> Kindest regards
> Raslan Darawsheh
> 
> 
> -----Original Message-----
> From: Xu, HuilongX [mailto:huilongx.xu@intel.com]
> Sent: Thursday, October 29, 2015 12:10 PM
> To: Raslan Darawsheh; dts@dpdk.org
> Cc: rdarawsheh@asaltech.com
> Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters and 
> check_Mellanox_pci function to identify mellanox device
> 
> Hi Darawsheh,
> I am very sorry, I am too careless.
> Your changed in function " pci_devices_information_uncached_linux", so 
> it's no problem Thanks a lot
> > -----Original Message-----
> > From: Raslan Darawsheh [mailto:rasland@mellanox.com]
> > Sent: Thursday, October 29, 2015 5:58 PM
> > To: Xu, HuilongX; dts@dpdk.org
> > Cc: rdarawsheh@asaltech.com
> > Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters 
> > and check_Mellanox_pci function to identify mellanox device
> >
> > Hi Xu, HuilongX,
> >
> > I think you need to double check the patch, since in this patch it 
> > doesn't change anything to this function.
> >
> > Kindest regards
> > Raslan Darawsheh
> >
> > -----Original Message-----
> > From: Xu, HuilongX [mailto:huilongx.xu@intel.com]
> > Sent: Thursday, October 29, 2015 10:48 AM
> > To: Raslan Darawsheh <rasland@mellanox.com>; dts@dpdk.org
> > Cc: rdarawsheh@asaltech.com
> > Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters 
> > and check_Mellanox_pci function to identify mellanox device
> >
> > Hi Darawsheh,
> > Your changed can't work on FreeBSD OS, but function "get_session_output"
> > in crb.py need work on FreeBSD os.
> > Thanks a lot
> >
> > > -----Original Message-----
> > > From: Raslan Darawsheh [mailto:rasland@mellanox.com]
> > > Sent: Thursday, October 29, 2015 4:05 PM
> > > To: Xu, HuilongX; dts@dpdk.org
> > > Cc: rdarawsheh@asaltech.com
> > > Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters 
> > > and check_Mellanox_pci function to identify mellanox device
> > >
> > > Hi Xu, HuilongX ,
> > >
> > > From what I changed it seems that it's only executed over the linux OS.
> > > And there are an already "lspci" command executed inside the function.
> > > Can you explain more ?
> > > Kindest regards
> > > Raslan Darawsheh
> > >
> > > -----Original Message-----
> > > From: Xu, HuilongX [mailto:huilongx.xu@intel.com]
> > > Sent: Thursday, October 29, 2015 4:01 AM
> > > To: Raslan Darawsheh <rasland@mellanox.com>; dts@dpdk.org
> > > Cc: rdarawsheh@asaltech.com
> > > Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters 
> > > and check_Mellanox_pci function to identify mellanox device
> > >
> > >
> > > Hi darawsheh,
> > > Pls see my comments as below., thanks  a lot
> > > > -----Original Message-----
> > > > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Raslan 
> > > > Darawsheh
> > > > Sent: Tuesday, October 27, 2015 2:08 PM
> > > > To: dts@dpdk.org
> > > > Cc: rdarawsheh@asaltech.com
> > > > Subject: [dts] [PATCH 1/6] framework: crb :add some parameters 
> > > > and check_Mellanox_pci function to identify mellanox device
> > > >
> > > > From: Raslsn Darawsheh <rdarawsheh@asaltech.com>
> > > >
> > > > Signed-off-by: Raslsn Darawsheh <rdarawsheh@asaltech.com>
> > > > ---
> > > >  framework/crb.py | 23 ++++++++++++++++++++++-
> > > >  1 file changed, 22 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/framework/crb.py b/framework/crb.py index 
> > > > fcbd7d9..0acec3b 100644
> > > > --- a/framework/crb.py
> > > > +++ b/framework/crb.py
> > > > @@ -33,7 +33,7 @@ import time
> > > >  import dts
> > > >  import re
> > > >  import os
> > > > -from settings import TIMEOUT, IXIA
> > > > +from settings import TIMEOUT, IXIA, NICS
> > > >
> > > >  """
> > > >  CRB (customer reference board) basic functions and handlers @@
> > > > -54,6
> > > > +54,9 @@ class Crb(object):
> > > >          self.skip_setup = False
> > > >          self.serializer = serializer
> > > >          self.ports_info = None
> > > > +        self.isMellanox = False
> > > > +        self.mellanoxPortCount = 0
> > > > +        self.mellanoxCardType = None
> > > >
> > > >      def send_expect(self, cmds, expected, timeout=TIMEOUT,
> > > >                      alt_session=False, verify=False):
> > > > @@ -79,6 +82,19 @@ class Crb(object):
> > > >
> > > >          return self.session.send_command(cmds, timeout)
> > > >
> > > > +    def check_Mellanox_pci(self,pci_bus,pci_id):
> > > > +        """
> > > > +        check if the PCI is Mellanox device or not
> > > > +        its used to set a flag to handle Mellanox ports differently
> > > > +        """
> > > > +        out = self.send_expect("lspci -nn | grep -i "  + 
> > > > + pci_bus, "#
> > ")
> > > > +        if "Mell" in out:
> > > > +            self.isMellanox =True
> > > > +            if NICS['ConnectX_4'] in out:
> > > > +                self.mellanoxCardType = "cx4"
> > > > +            else:
> > > > +                self.mellanoxCardType = "cx3"
> > > > +
> > > >      def get_session_output(self, timeout=TIMEOUT):
> > > >          """
> > > >          Get session output message before timeout @@ -196,6
> > > > +212,11 @@ class Crb(object):
> > > >          rexp = r"([\da-f]{2}:[\da-f]{2}.\d{1}) .*Eth.*?ernet
> > > > .*?([\da- f]{4}:[\da-f]{4})"
> > > >          pattern = re.compile(rexp)
> > > >          match = pattern.findall(out)
> > > Could you not changed this function? because it not about dts 
> > > feature It only a ssh session function, when you exec "lspci"
> > > command, freebsd os not support.
> > > So some  case will failed on freebesd.
> > > > +        out = self.send_expect(
> > > > +                        "lspci -nn ", "# ", alt_session=True)
> > > > +        rexp = r"([\da-f]{2}:[\da-f]{2}.\d{1}) Network 
> > > > + .*?([\da-
> > > > f]{4}:[\da-f]{4})"
> > > > +        pattern = re.compile(rexp)
> > > > +        match += pattern.findall(out)
> > > >          self.pci_devices_info = []
> > > >          for i in range(len(match)):
> > > >              self.pci_devices_info.append((match[i][0],
> > > > match[i][1]))
> > > > --
> > > > 1.8.3.1

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

* Re: [dts] [PATCH 1/6] framework: crb :add some parameters and check_Mellanox_pci function to identify mellanox device
  2016-01-19  9:26                 ` Raslan Darawsheh
@ 2016-01-20  9:24                   ` Liu, Yong
  0 siblings, 0 replies; 18+ messages in thread
From: Liu, Yong @ 2016-01-20  9:24 UTC (permalink / raw)
  To: Raslan Darawsheh, Xu, HuilongX, dts; +Cc: FHamad, Olga Shern, rdarawsheh

Darawsheh, thanks for your input. Our main concern is that crb only support board related operations.
We suppose all NIC special affairs will be handled in nics/related module. 
I think we can also support Mellanox NIC based this concept.

> -----Original Message-----
> From: Raslan Darawsheh [mailto:rasland@mellanox.com]
> Sent: Tuesday, January 19, 2016 5:27 PM
> To: Liu, Yong; Xu, HuilongX; dts@dpdk.org
> Cc: rdarawsheh@asaltech.com; FHamad@asaltech.com; Olga Shern
> Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters and
> check_Mellanox_pci function to identify mellanox device
> 
> Hi,
> The following is a list of incompatibilities of dts:
> 1- when getting the device information - in our CX3 NIC it doesn't have
> Ethernet in it.	 -- pci_devices_information_uncached_linux function.

That's fine, can merged it in.

> 2- Mellanox NIC's don't support NIC binding -- bind_interfaces_linux
DTS can simple skip binding when drivername in execution.cfg is empty.

> 3- For the CX3 NIC it has the same PCI address for the two ports . which
> should change the way of how interface names being retrievrd.

Now all net device object retrieved by GetNicObj function. We can changed this function to return net devices objects list. 
I think it can help on CX3 NIC.

> 4- Mellanox PMD is not enabled by default so I needed to enable it when
> installing DPDK.

It's reasonable to change configurations before validation, I have one idea that enable DTS to change dpdk configuration.
We're still discussion about where to enable it.

> I also added Mellanox in the list of supported NICS. So I have 6 patches :
> 
> [dts] [PATCH 1/6] framework: crb :add some parameters and
> 	check_Mellanox_pci function to identify mellanox device
> [dts] [PATCH 2/6] framework:dut : excluding mellanox NICs from	beeing
> binded
> [dts] [PATCH 3/6] framework:settings :adding new defines for
> 	ConnectX_3_Pro and ConnectX_4 and there drivers
> [dts] [PATCH 4/6] framewark:project_dpdk : Enable MLX4 and MLX5	PMD's
> before compiling and disable binding
> [dts] [PATCH 5/6] framework:net_device : adding function
> 	get_interface_name_Mellanox to get the ConnectX_3_Pro interfaces
> [dts] [PATCH 6/6] framework:tester: adding ConnectX_3_Pro second	port to
> the list of ports
> 
> 
> Kindest regards
> Raslan Darawsheh
> -----Original Message-----
> From: Liu, Yong [mailto:yong.liu@intel.com]
> Sent: Tuesday, January 19, 2016 8:05 AM
> To: Raslan Darawsheh <rasland@mellanox.com>; Xu, HuilongX
> <huilongx.xu@intel.com>; dts@dpdk.org
> Cc: rdarawsheh@asaltech.com
> Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters and
> check_Mellanox_pci function to identify mellanox device
> 
> Hi Darawsheh,
> We have some questions about your patches. In your patch, crb module will
> check whether Mellanox nic on board.
> Crb module focus on board operations in dts design and we do not want to
> involve any NIC concept.
> For those special NICs, we have created one folder named "nics" for place
> special nic modules.
> 
> Could you please list what's the incompatibilities of dts, we hope to
> merge in your patch without change framework design.
> 
> 
> > -----Original Message-----
> > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Raslan Darawsheh
> > Sent: Monday, January 18, 2016 7:18 PM
> > To: Xu, HuilongX; dts@dpdk.org
> > Cc: rdarawsheh@asaltech.com
> > Subject: Re: [dts] [PATCH 1/6] framework: crb :add some parameters and
> > check_Mellanox_pci function to identify mellanox device
> >
> > Hi  Xu, HuilongX ,
> >
> > This is  a remainder of my patches to support Mellanox NICs in DTS.
> > What should I be done with them ?
> >
> > Kindest regards
> > Raslan Darawsheh
> >
> > -----Original Message-----
> > From: Raslan Darawsheh
> > Sent: Tuesday, November 10, 2015 8:33 AM
> > To: Xu, HuilongX <huilongx.xu@intel.com>; dts@dpdk.org
> > Cc: rdarawsheh@asaltech.com
> > Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters and
> > check_Mellanox_pci function to identify mellanox device
> >
> > Hi  Xu, HuilongX ,
> >
> > When do you think you will apply the patches?
> >
> > Kindest regards
> > Raslan Darawsheh
> >
> >
> > -----Original Message-----
> > From: Xu, HuilongX [mailto:huilongx.xu@intel.com]
> > Sent: Thursday, October 29, 2015 12:10 PM
> > To: Raslan Darawsheh; dts@dpdk.org
> > Cc: rdarawsheh@asaltech.com
> > Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters and
> > check_Mellanox_pci function to identify mellanox device
> >
> > Hi Darawsheh,
> > I am very sorry, I am too careless.
> > Your changed in function " pci_devices_information_uncached_linux", so
> > it's no problem Thanks a lot
> > > -----Original Message-----
> > > From: Raslan Darawsheh [mailto:rasland@mellanox.com]
> > > Sent: Thursday, October 29, 2015 5:58 PM
> > > To: Xu, HuilongX; dts@dpdk.org
> > > Cc: rdarawsheh@asaltech.com
> > > Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters
> > > and check_Mellanox_pci function to identify mellanox device
> > >
> > > Hi Xu, HuilongX,
> > >
> > > I think you need to double check the patch, since in this patch it
> > > doesn't change anything to this function.
> > >
> > > Kindest regards
> > > Raslan Darawsheh
> > >
> > > -----Original Message-----
> > > From: Xu, HuilongX [mailto:huilongx.xu@intel.com]
> > > Sent: Thursday, October 29, 2015 10:48 AM
> > > To: Raslan Darawsheh <rasland@mellanox.com>; dts@dpdk.org
> > > Cc: rdarawsheh@asaltech.com
> > > Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters
> > > and check_Mellanox_pci function to identify mellanox device
> > >
> > > Hi Darawsheh,
> > > Your changed can't work on FreeBSD OS, but function
> "get_session_output"
> > > in crb.py need work on FreeBSD os.
> > > Thanks a lot
> > >
> > > > -----Original Message-----
> > > > From: Raslan Darawsheh [mailto:rasland@mellanox.com]
> > > > Sent: Thursday, October 29, 2015 4:05 PM
> > > > To: Xu, HuilongX; dts@dpdk.org
> > > > Cc: rdarawsheh@asaltech.com
> > > > Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters
> > > > and check_Mellanox_pci function to identify mellanox device
> > > >
> > > > Hi Xu, HuilongX ,
> > > >
> > > > From what I changed it seems that it's only executed over the linux
> OS.
> > > > And there are an already "lspci" command executed inside the
> function.
> > > > Can you explain more ?
> > > > Kindest regards
> > > > Raslan Darawsheh
> > > >
> > > > -----Original Message-----
> > > > From: Xu, HuilongX [mailto:huilongx.xu@intel.com]
> > > > Sent: Thursday, October 29, 2015 4:01 AM
> > > > To: Raslan Darawsheh <rasland@mellanox.com>; dts@dpdk.org
> > > > Cc: rdarawsheh@asaltech.com
> > > > Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters
> > > > and check_Mellanox_pci function to identify mellanox device
> > > >
> > > >
> > > > Hi darawsheh,
> > > > Pls see my comments as below., thanks  a lot
> > > > > -----Original Message-----
> > > > > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Raslan
> > > > > Darawsheh
> > > > > Sent: Tuesday, October 27, 2015 2:08 PM
> > > > > To: dts@dpdk.org
> > > > > Cc: rdarawsheh@asaltech.com
> > > > > Subject: [dts] [PATCH 1/6] framework: crb :add some parameters
> > > > > and check_Mellanox_pci function to identify mellanox device
> > > > >
> > > > > From: Raslsn Darawsheh <rdarawsheh@asaltech.com>
> > > > >
> > > > > Signed-off-by: Raslsn Darawsheh <rdarawsheh@asaltech.com>
> > > > > ---
> > > > >  framework/crb.py | 23 ++++++++++++++++++++++-
> > > > >  1 file changed, 22 insertions(+), 1 deletion(-)
> > > > >
> > > > > diff --git a/framework/crb.py b/framework/crb.py index
> > > > > fcbd7d9..0acec3b 100644
> > > > > --- a/framework/crb.py
> > > > > +++ b/framework/crb.py
> > > > > @@ -33,7 +33,7 @@ import time
> > > > >  import dts
> > > > >  import re
> > > > >  import os
> > > > > -from settings import TIMEOUT, IXIA
> > > > > +from settings import TIMEOUT, IXIA, NICS
> > > > >
> > > > >  """
> > > > >  CRB (customer reference board) basic functions and handlers @@
> > > > > -54,6
> > > > > +54,9 @@ class Crb(object):
> > > > >          self.skip_setup = False
> > > > >          self.serializer = serializer
> > > > >          self.ports_info = None
> > > > > +        self.isMellanox = False
> > > > > +        self.mellanoxPortCount = 0
> > > > > +        self.mellanoxCardType = None
> > > > >
> > > > >      def send_expect(self, cmds, expected, timeout=TIMEOUT,
> > > > >                      alt_session=False, verify=False):
> > > > > @@ -79,6 +82,19 @@ class Crb(object):
> > > > >
> > > > >          return self.session.send_command(cmds, timeout)
> > > > >
> > > > > +    def check_Mellanox_pci(self,pci_bus,pci_id):
> > > > > +        """
> > > > > +        check if the PCI is Mellanox device or not
> > > > > +        its used to set a flag to handle Mellanox ports
> differently
> > > > > +        """
> > > > > +        out = self.send_expect("lspci -nn | grep -i "  +
> > > > > + pci_bus, "#
> > > ")
> > > > > +        if "Mell" in out:
> > > > > +            self.isMellanox =True
> > > > > +            if NICS['ConnectX_4'] in out:
> > > > > +                self.mellanoxCardType = "cx4"
> > > > > +            else:
> > > > > +                self.mellanoxCardType = "cx3"
> > > > > +
> > > > >      def get_session_output(self, timeout=TIMEOUT):
> > > > >          """
> > > > >          Get session output message before timeout @@ -196,6
> > > > > +212,11 @@ class Crb(object):
> > > > >          rexp = r"([\da-f]{2}:[\da-f]{2}.\d{1}) .*Eth.*?ernet
> > > > > .*?([\da- f]{4}:[\da-f]{4})"
> > > > >          pattern = re.compile(rexp)
> > > > >          match = pattern.findall(out)
> > > > Could you not changed this function? because it not about dts
> > > > feature It only a ssh session function, when you exec "lspci"
> > > > command, freebsd os not support.
> > > > So some  case will failed on freebesd.
> > > > > +        out = self.send_expect(
> > > > > +                        "lspci -nn ", "# ", alt_session=True)
> > > > > +        rexp = r"([\da-f]{2}:[\da-f]{2}.\d{1}) Network
> > > > > + .*?([\da-
> > > > > f]{4}:[\da-f]{4})"
> > > > > +        pattern = re.compile(rexp)
> > > > > +        match += pattern.findall(out)
> > > > >          self.pci_devices_info = []
> > > > >          for i in range(len(match)):
> > > > >              self.pci_devices_info.append((match[i][0],
> > > > > match[i][1]))
> > > > > --
> > > > > 1.8.3.1

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

end of thread, other threads:[~2016-01-20  9:28 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-27  6:07 [dts] [PATCH 1/6] framework: crb :add some parameters and check_Mellanox_pci function to identify mellanox device Raslan Darawsheh
2015-10-27  6:07 ` [dts] [PATCH 2/6] framework:dut : excluding mellanox NICs from beeing binded Raslan Darawsheh
2015-10-27  6:07 ` [dts] [PATCH 3/6] framework:settings :adding new defines for ConnectX_3_Pro and ConnectX_4 and there drivers Raslan Darawsheh
2015-10-27  6:07 ` [dts] [PATCH 4/6] framewark:project_dpdk : Enable MLX4 and MLX5 PMD's before compiling and disable binding Raslan Darawsheh
2015-10-27  6:07 ` [dts] [PATCH 5/6] framework:net_device : adding function get_interface_name_Mellanox to get the ConnectX_3_Pro interfaces Raslan Darawsheh
2015-10-27  6:07 ` [dts] [PATCH 6/6] framework:tester: adding ConnectX_3_Pro second port to the list of ports Raslan Darawsheh
2015-10-27  6:07 ` [dts] [PATCH] fix queue start/stop case failed Raslan Darawsheh
2015-10-29  2:00 ` [dts] [PATCH 1/6] framework: crb :add some parameters and check_Mellanox_pci function to identify mellanox device Xu, HuilongX
2015-10-29  8:04   ` Raslan Darawsheh
2015-10-29  8:48     ` Xu, HuilongX
2015-10-29  9:58       ` Raslan Darawsheh
2015-10-29 10:10         ` Xu, HuilongX
2015-11-10  6:32           ` Raslan Darawsheh
2015-11-10  8:12             ` Liu, Yong
2016-01-18 11:18             ` Raslan Darawsheh
2016-01-19  6:05               ` Liu, Yong
2016-01-19  9:26                 ` Raslan Darawsheh
2016-01-20  9:24                   ` Liu, Yong

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