test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH for-next v2 0/3] nic_single_core_perf: add support for Mellanox's nics
@ 2018-03-29 23:47 Ali Alnubani
  2018-03-29 23:47 ` [dts] [PATCH for-next v2 1/3] framework/project_dpdk: pass modprobe if driver is mlx5_core Ali Alnubani
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Ali Alnubani @ 2018-03-29 23:47 UTC (permalink / raw)
  To: dts; +Cc: dpdklab

This patchset adds support to run nic_single_core_perf test on
ConnectX-5 EX, ConnectX-4 LX 25G, and ConnectX-4 LX 40G.

Please note that this series is applied on top of
Patrick's "Fixes and modifications for T-Rex integration and nic_single_core_perf"
patchset: http://dpdk.org/ml/archives/dts/2018-March/003893.html

Ali Alnubani (3):
  framework/project_dpdk: pass modprobe if driver is mlx5_core
  nics/net_device: add a function to get nic speed
  nic_single_core_perf: add support for Mellanox's nics

Changes in v2:
- Fixed handling an exception in get_nic_speed function.

 conf/nic_single_core_perf.cfg           |  3 +++
 framework/project_dpdk.py               |  5 ++++-
 nics/net_device.py                      | 14 ++++++++++++++
 tests/TestSuite_nic_single_core_perf.py | 25 ++++++++++++++++++++++++-
 4 files changed, 45 insertions(+), 2 deletions(-)

-- 
2.16.2

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

* [dts] [PATCH for-next v2 1/3] framework/project_dpdk: pass modprobe if driver is mlx5_core
  2018-03-29 23:47 [dts] [PATCH for-next v2 0/3] nic_single_core_perf: add support for Mellanox's nics Ali Alnubani
@ 2018-03-29 23:47 ` Ali Alnubani
  2018-03-29 23:47 ` [dts] [PATCH for-next v2 2/3] nics/net_device: add a function to get nic speed Ali Alnubani
  2018-03-29 23:47 ` [dts] [PATCH for-next v2 3/3] nic_single_core_perf: add support for Mellanox's nics Ali Alnubani
  2 siblings, 0 replies; 6+ messages in thread
From: Ali Alnubani @ 2018-03-29 23:47 UTC (permalink / raw)
  To: dts; +Cc: dpdklab

Module probing mlx5_core is not needed with MLNX_OFED
installed.

Signed-off-by: Ali Alnubani <alialnu@mellanox.com>
---
 framework/project_dpdk.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/framework/project_dpdk.py b/framework/project_dpdk.py
index 40c862a..618cd57 100644
--- a/framework/project_dpdk.py
+++ b/framework/project_dpdk.py
@@ -112,7 +112,10 @@ class DPDKdut(Dut):
             self.send_expect("modprobe uio_pci_generic", "#", 70)
             out = self.send_expect("lsmod | grep uio_pci_generic", "#")
             assert ("uio_pci_generic" in out), "Failed to setup uio_pci_generic"
- 
+
+        elif drivername == "mlx5_core":
+            pass
+
         else:
             self.send_expect("modprobe uio", "#", 70)
             out = self.send_expect("lsmod | grep igb_uio", "#")
-- 
2.16.2

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

* [dts] [PATCH for-next v2 2/3] nics/net_device: add a function to get nic speed
  2018-03-29 23:47 [dts] [PATCH for-next v2 0/3] nic_single_core_perf: add support for Mellanox's nics Ali Alnubani
  2018-03-29 23:47 ` [dts] [PATCH for-next v2 1/3] framework/project_dpdk: pass modprobe if driver is mlx5_core Ali Alnubani
@ 2018-03-29 23:47 ` Ali Alnubani
  2018-03-30  8:29   ` Liu, Yong
  2018-03-29 23:47 ` [dts] [PATCH for-next v2 3/3] nic_single_core_perf: add support for Mellanox's nics Ali Alnubani
  2 siblings, 1 reply; 6+ messages in thread
From: Ali Alnubani @ 2018-03-29 23:47 UTC (permalink / raw)
  To: dts; +Cc: dpdklab

Needed to differentiate between nics with same
device identifier, but with different speeds.

Signed-off-by: Ali Alnubani <alialnu@mellanox.com>
---
 nics/net_device.py | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/nics/net_device.py b/nics/net_device.py
