From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <nicolas.pernas.maradei@emutex.com>
Received: from smtp.digiweb.ie (smtp2.digiweb.ie [83.147.160.14])
 by dpdk.org (Postfix) with ESMTP id 9D78AC72C
 for <dev@dpdk.org>; Wed, 29 Apr 2015 02:31:24 +0200 (CEST)
Received: from statler.emutex.com (unknown [92.51.199.138])
 by smtp.digiweb.ie (Postfix) with ESMTP id E118B290030;
 Wed, 29 Apr 2015 01:30:20 +0100 (IST)
Received: from 188-141-82-118.dynamic.upc.ie ([188.141.82.118]
 helo=Nicos-MacBook-Pro.local)
 by statler.emutex.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
 (Exim 4.72) (envelope-from <nicolas.pernas.maradei@emutex.com>)
 id 1YnFtM-0004B0-2I; Wed, 29 Apr 2015 01:30:20 +0100
Date: Wed, 29 Apr 2015 01:30:19 +0100
From: =?utf-8?Q?Nicol=C3=A1s_Pernas_Maradei?=
 <nicolas.pernas.maradei@emutex.com>
To: dev@dpdk.org, tero.aho@coriant.com
Message-ID: <etPan.5540261b.2ae8944a.765@Nicos-MacBook-Pro.local>
X-Mailer: Airmail (286)
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
X-Content-Filtered-By: Mailman/MimeDel 2.1.15
Subject: Re: [dpdk-dev] [PATCH 1/3] pcap: utilize underlying real interface
 properties
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Wed, 29 Apr 2015 00:31:24 -0000

Hi Tero,

Just a few comments on one of your patches - see inline comments below. I=
nteresting features btw.

Nico.

--=C2=A0
Nicol=C3=A1s Pernas Maradei


On 27 =46ebruary 2015 at 13:43:14, dev-request=40dpdk.org (dev-request=40=
dpdk.org) wrote:

Message: 5=C2=A0
Date: =46ri, 27 =46eb 2015 15:42:38 +0200=C2=A0
=46rom: Tero Aho <tero.aho=40coriant.com>=C2=A0
To: <dev=40dpdk.org>=C2=A0
Subject: =5Bdpdk-dev=5D =5BPATCH 1/3=5D pcap: utilize underlying real=C2=A0=

interface	properties=C2=A0
Message-ID: <1425044560-23397-2-git-send-email-tero.aho=40coriant.com>=C2=
=A0
Content-Type: text/plain=C2=A0

These changes set pcap interface mac address to the real underlying=C2=A0=

interface address instead of the default one. Also real interface link=C2=
=A0
status, speed and duplex are reported when eth=5Flink=5Fupdate is called=C2=
=A0
for the pcap interface.=C2=A0

Signed-off-by: Tero Aho <tero.aho=40coriant.com>=C2=A0
---=C2=A0
lib/librte=5Fpmd=5Fpcap/rte=5Feth=5Fpcap.c =7C 51 +++++++++++++++++++++++=
++++++++++++---=C2=A0
1 file changed, 47 insertions(+), 4 deletions(-)=C2=A0

diff --git a/lib/librte=5Fpmd=5Fpcap/rte=5Feth=5Fpcap.c b/lib/librte=5Fpm=
d=5Fpcap/rte=5Feth=5Fpcap.c=C2=A0
index 5e94930..289af28 100644=C2=A0
--- a/lib/librte=5Fpmd=5Fpcap/rte=5Feth=5Fpcap.c=C2=A0
+++ b/lib/librte=5Fpmd=5Fpcap/rte=5Feth=5Fpcap.c=C2=A0
=40=40 -43,6 +43,11 =40=40=C2=A0
=23include <rte=5Fdev.h>=C2=A0

=23include <net/if.h>=C2=A0
+=23include <sys/socket.h>=C2=A0
+=23include <sys/ioctl.h>=C2=A0
+=23include <string.h>=C2=A0
+=23include <linux/ethtool.h>=C2=A0
+=23include <linux/sockios.h>=C2=A0

=23include <pcap.h>=C2=A0

