[dpdk-dev] [PATCH] eal/linux: fix build with glibc < 2.12

2016-06-20 Thread Thomas Monjalon
2016-06-19 23:11, Thomas Monjalon:
> The function rte_thread_setname needs glibc 2.12,
> otherwise it returns -1 without using any parameter.
> The macro RTE_SET_USED avoids an "unused parameter" warning.
> 
> Fixes: 3901ed99c2f8 ("eal: fix thread naming on FreeBSD")
> 
> Signed-off-by: Thomas Monjalon 

Applied


[dpdk-dev] [PATCH] eal/linux: fix build with glibc < 2.12

2016-06-20 Thread Thomas Monjalon
The function rte_thread_setname needs glibc 2.12,
otherwise it returns -1 without using any parameter.
The macro RTE_SET_USED avoids an "unused parameter" warning.

Fixes: 3901ed99c2f8 ("eal: fix thread naming on FreeBSD")

Signed-off-by: Thomas Monjalon 
---
 lib/librte_eal/linuxapp/eal/eal_thread.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/librte_eal/linuxapp/eal/eal_thread.c 
b/lib/librte_eal/linuxapp/eal/eal_thread.c
index 8c3bf03..9f88530 100644
--- a/lib/librte_eal/linuxapp/eal/eal_thread.c
+++ b/lib/librte_eal/linuxapp/eal/eal_thread.c
@@ -206,5 +206,7 @@ int rte_thread_setname(pthread_t id, const char *name)
ret = pthread_setname_np(id, name);
 #endif
 #endif
+   RTE_SET_USED(id);
+   RTE_SET_USED(name);
return ret;
 }
-- 
2.7.0



[dpdk-dev] [PATCH] eal/linux: fix build

2015-03-05 Thread Thomas Monjalon
Hi Michael,

2015-03-05 09:13, Qiu, Michael:
> On 3/4/2015 6:24 AM, Thomas Monjalon wrote:
> >>> Compilation fails in some distributions because of missing unistd.h
> >>> needed for pread/pwrite (seen with Suse):
> >>> lib/librte_eal/linuxapp/eal/eal_pci_uio.c:62:2:
> >>> error: implicit declaration of function ?pread?
> >>>
> >>> Fixes: 4a499c649590 ("eal/linux: enable uio_pci_generic support")
> >>>
> >>> Signed-off-by: Thomas Monjalon 
> >> Acked-by: David Marchand 
> > Applied
> 
> Hi, Thomas
> 
> This patch may be need to be reverted, as the error still exists.

No I don't think it should be reverted. It must be completed.

[...]
> NAME
>pread, pwrite - read from or write to a file descriptor at a
> given offset
> 
> SYNOPSIS
>#define _XOPEN_SOURCE 500
> 
>#include 
[...]
> While I try to add marco #define _XOPEN_SOURCE 500

I think that the good thing to do.

> Other errors show up

Are they hard to fix?

> Who knows how to solve this issue?



[dpdk-dev] [PATCH] eal/linux: fix build

2015-03-05 Thread Ananyev, Konstantin


> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Qiu, Michael
> Sent: Thursday, March 05, 2015 9:13 AM
> To: Thomas Monjalon; David Marchand
> Cc: dev at dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] eal/linux: fix build
> 
> On 3/4/2015 6:24 AM, Thomas Monjalon wrote:
> >>> Compilation fails in some distributions because of missing unistd.h
> >>> needed for pread/pwrite (seen with Suse):
> >>> lib/librte_eal/linuxapp/eal/eal_pci_uio.c:62:2:
> >>> error: implicit declaration of function 'pread'
> >>>
> >>> Fixes: 4a499c649590 ("eal/linux: enable uio_pci_generic support")
> >>>
> >>> Signed-off-by: Thomas Monjalon 
> >> Acked-by: David Marchand 
> > Applied
> 
> Hi, Thomas
> 
> This patch may be need to be reverted, as the error still exists.
> 
> suse-11-sp3-32:~/dpdk # uname -a
> Linux suse-11-sp3-32 3.0.76-0.11-pae #1 SMP Fri Jun 14 08:21:43 UTC 2013
> (ccab990) i686 i686 i386 GNU/Linux
> 
> suse-11-sp3-32:~/dpdk # gcc -v
> Using built-in specs.
> COLLECT_GCC=gcc
> COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/i686-pc-linux-gnu/4.5.1/lto-wrapper
> Target: i686-pc-linux-gnu
> Configured with: ./configure
> Thread model: posix
> gcc version 4.5.1 (GCC)
> 
> As I try to check the manual of pread, find that it has two:
> --
> Man: find all matching manual pages
>  * pread (2)
>pread (3p)
> Man: What manual page do you want?
> Man:
> -
> PREAD(2) Linux
> Programmer's
> ManualPREAD(2)
> 
> 
> 
> NAME
>pread, pwrite - read from or write to a file descriptor at a
> given offset
> 
> SYNOPSIS
>#define _XOPEN_SOURCE 500
> 
>#include 
> 
>ssize_t pread(int fd, void *buf, size_t count, off_t offset);
> 
>ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset);
> 
> 
> 
> READ(3P) POSIX
> Programmer's
> ManualREAD(3P)
> 
> 
> 
> PROLOG
>This  manual page is part of the POSIX Programmer's Manual.  The
> Linux implementation of this interface may differ (consult the
> corresponding Linux
>manual page for details of Linux behavior), or the interface may
> not be implemented on Linux.
> 
> NAME
>pread, read - read from a file
> 
> SYNOPSIS
>#include 
> 
> 
> 
>ssize_t pread(int fildes, void *buf, size_t nbyte, off_t offset);
>ssize_t read(int fildes, void *buf, size_t nbyte);
> 
> 
> DESCRIPTION
> 
> --
> 
> While I try to add marco #define _XOPEN_SOURCE 500
> 
> Other errors show up
> 
> Who knows how to solve this issue?
> 
> Thanks,
> Michael
> 
> >