index 4861145..0f4bac3 100644
--- a/nics/net_device.py
+++ b/nics/net_device.py
@@ -539,6 +539,20 @@ class NetDevice(object):
         """
         return self.crb.get_pci_dev_id(self.domain_id, self.bus_id, self.devfun_id)
 
+    def get_nic_speed(self):
+        """
+        Get the speed of specified pci device.
+        """
+        nic_speed = None
+        command = ('cat /sys/bus/pci/devices/%s\:%s\:%s/net/*/speed' % ( \
+                self.domain_id, self.bus_id, self.devfun_id))
+        try:
+            nic_speed = self.__send_expect(command, '# ')
+        except Exception as e:
+            print 'Failed to get the speed of the pci device [%s:%s:%s]: %s' \
+                    % (self.domain_id, self.bus_id, self.devfun_id, e)
+        return nic_speed
+
     @nic_has_driver
     def get_sriov_vfs_pci(self):
         """
-- 
2.16.2

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

* [dts] [PATCH for-next v2 3/3] nic_single_core_perf: add support for Mellanox's nics
  2018-03-29 23:47 [dts] [PATCH for-next v2 0/3] nic_single_core_perf: add support for Mellanox's nics Ali Alnubani
  2018-03-29 23:47 ` [dts] [PATCH for-next v2 1/3] framework/project_dpdk: pass modprobe if driver is mlx5_core Ali Alnubani
  2018-03-29 23:47 ` [dts] [PATCH for-next v2 2/3] nics/net_device: add a function to get nic speed Ali Alnubani