=40=40 -102,6 +107,8 =40=40 struct pmd=5Finternals =7B=C2=A0
unsigned nb=5Ftx=5Fqueues;=C2=A0
int if=5Findex;=C2=A0
int single=5Fiface;=C2=A0
+ const char *if=5Fname;=C2=A0
+ int if=5Ffd;=C2=A0
=7D;=C2=A0

const char *valid=5Farguments=5B=5D =3D =7B=C2=A0
=40=40 -451,6 +458,26 =40=40 static int=C2=A0
eth=5Flink=5Fupdate(struct rte=5Feth=5Fdev *dev =5F=5Frte=5Funused,=C2=A0=

*dev is being used. Remove =5F=5Frte=5Funused


int wait=5Fto=5Fcomplete =5F=5Frte=5Funused)=C2=A0
=7B=C2=A0
+ struct ifreq ifr;=C2=A0
+ struct ethtool=5Fcmd cmd;=C2=A0
+ struct pmd=5Finternals *internals =3D dev->data->dev=5Fprivate;=C2=A0
+=C2=A0
+ if (internals->if=5Fname && (internals->if=5Ffd =21=3D -1)) =7B=C2=A0
+ /* get link status, speed and duplex from the underlying interface */=C2=
=A0
+=C2=A0
+ strncpy(ifr.ifr=5Fname, internals->if=5Fname, sizeof(ifr.ifr=5Fname)-1)=
;=C2=A0
+ ifr.ifr=5Fname=5Bsizeof(ifr.ifr=5Fname)-1=5D =3D 0;=C2=A0
Use snprintf(ifr.ifr=5Fname, sizeof(ifr.ifr=5Fname), =E2=80=9C%s=E2=80=9D=
, internals->if=5Fname) instead. It=E2=80=99s safer and cleaner.


+ if (=21ioctl(internals->if=5Ffd, SIOCGI=46=46LAGS, &ifr))=C2=A0
+ dev->data->dev=5Flink.link=5Fstatus =3D (ifr.ifr=5Fflags & I=46=46=5FUP=
) =3F 1 : 0;=C2=A0
+=C2=A0
+ cmd.cmd =3D ETHTOOL=5FGSET;=C2=A0
+ ifr.ifr=5Fdata =3D (void *)&cmd;=C2=A0
+ if (=21ioctl(internals->if=5Ffd, SIOCETHTOOL, &ifr)) =7B=C2=A0
+ dev->data->dev=5Flink.link=5Fspeed =3D ethtool=5Fcmd=5Fspeed(&cmd);=C2=A0=

+ dev->data->dev=5Flink.link=5Fduplex =3D=C2=A0
+ cmd.duplex =3F ETH=5FLINK=5F=46ULL=5FDUPLEX : ETH=5FLINK=5FHAL=46=5FDUP=
LEX;=C2=A0
+ =7D=C2=A0
+ =7D=C2=A0
return 0;=C2=A0
=7D=C2=A0

