From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by dpdk.org (Postfix) with ESMTP id 45450239 for ; Mon, 4 Dec 2017 14:58:04 +0100 (CET) Received: by mail-wm0-f65.google.com with SMTP id f140so14437590wmd.2 for ; Mon, 04 Dec 2017 05:58:04 -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=MrVecI9xGusNZDnbPIYVoKfDi2siJ1DCnukfeZ+MNfg=; b=YQ68Hxw4id69dSK6aU4oTXxNi2fvhtcyNCX8O6iMxdVMm/1B2t4v0+Y5lZ4OF5mYXU 8jvtaXmgaC2stgzPH/EI3KRinzoVQimzySZoNQly9YmLi393+wDvjdS/X6J3ogjyfnnL UzrSfAzrWezKAEYR7dk9siLoi1D/a9HzSsawc= 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=MrVecI9xGusNZDnbPIYVoKfDi2siJ1DCnukfeZ+MNfg=; b=FkuxdwNfV2J3x2JndVk1YuGm8oi2ZWoH8JjLfIdf/Y20KtoZRvGS1i9P5MnWPTYr9E 9CES//6n5ral+IYQFWw0cc0JaXLEExHYwv6KnUw47v7SSRBPh29nLkjqMzEHOqYz6321 YBjDOXZOfDuc2ZljVYNLKIlMtnLZvjhKNZLVvFyfMcqvwtx8pn8WECDpLYZnVO2IF9E2 Xjr1YMoBdfQSPic3yM9mmxqNFXNFJLAw3ugEm54t0X2nTV6NMFvjC13LbQMIo25L36Ou Az5Oo4w7soPH/wZd+yTIdcKj7XpsVODXP4aWEHJaxmncWmwvEYfPIS+SyTFC+czkwjlg 1hGw== X-Gm-Message-State: AKGB3mJ+2erEh4IuSpkUodZxssvlrSRlTciiFUqcdQXMfea4UMB5UAhJ EfdZSepNEPnmoF5eMX+WQ5sgds/ON9rybWNcVBikOg== X-Google-Smtp-Source: AGs4zMZZ6KyZhZF3eQTN9nar+LIhdZcrm3KTlX/2Hv8eDiszJjNkkrq8+f4F+4BPgFyzE0OtjeePjvZii0CyEnh3rd0= X-Received: by 10.28.88.65 with SMTP id m62mr8322498wmb.111.1512395883857; Mon, 04 Dec 2017 05:58:03 -0800 (PST) MIME-Version: 1.0 Received: by 10.223.163.25 with HTTP; Mon, 4 Dec 2017 05:57:43 -0800 (PST) In-Reply-To: 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 14:57:43 +0100 Message-ID: To: "Verma, Ayuj" Cc: "dts@dpdk.org" , "Jogarao, Nartu" , Herbert Guan , "Czubak, Angela" , "Liu, Yong" , "Desai, Arvind" , "Athreya, Narayana Prasad" Content-Type: multipart/alternative; boundary="001a114429ce6af802055f841b0d" 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 13:58:04 -0000 --001a114429ce6af802055f841b0d Content-Type: text/plain; charset="UTF-8" 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 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 > *Sent:* 04 December 2017 16:14 > *To:* dts@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@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 > > > --001a114429ce6af802055f841b0d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

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

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

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

<= div class=3D"gmail_quote">On 4 December 2017 at 13:12, Verma, Ayuj <Ay= uj.Verma@cavium.com> wrote:

Hi Biernacki,


Thanks for the heads up.

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


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


More acceptable way to do this mi= ght be having a global variable for linkspeed and using it further in=C2=A0=

./framework/test_case.py or elsewhere.
User can provide linkspeed.

Let us know your thoughts on this.

Thanks and regards
Ayuj Verma






Ayuj and Jogarao you might also be interested to look at t= his one.

On 1 December 2017 at 22:= 20, Radoslaw Biernacki <rado= slaw.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 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



--001a114429ce6af802055f841b0d--