@ 2018-03-29 23:47 ` Ali Alnubani
  2 siblings, 0 replies; 6+ messages in thread
From: Ali Alnubani @ 2018-03-29 23:47 UTC (permalink / raw)
  To: dts; +Cc: dpdklab

1. Add support in the test for ConnectX-5 EX, ConnectX-4 LX 25G
and ConnectX-4 LX 40G.
2. Also add the expected performance in the test's configuration
file.

Signed-off-by: Ali Alnubani <alialnu@mellanox.com>
---
 conf/nic_single_core_perf.cfg           |  3 +++
 tests/TestSuite_nic_single_core_perf.py | 25 ++++++++++++++++++++++++-
 2 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/conf/nic_single_core_perf.cfg b/conf/nic_single_core_perf.cfg
index 4c470db..03cd6c3 100644
--- a/conf/nic_single_core_perf.cfg
+++ b/conf/nic_single_core_perf.cfg
@@ -8,3 +8,6 @@
 
 throughput_nnt = {64: {128: 53.435, 512: 53.699, 2048: 42.798}}
 throughput_fvl25g = {64: {512: 43.777, 2048: 43.651}}
+throughput_cx5 = {64: {128: 42.161, 256: 56.651, 512: 47.091, 2048: 40.104}}
+throughput_cx4lx25g = {64: {128: 28.178, 256: 34.581, 512: 30.528, 2048: 26.004}}
+throughput_cx4lx40g = {64: {128: 31.635, 256: 32.473, 512: 30.72, 2048: 26.94}}
diff --git a/tests/TestSuite_nic_single_core_perf.py b/tests/TestSuite_nic_single_core_perf.py
index d1b88c3..c08f458 100644
--- a/tests/TestSuite_nic_single_core_perf.py
+++ b/tests/TestSuite_nic_single_core_perf.py
@@ -57,6 +57,9 @@ class TestNicSingleCorePerf(TestCase):
         self.headers_size = HEADER_SIZE['eth'] + HEADER_SIZE['ip'] + HEADER_SIZE['tcp']
         self.ixgbe_descriptors = [128, 512, 2048]
         self.i40e_descriptors = [512, 2048]
+        self.cx5_descriptors = [128, 256, 512, 2048]
+        self.cx4lx25g_descriptors = [128, 256, 512, 2048]
+        self.cx4lx40g_descriptors = [128, 256, 512, 2048]
 
         # traffic duraion in second
         self.trafficDuration = 60
@@ -64,6 +67,9 @@ class TestNicSingleCorePerf(TestCase):
         #load the expected throughput for required nic
         self.expected_throughput_nnt = self.get_suite_cfg()["throughput_nnt"]
         self.expected_throughput_fvl25g = self.get_suite_cfg()["throughput_fvl25g"]
+        self.expected_throughput_cx5 = self.get_suite_cfg()["throughput_cx5"]
+        self.expected_throughput_cx4lx25g = self.get_suite_cfg()["throughput_cx4lx25g"]
+        self.expected_throughput_cx4lx40g = self.get_suite_cfg()["throughput_cx4lx40g"]
 
         # The acdepted gap between expected throughput and actual throughput, 1 Mpps
         self.gap = 1
@@ -96,6 +102,14 @@ class TestNicSingleCorePerf(TestCase):
             self.descriptors = self.ixgbe_descriptors
         elif self.nic in ["fortville_25g"]:
             self.descriptors = self.i40e_descriptors
+        elif self.nic in ["ConnectX5_MT4121"]:
+            self.descriptors = self.cx5_descriptors
+        elif self.nic in ["ConnectX4_LX_MT4117"]:
+            nic_speed = self.dut.ports_info[0]['port'].get_nic_speed()
+            if nic_speed == "25000":
+                self.descriptors = self.cx4lx25g_descriptors
+            else:
+                self.descriptors = self.cx4lx40g_descriptors
         else:
             raise Exception("Not required NIC")
 
@@ -104,7 +118,8 @@ class TestNicSingleCorePerf(TestCase):
         Run nic single core performance 
         """
         self.verify(len(self.dut_ports) == 2 or len(self.dut_ports) == 4, "Require 2 or 4 ports to test")
-        self.verify(self.nic in ['niantic','fortville_25g'], "Not required NIC ")
+        self.verify(self.nic in ['niantic', 'fortville_25g', \
+                'ConnectX5_MT4121', 'ConnectX4_LX_MT4117'], "Not required NIC ")
         if len(self.dut_ports) == 2:
             self.perf_test(2)   
         elif len(self.dut_ports) == 4:
@@ -175,6 +190,14 @@ class TestNicSingleCorePerf(TestCase):
                     ret_data[header[4]] = str(self.expected_throughput_nnt[frame_size][descriptor]) + " Mpps"
                 elif self.nic == "fortville_25g":
                     ret_data[header[4]] = str(self.expected_throughput_fvl25g[frame_size][descriptor]) + " Mpps"
+                elif self.nic == "ConnectX5_MT4121":
+                    ret_data[header[4]] = str(self.expected_throughput_cx5[frame_size][descriptor]) + " Mpps"
+                elif self.nic == "ConnectX4_LX_MT4117":
+                    nic_speed = self.dut.ports_info[0]['port'].get_nic_speed()
+                    if nic_speed == "25000":
+                        ret_data[header[4]] = str(self.expected_throughput_cx4lx25g[frame_size][descriptor]) + " Mpps"
+                    else:
+                        ret_data[header[4]] = str(self.expected_throughput_cx4lx40g[frame_size][descriptor]) + " Mpps"
                 ret_datas[descriptor] = deepcopy(ret_data)
                 self.test_result[frame_size] = deepcopy(ret_datas)
         
-- 
2.16.2

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

* Re: [dts] [PATCH for-next v2 2/3] nics/net_device: add a function to get nic speed
  2018-03-29 23:47 ` [dts] [PATCH for-next v2 2/3] nics/net_device: add a function to get nic speed Ali Alnubani
@ 2018-03-30  8:29   ` Liu, Yong
  2018-03-30 22:55     ` Ali Alnubani
  0 siblings, 1 reply; 6+ messages in thread
From: Liu, Yong @ 2018-03-30  8:29 UTC (permalink / raw)
  To: Ali Alnubani, dts; +Cc: dpdklab

Hi Ali,
Since kernel module is the precondition of NIC interface, please add 
wrapper function nic_has_driver.

Thanks,
Marvin