=40=40 -736,11 +763,24 =40=40 rte=5Fpmd=5Finit=5Finternals(const char *na=
me, const unsigned nb=5Frx=5Fqueues,=C2=A0
(*internals)->nb=5Frx=5Fqueues =3D nb=5Frx=5Fqueues;=C2=A0
(*internals)->nb=5Ftx=5Fqueues =3D nb=5Ftx=5Fqueues;=C2=A0

- if (pair =3D=3D NULL)=C2=A0
+ if (pair =3D=3D NULL) =7B=C2=A0
(*internals)->if=5Findex =3D 0;=C2=A0
- else=C2=A0
+ =7D else =7B=C2=A0
+ /* use real inteface mac addr, save name and fd for eth=5Flink=5Fupdate=
 */=C2=A0
(*internals)->if=5Findex =3D if=5Fnametoindex(pair->value);=C2=A0
-=C2=A0
+ (*internals)->if=5Fname =3D strdup(pair->value);=C2=A0
+ (*internals)->if=5Ffd =3D socket(A=46=5FINET, SOCK=5FDGRAM, 0);=C2=A0
I see you are using a socket and ioctl calls to get the info you need fro=
m the interface. I=E2=80=99m not a big fan of opening a socket at this po=
int just to get some parameters of the NIC. I=E2=80=99d rather reading th=
ose from sysfs. Is there a reason why you=E2=80=99d prefer to open a sock=
et=3F

These would be the files you=E2=80=99d need to open and read to the get t=
he info you are looking for.=C2=A0

=23 cat /sys/class/net/eth0/address
=23 cat /sys/class/net/eth0/duplex
=23 cat /sys/class/net/eth0/speed

In my opinion the code would be cleaner doing it this way. DPDK already m=
anipulates=C2=A0sysfs in other places too.=C2=A0
What do you think=3F


+ if ((*internals)->if=5Ffd =21=3D -1) =7B=C2=A0
+ struct ifreq ifr;=C2=A0
+ strncpy(ifr.ifr=5Fname, pair->value, sizeof(ifr.ifr=5Fname)-1);=C2=A0
+ ifr.ifr=5Fname=5Bsizeof(ifr.ifr=5Fname)-1=5D =3D 0;=C2=A0
Use snprintf() like before.


+ if (=21ioctl((*internals)->if=5Ffd, SIOCGI=46HWADDR, &ifr)) =7B=C2=A0
+ data->mac=5Faddrs =3D rte=5Fzmalloc=5Fsocket(NULL, ETHER=5FADDR=5FLEN, =
0, numa=5Fnode);=C2=A0
+ if (data->mac=5Faddrs)=C2=A0
+ rte=5Fmemcpy(data->mac=5Faddrs, ifr.ifr=5Faddr.sa=5Fdata, ETHER=5FADDR=5F=
LEN);=C2=A0
+ =7D=C2=A0
+ =7D=C2=A0
+ =7D=C2=A0
pci=5Fdev->numa=5Fnode =3D numa=5Fnode;=C2=A0

data->dev=5Fprivate =3D *internals;=C2=A0
=40=40 -749,7 +789,8 =40=40 rte=5Fpmd=5Finit=5Finternals(const char *name=
, const unsigned nb=5Frx=5Fqueues,=C2=A0
data->nb=5Frx=5Fqueues =3D (uint16=5Ft)nb=5Frx=5Fqueues;=C2=A0
data->nb=5Ftx=5Fqueues =3D (uint16=5Ft)nb=5Ftx=5Fqueues;=C2=A0
data->dev=5Flink =3D pmd=5Flink;=C2=A0
- data->mac=5Faddrs =3D &eth=5Faddr;=C2=A0
+ if (data->mac=5Faddrs =3D=3D NULL)=C2=A0
+ data->mac=5Faddrs =3D &eth=5Faddr;=C2=A0
strncpy(data->name,=C2=A0
(*eth=5Fdev)->data->name, strlen((*eth=5Fdev)->data->name));=C2=A0

=40=40 -758,6 +799,8 =40=40 rte=5Fpmd=5Finit=5Finternals(const char *name=
, const unsigned nb=5Frx=5Fqueues,=C2=A0
(*eth=5Fdev)->pci=5Fdev =3D pci=5Fdev;=C2=A0
(*eth=5Fdev)->driver =3D &rte=5Fpcap=5Fpmd;=C2=A0

+ eth=5Flink=5Fupdate((*eth=5Fdev), 0);=C2=A0
+=C2=A0
return 0;=C2=A0

error: if (data)=C2=A0
--=C2=A0
1.9.1=C2=A0


=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=C2=A0
The information contained in this message may be privileged=C2=A0
and confidential and protected from disclosure. If the reader=C2=A0
of this message is not the intended recipient, or an employee=C2=A0
or agent responsible for delivering this message to the=C2=A0
intended recipient, you are hereby notified that any reproduction,=C2=A0
dissemination or distribution of this communication is strictly=C2=A0
prohibited. If you have received this communication in error,=C2=A0
please notify us immediately by replying to the message and=C2=A0
deleting it from your computer. Thank you. Coriant-Tellabs=C2=A0
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=C2=A0


------------------------------=C2=A0

Subject: Digest =46ooter=C2=A0

=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=
=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=C2=A0
dev mailing list=C2=A0
dev=40dpdk.org=C2=A0
http://dpdk.org/ml/listinfo/dev=C2=A0


------------------------------=C2=A0

End of dev Digest, Vol 29, Issue 99=C2=A0
***********************************=C2=A0
>From rkerur@gmail.com  Wed Apr 29 03:15:55 2015
Return-Path: <rkerur@gmail.com>
Received: from mail-ob0-f177.google.com (mail-ob0-f177.google.com
 [209.85.214.177]) by dpdk.org (Postfix) with ESMTP id 5986EC740
 for <dev@dpdk.org>; Wed, 29 Apr 2015 03:15:55 +0200 (CEST)
Received: by obcux3 with SMTP id ux3so9679357obc.2
 for <dev@dpdk.org>; Tue, 28 Apr 2015 18:15:53 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:date:message-id:subject:from:to:content-type;
 bh=MZ4S6lBJpl67DyjGKoevJH7hj1P2/ahlV1nfxWJ6CPw=;
 b=MlHdvUs4IlMw5URRnd8FCPs1PxkZyuqSk6Wem3+AbXe0sX3eOHd3SDgmk2/oSL9TPc
 Lnrs+5BGw+bS9WPki9UN2tg6QokPszOxpfxfodEpqa0PgWFeRZbRrqE5fEwJbcFNkeyD
 E1SatooWejmZst7JVyACc+lnno8tm4KVhebLtnX7uCsUzrRZ4cTIwY/S26NhCSpUzDjO
 HU4BQgzDMMShyYavYUeK8TIaRfVz3EnQs1yBeEJFNZrDvu8fucl4CKGofmJHu94a1+cs
 eIO0DM1sqnBQstBzuVH21PkmBmn2f2CgZ04G0HzmanmWvwhYi+fEnskb12ZJ1fnE/Xs2
 eH0w==
MIME-Version: 1.0
X-Received: by 10.182.39.168 with SMTP id q8mr16869793obk.23.1430270153684;
 Tue, 28 Apr 2015 18:15:53 -0700 (PDT)
Received: by 10.202.179.195 with HTTP; Tue, 28 Apr 2015 18:15:53 -0700 (PDT)
Date: Tue, 28 Apr 2015 18:15:53 -0700
Message-ID: <CAFb4SLBGcR1EHL5FkJ7r6-7mqWR9UJ7GLD2cm18SJ8AuoWu_Og@mail.gmail.com>
From: Ravi Kerur <rkerur@gmail.com>
To: "dev@dpdk.org" <dev@dpdk.org>
Content-Type: text/plain; charset=ISO-8859-1
X-Content-Filtered-By: Mailman/MimeDel 2.1.15
Subject: [dpdk-dev] gmake test on freeBSD
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Wed, 29 Apr 2015 01:15:55 -0000

DPDK team,

Is there a automated tests to run on freeBSD similar to Linux (make test).

I ran "gmake test T=x86_64-native-bsdapp-clang CC=clang" I get following
output

/usr/home/rkerur/dpdk-validate-abi-1/dpdk/build/app/test -c f -n 4

Test name                      Test result                      Test
Total
================================================================================
Start group_1:                 Fail [Can't run]              [00m 00s]
Timer autotest:                Fail [Can't run]              [00m 00s]
Debug autotest:                Fail [Can't run]              [00m 00s]
Errno autotest:                Fail [Can't run]              [00m 00s]
Meter autotest:                Fail [Can't run]              [00m 00s]
Common autotest:               Fail [Can't run]              [00m 00s]
Dump log history:              Fail [Can't run]              [00m 00s]
...
Start memcpy_perf:             Fail [No prompt]              [00m 00s]
Memcpy performance autotest:   Fail [No prompt]              [00m 00s] [00m
01s]
Start hash_perf:               Fail [No prompt]              [00m 00s]
Hash performance autotest:     Fail [No prompt]              [00m 00s] [00m
01s]
Start power:                   Fail [No prompt]              [00m 00s]
Power autotest:                Fail [No prompt]              [00m 00s] [00m
01s]
...

I have contigmem and nic_uio installed. I know some applications are
linuxapp specific but wanted to know if there is a similar automated test
tool like Linux?

Thanks,
Ravi