[dts] [PATCH 1/4] framework/crb: Fixing ThunderX ethernet controler detection

Liu, Yong yong.liu at intel.com
Tue Dec 5 02:45:03 CET 2017


Hi Biernacki,
“wirespeed” function is used by performance case for calculating the percentage of line rate. And by default we assume that only highest link speed will be used for performance case. So currently speed is hard-coded based on NIC type.
Agreed with you, port link speed should be one attribute of port which may be detected from tester side.

Thanks,
Marvin

From: Radoslaw Biernacki [mailto:radoslaw.biernacki at linaro.org]
Sent: Monday, December 04, 2017 9:58 PM
To: Verma, Ayuj <Ayuj.Verma at cavium.com>
Cc: dts at dpdk.org; Jogarao, Nartu <Nartu.Jogarao at cavium.com>; Herbert Guan <herbert.guan at linaro.org>; Czubak, Angela <Angela.Czubak at cavium.com>; Liu, Yong <yong.liu at intel.com>; Desai, Arvind <Arvind.Desai at cavium.com>; Athreya, Narayana Prasad <NarayanaPrasad.Athreya at cavium.com>
Subject: Re: [PATCH 1/4] framework/crb: Fixing ThunderX ethernet controler detection

Hi,

I didn't noticed previously that this might be connected to my change so thank for giving the feedback.

I need to spend some time and think about it, but is seems that "wirespeed" function should be function of a nic or rather a port, not test class.
And I'm surprised that it didn't check the actual speed of a port since even ThunderX NIC 10G can work either 1G or 10G.

So in general please give me some time I should came up with some more elegant solution which possibly I can add as V2 of this patch.

On 4 December 2017 at 13:12, Verma, Ayuj <Ayuj.Verma at cavium.com<mailto:Ayuj.Verma at cavium.com>> wrote:

Hi Biernacki,



Thanks for the heads up.

The reason for us to put this check is ThunderX Ethernet controllers 1G, 10G and 40G NIC devices have same device-id which make it difficult to recognize correct device being tested, which is required in ./framework/test_case.py  "wirespeed" to provide bitrate for particular NIC.



Initially we added support for 10G only but, we planed to have support for our 40G NIC also.



More acceptable way to do this might be having a global variable for linkspeed and using it further in
./framework/test_case.py or elsewhere.
User can provide linkspeed.

Let us know your thoughts on this.

Thanks and regards
Ayuj Verma






________________________________
From: Radoslaw Biernacki <radoslaw.biernacki at linaro.org<mailto:radoslaw.biernacki at linaro.org>>
Sent: 04 December 2017 16:14
To: dts at dpdk.org<mailto:dts at dpdk.org>; Verma, Ayuj; Jogarao, Nartu
Cc: Herbert Guan; Radoslaw Biernacki; Czubak, Angela; Liu, Yong
Subject: Re: [PATCH 1/4] framework/crb: Fixing ThunderX ethernet controler detection

Ayuj and Jogarao you might also be interested to look at this one.

On 1 December 2017 at 22:20, Radoslaw Biernacki <radoslaw.biernacki at linaro.org<mailto:radoslaw.biernacki at linaro.org>> wrote:
Asking for link speed for ThunderX Ethernet controller is not reliable
since driver report error when the link is down. In fact we dont need
to ask for link speed as Ethernet controllers can be easily identified
by device name from lspci. The mapping will fuhrer filter out the PF
and VF interfaces which does not have the interface name assigned.

Fixes: 150716d93f5e ("framework crb: Appending only 10G devices for cavium")

Signed-off-by: Radoslaw Biernacki <radoslaw.biernacki at linaro.org<mailto:radoslaw.biernacki at linaro.org>>
---
 framework/crb.py | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/framework/crb.py b/framework/crb.py
index dd29a8b..36b1ffe 100644
--- a/framework/crb.py
+++ b/framework/crb.py
@@ -268,20 +268,13 @@ class Crb(object):
         Look for the NIC's information (PCI Id and card type).
         """
         out = self.send_expect(
-            "lspci -Dnn | grep -i eth", "# ", alt_session=True)
+            "lspci -Dnn | grep -i 'Ethernet controller'", "# ", alt_session=True)
         rexp = r"([\da-f]{4}:[\da-f]{2}:[\da-f]{2}.\d{1}) .*Eth.*?ernet .*?([\da-f]{4}:[\da-f]{4})"
         pattern = re.compile(rexp)
         match = pattern.findall(out)
         self.pci_devices_info = []
         for i in range(len(match)):
-            #check if device is cavium and check its linkspeed, append only if it is 10G
-            if "177d:" in match[i][1]:
-                linkspeed = "10000"
-                nic_linkspeed = self.send_command("cat /sys/bus/pci/devices/%s/net/*/speed" % match[i][0])
-                if nic_linkspeed == linkspeed:
-                    self.pci_devices_info.append((match[i][0], match[i][1]))
-            else:
-                self.pci_devices_info.append((match[i][0], match[i][1]))
+            self.pci_devices_info.append((match[i][0], match[i][1]))

     def pci_devices_information_uncached_freebsd(self):
         """
--
2.7.4


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://dpdk.org/ml/archives/dts/attachments/20171205/d85b9a89/attachment.html>


More information about the dts mailing list