Can you try to add:
CFLAGS_.o := -D_GNU_SOURCE

to your Makefile?

Konstantin


[dpdk-dev] [PATCH] eal/linux: fix build

2015-03-05 Thread Qiu, Michael
On 3/4/2015 6:24 AM, Thomas Monjalon wrote:
>>> Compilation fails in some distributions because of missing unistd.h
>>> needed for pread/pwrite (seen with Suse):
>>> lib/librte_eal/linuxapp/eal/eal_pci_uio.c:62:2:
>>> error: implicit declaration of function ?pread?
>>>
>>> Fixes: 4a499c649590 ("eal/linux: enable uio_pci_generic support")
>>>
>>> Signed-off-by: Thomas Monjalon 
>> Acked-by: David Marchand 
> Applied

Hi, Thomas

This patch may be need to be reverted, as the error still exists.

suse-11-sp3-32:~/dpdk # uname -a
Linux suse-11-sp3-32 3.0.76-0.11-pae #1 SMP Fri Jun 14 08:21:43 UTC 2013
(ccab990) i686 i686 i386 GNU/Linux

suse-11-sp3-32:~/dpdk # gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/i686-pc-linux-gnu/4.5.1/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ./configure
Thread model: posix
gcc version 4.5.1 (GCC)

As I try to check the manual of pread, find that it has two:
--
Man: find all matching manual pages
 * pread (2)
   pread (3p)
Man: What manual page do you want?
Man:
-
PREAD(2) Linux
Programmer's
ManualPREAD(2)



NAME
   pread, pwrite - read from or write to a file descriptor at a
given offset

SYNOPSIS
   #define _XOPEN_SOURCE 500

   #include 

   ssize_t pread(int fd, void *buf, size_t count, off_t offset);

   ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset);



READ(3P) POSIX
Programmer's
ManualREAD(3P)



PROLOG
   This  manual page is part of the POSIX Programmer's Manual.  The
Linux implementation of this interface may differ (consult the
corresponding Linux
   manual page for details of Linux behavior), or the interface may
not be implemented on Linux.

NAME
   pread, read - read from a file

SYNOPSIS
   #include 



   ssize_t pread(int fildes, void *buf, size_t nbyte, off_t offset);
   ssize_t read(int fildes, void *buf, size_t nbyte);


DESCRIPTION

--

While I try to add marco #define _XOPEN_SOURCE 500

Other errors show up

Who knows how to solve this issue?

Thanks,
Michael

>



[dpdk-dev] [PATCH] eal/linux: fix build

2015-03-03 Thread Thomas Monjalon
> > Compilation fails in some distributions because of missing unistd.h
> > needed for pread/pwrite (seen with Suse):
> > lib/librte_eal/linuxapp/eal/eal_pci_uio.c:62:2:
> > error: implicit declaration of function ?pread?
> >
> > Fixes: 4a499c649590 ("eal/linux: enable uio_pci_generic support")
> >
> > Signed-off-by: Thomas Monjalon 
> Acked-by: David Marchand 

Applied



[dpdk-dev] [PATCH] eal/linux: fix build

2015-03-03 Thread David Marchand
On Tue, Mar 3, 2015 at 9:44 AM, Thomas Monjalon 
wrote:

> Compilation fails in some distributions because of missing unistd.h
> needed for pread/pwrite (seen with Suse):
> lib/librte_eal/linuxapp/eal/eal_pci_uio.c:62:2:
> error: implicit declaration of function ?pread?
>
> Fixes: 4a499c649590 ("eal/linux: enable uio_pci_generic support")
>
> Signed-off-by: Thomas Monjalon 
> ---
>  lib/librte_eal/linuxapp/eal/eal_pci_uio.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/lib/librte_eal/linuxapp/eal/eal_pci_uio.c
> b/lib/librte_eal/linuxapp/eal/eal_pci_uio.c
> index 35d31c5..0b397ca 100644
> --- a/lib/librte_eal/linuxapp/eal/eal_pci_uio.c
> +++ b/lib/librte_eal/linuxapp/eal/eal_pci_uio.c
> @@ -32,6 +32,7 @@
>   */
>
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
>
>
Acked-by: David Marchand 

-- 
David Marchand


[dpdk-dev] [PATCH] eal/linux: fix build

2015-03-03 Thread Thomas Monjalon
Compilation fails in some distributions because of missing unistd.h
needed for pread/pwrite (seen with Suse):
lib/librte_eal/linuxapp/eal/eal_pci_uio.c:62:2:
error: implicit declaration of function ?pread?

Fixes: 4a499c649590 ("eal/linux: enable uio_pci_generic support")

Signed-off-by: Thomas Monjalon 
---
 lib/librte_eal/linuxapp/eal/eal_pci_uio.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/librte_eal/linuxapp/eal/eal_pci_uio.c 
b/lib/librte_eal/linuxapp/eal/eal_pci_uio.c
index 35d31c5..0b397ca 100644
--- a/lib/librte_eal/linuxapp/eal/eal_pci_uio.c
+++ b/lib/librte_eal/linuxapp/eal/eal_pci_uio.c
@@ -32,6 +32,7 @@
  */

 #include 
+#include 
 #include 
 #include 
 #include 
-- 
2.2.2