From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f46.google.com (mail-wm0-f46.google.com [74.125.82.46]) by dpdk.org (Postfix) with ESMTP id 7AD5D271 for ; Mon, 4 Dec 2017 11:45:14 +0100 (CET) Received: by mail-wm0-f46.google.com with SMTP id 9so4894725wme.4 for ; Mon, 04 Dec 2017 02:45:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=6+xL+eB5GBWNdsPduOb2T+3iR9qW86Cn88Z/BKDmhEg=; b=Uogp2HoB0agNNXo3RhQdrwK9tVp8yKkxzLbsrtNRiCqhD6fvX+ACcrFNUSglDaYHzK m8AE4xbg35KZhddJKAsr7qgjKflfA5z9vSWom6827rDQ94uMWo2Lzbp1ElPfwQbocZj0 iRgCDxuVVjJm36nn/jq8sb3p8xGwxcTqVM6b8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=6+xL+eB5GBWNdsPduOb2T+3iR9qW86Cn88Z/BKDmhEg=; b=mxVZjgY4+oD0hnCmlXP5nhWZRepcYezqq/yyFhW+QY7XwF1W2U0VlRSSlTVboyGAcZ 93ZZK0B7LoLyCLQTZ03iUorXfQKrNQXkZgaI0ThI7MCUAWTDPNbXUgN6p5GfLDOXUbSC DpkbLJR8Ym9LSS6bNpO3S/lhrRYEX6+Desd1kCOU+2eIAzvsJN0mAVj3191CTcww7RA6 ixK/WUqAc7J48/cPR3KBYBlE7dnkKacD3jRQUtDC/Jl5ps72q2uZzz/IjdqCjeyVDoGE KrUdWPyVud5Lurf0zo2zkqaZoA/HwHRR6QVl/5lQiviRZMsBEOJWTVwh/pCcNpMJJmh3 yXVQ== X-Gm-Message-State: AJaThX6zwRqJ2rGMeWwMzT4des5NRTd+sBrUD9gLbplIKMRBJyVn9bsF 9TRfnmnYCqoX1OsCrSEXqWgaGWwMah5cI4Ft++xVedWT8lc= X-Google-Smtp-Source: AGs4zMazfW6u1rstDnCr1DwI+K7wn61zKvrTrWx/0j3tAYkvQcsEzjI/sxfJt4QPTPUFdKstzkfCoq35NHdJ4rAm0d4= X-Received: by 10.28.172.66 with SMTP id v63mr6631844wme.37.1512384313971; Mon, 04 Dec 2017 02:45:13 -0800 (PST) MIME-Version: 1.0 Received: by 10.223.163.25 with HTTP; Mon, 4 Dec 2017 02:44:53 -0800 (PST) In-Reply-To: <1512163254-31552-2-git-send-email-radoslaw.biernacki@linaro.org> References: <1512163254-31552-1-git-send-email-radoslaw.biernacki@linaro.org> <1512163254-31552-2-git-send-email-radoslaw.biernacki@linaro.org> From: Radoslaw Biernacki Date: Mon, 4 Dec 2017 11:44:53 +0100 Message-ID: To: dts@dpdk.org, Ayuj.Verma@cavium.com, Nartu.Jogarao@cavium.com Cc: Herbert Guan , Radoslaw Biernacki , aczubak@caviumnetworks.com, "Liu, Yong" Content-Type: multipart/alternative; boundary="001a1141e774cc704e055f8169c8" Subject: Re: [dts] [PATCH 1/4] framework/crb: Fixing ThunderX ethernet controler detection X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Dec 2017 10:45:14 -0000 --001a1141e774cc704e055f8169c8 Content-Type: text/plain; charset="UTF-8" Ayuj and Jogarao you might also be interested to look at this one. On 1 December 2017 at 22:20, Radoslaw Biernacki < radoslaw.biernacki@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 > --- > 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 > > --001a1141e774cc704e055f8169c8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Ayuj and Jogarao you might also be interested to look at t= his one.

On = 1 December 2017 at 22:20, Radoslaw Biernacki <radoslaw.bierna= cki@linaro.org> wrote:
Aski= ng 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 ca= vium")

Signed-off-by: Radoslaw Biernacki <radoslaw.biernacki@linaro.org>
---
=C2=A0framework/crb.py | 11 ++---------
=C2=A01 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):
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Look for the NIC's information (PCI I= d and card type).
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"""
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0out =3D self.send_expect(
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "lspci -Dnn | grep -i eth&q= uot;, "# ", alt_session=3DTrue)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "lspci -Dnn | grep -i '= Ethernet controller'", "# ", alt_session=3DTrue)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0rexp =3D r"([\da-f]{4}:[\da-f]{2}:[\= da-f]{2}.\d{1}) .*Eth.*?ernet .*?([\da-f]{4}:[\da-f]{4})"
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0pattern =3D re.compile(rexp)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0match =3D pattern.findall(out)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0self.pci_devices_info =3D []
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0for i in range(len(match)):
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 #check if device is cavium and c= heck its linkspeed, append only if it is 10G
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if "177d:" in match[i]= [1]:
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 linkspeed =3D &quo= t;10000"
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 nic_linkspeed =3D = self.send_command("cat /sys/bus/pci/devices/%s/net/*/speed" = % match[i][0])
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if nic_linkspeed = =3D=3D linkspeed:
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self= .pci_devices_info.append((match[i][0], match[i][1]))
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 else:
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.pci_devices_i= nfo.append((match[i][0], match[i][1]))
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.pci_devices_info.append((match[i][0], match[i][1]))

=C2=A0 =C2=A0 =C2=A0def pci_devices_information_uncached_freebsd(self)= :
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"""
--
2.7.4


--001a1141e774cc704e055f8169c8--