On 03/30/2018 07:47 AM, Ali Alnubani wrote:
> Needed to differentiate between nics with same
> device identifier, but with different speeds.
>
> Signed-off-by: Ali Alnubani <alialnu@mellanox.com>
> ---
>   nics/net_device.py | 14 ++++++++++++++
>   1 file changed, 14 insertions(+)
>
> diff --git a/nics/net_device.py b/nics/net_device.py
> index 4861145..0f4bac3 100644
> --- a/nics/net_device.py
> +++ b/nics/net_device.py
> @@ -539,6 +539,20 @@ class NetDevice(object):
>           """
>           return self.crb.get_pci_dev_id(self.domain_id, self.bus_id, self.devfun_id)
>   
> +    def get_nic_speed(self):
> +        """
> +        Get the speed of specified pci device.
> +        """
> +        nic_speed = None
> +        command = ('cat /sys/bus/pci/devices/%s\:%s\:%s/net/*/speed' % ( \
> +                self.domain_id, self.bus_id, self.devfun_id))
> +        try:
> +            nic_speed = self.__send_expect(command, '# ')
> +        except Exception as e:
> +            print 'Failed to get the speed of the pci device [%s:%s:%s]: %s' \
> +                    % (self.domain_id, self.bus_id, self.devfun_id, e)
> +        return nic_speed
> +
>       @nic_has_driver
>       def get_sriov_vfs_pci(self):
>           """

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

* Re: [dts] [PATCH for-next v2 2/3] nics/net_device: add a function to get nic speed
  2018-03-30  8:29   ` Liu, Yong
@ 2018-03-30 22:55     ` Ali Alnubani
  0 siblings, 0 replies; 6+ messages in thread
From: Ali Alnubani @ 2018-03-30 22:55 UTC (permalink / raw)
  To: Liu, Yong, dts; +Cc: dpdklab

[-- Attachment #1: Type: text/plain, Size: 1762 bytes --]

Thank you for pointing that out Marvin.
Sent a v3 of the patchset.

Regards,
Ali

________________________________
From: Liu, Yong <yong.liu@intel.com>
Sent: Friday, March 30, 2018 11:29:01 AM
To: Ali Alnubani; dts@dpdk.org
Cc: dpdklab@iol.unh.edu
Subject: Re: [dts] [PATCH for-next v2 2/3] nics/net_device: add a function to get nic speed

Hi Ali,
Since kernel module is the precondition of NIC interface, please add
wrapper function nic_has_driver.

Thanks,
Marvin

On 03/30/2018 07:47 AM, Ali Alnubani wrote:
> Needed to differentiate between nics with same
> device identifier, but with different speeds.
>
> Signed-off-by: Ali Alnubani <alialnu@mellanox.com>
> ---
>   nics/net_device.py | 14 ++++++++++++++
>   1 file changed, 14 insertions(+)
>
> diff --git a/nics/net_device.py b/nics/net_device.py
> index 4861145..0f4bac3 100644
> --- a/nics/net_device.py
> +++ b/nics/net_device.py
> @@ -539,6 +539,20 @@ class NetDevice(object):
>           """
>           return self.crb.get_pci_dev_id(self.domain_id, self.bus_id, self.devfun_id)
>
> +    def get_nic_speed(self):
> +        """
> +        Get the speed of specified pci device.
> +        """
> +        nic_speed = None
> +        command = ('cat /sys/bus/pci/devices/%s\:%s\:%s/net/*/speed' % ( \
> +                self.domain_id, self.bus_id, self.devfun_id))
> +        try:
> +            nic_speed = self.__send_expect(command, '# ')
> +        except Exception as e:
> +            print 'Failed to get the speed of the pci device [%s:%s:%s]: %s' \
> +                    % (self.domain_id, self.bus_id, self.devfun_id, e)
> +        return nic_speed
> +
>       @nic_has_driver
>       def get_sriov_vfs_pci(self):
>           """


[-- Attachment #2: Type: text/html, Size: 3810 bytes --]

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

end of thread, other threads:[~2018-03-30 22:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-29 23:47 [dts] [PATCH for-next v2 0/3] nic_single_core_perf: add support for Mellanox's nics Ali Alnubani
2018-03-29 23:47 ` [dts] [PATCH for-next v2 1/3] framework/project_dpdk: pass modprobe if driver is mlx5_core Ali Alnubani
2018-03-29 23:47 ` [dts] [PATCH for-next v2 2/3] nics/net_device: add a function to get nic speed Ali Alnubani
2018-03-30  8:29   ` Liu, Yong
2018-03-30 22:55     ` Ali Alnubani
2018-03-29 23:47 ` [dts] [PATCH for-next v2 3/3] nic_single_core_perf: add support for Mellanox's nics Ali Alnubani

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