* [PATCH net-next] bpf: samples: Fix compile of test_lru_dist.c
@ 2016-11-28 4:32 David Ahern
2016-11-28 9:17 ` Daniel Borkmann
0 siblings, 1 reply; 3+ messages in thread
From: David Ahern @ 2016-11-28 4:32 UTC (permalink / raw)
To: netdev; +Cc: David Ahern, Martin KaFai Lau
Build of samples/bpf on debian/jessie fails with:
HOSTCC /home/dsa/kernel-3.git/samples/bpf/test_lru_dist.o
/home/dsa/kernel-3.git/samples/bpf/test_lru_dist.c: In function ‘main’:
/home/dsa/kernel-3.git/samples/bpf/test_lru_dist.c:490:9: error: variable ‘r’ has initializer but incomplete type
struct rlimit r = {RLIM_INFINITY, RLIM_INFINITY};
^
/home/dsa/kernel-3.git/samples/bpf/test_lru_dist.c:490:21: error: ‘RLIM_INFINITY’ undeclared (first use in this function)
struct rlimit r = {RLIM_INFINITY, RLIM_INFINITY};
^
/home/dsa/kernel-3.git/samples/bpf/test_lru_dist.c:490:21: note: each undeclared identifier is reported only once for each function it appears in
/home/dsa/kernel-3.git/samples/bpf/test_lru_dist.c:490:9: warning: excess elements in struct initializer
struct rlimit r = {RLIM_INFINITY, RLIM_INFINITY};
^
/home/dsa/kernel-3.git/samples/bpf/test_lru_dist.c:490:9: warning: (near initialization for ‘r’)
/home/dsa/kernel-3.git/samples/bpf/test_lru_dist.c:490:9: warning: excess elements in struct initializer
/home/dsa/kernel-3.git/samples/bpf/test_lru_dist.c:490:9: warning: (near initialization for ‘r’)
/home/dsa/kernel-3.git/samples/bpf/test_lru_dist.c:490:16: error: storage size of ‘r’ isn’t known
struct rlimit r = {RLIM_INFINITY, RLIM_INFINITY};
Add sys/resource.h to the include list
Fixes: 5db58faf989f ("bpf: Add tests for the LRU bpf_htab")
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
Cc: Martin KaFai Lau <kafai@fb.com>
---
samples/bpf/test_lru_dist.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/samples/bpf/test_lru_dist.c b/samples/bpf/test_lru_dist.c
index 2859977b7f37..bc4a2142eb91 100644
--- a/samples/bpf/test_lru_dist.c
+++ b/samples/bpf/test_lru_dist.c
@@ -16,6 +16,7 @@
#include <sched.h>
#include <sys/wait.h>
#include <sys/stat.h>
+#include <sys/resource.h>
#include <fcntl.h>
#include <stdlib.h>
#include <time.h>
--
2.1.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] bpf: samples: Fix compile of test_lru_dist.c
2016-11-28 4:32 [PATCH net-next] bpf: samples: Fix compile of test_lru_dist.c David Ahern
@ 2016-11-28 9:17 ` Daniel Borkmann
2016-11-28 19:36 ` Martin Lau
0 siblings, 1 reply; 3+ messages in thread
From: Daniel Borkmann @ 2016-11-28 9:17 UTC (permalink / raw)
To: David Ahern, netdev; +Cc: Martin KaFai Lau, ast
On 11/28/2016 05:32 AM, David Ahern wrote:
> Build of samples/bpf on debian/jessie fails with:
>
> HOSTCC /home/dsa/kernel-3.git/samples/bpf/test_lru_dist.o
> /home/dsa/kernel-3.git/samples/bpf/test_lru_dist.c: In function ‘main’:
> /home/dsa/kernel-3.git/samples/bpf/test_lru_dist.c:490:9: error: variable ‘r’ has initializer but incomplete type
> struct rlimit r = {RLIM_INFINITY, RLIM_INFINITY};
> ^
> /home/dsa/kernel-3.git/samples/bpf/test_lru_dist.c:490:21: error: ‘RLIM_INFINITY’ undeclared (first use in this function)
> struct rlimit r = {RLIM_INFINITY, RLIM_INFINITY};
> ^
> /home/dsa/kernel-3.git/samples/bpf/test_lru_dist.c:490:21: note: each undeclared identifier is reported only once for each function it appears in
> /home/dsa/kernel-3.git/samples/bpf/test_lru_dist.c:490:9: warning: excess elements in struct initializer
> struct rlimit r = {RLIM_INFINITY, RLIM_INFINITY};
> ^
> /home/dsa/kernel-3.git/samples/bpf/test_lru_dist.c:490:9: warning: (near initialization for ‘r’)
> /home/dsa/kernel-3.git/samples/bpf/test_lru_dist.c:490:9: warning: excess elements in struct initializer
> /home/dsa/kernel-3.git/samples/bpf/test_lru_dist.c:490:9: warning: (near initialization for ‘r’)
> /home/dsa/kernel-3.git/samples/bpf/test_lru_dist.c:490:16: error: storage size of ‘r’ isn’t known
> struct rlimit r = {RLIM_INFINITY, RLIM_INFINITY};
>
> Add sys/resource.h to the include list
>
> Fixes: 5db58faf989f ("bpf: Add tests for the LRU bpf_htab")
> Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
> Cc: Martin KaFai Lau <kafai@fb.com>
Ran into the same issue, fixed here already:
https://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/commit/?id=e00c7b216f34444252f3771f7d4ed48d4f032636
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] bpf: samples: Fix compile of test_lru_dist.c
2016-11-28 9:17 ` Daniel Borkmann
@ 2016-11-28 19:36 ` Martin Lau
0 siblings, 0 replies; 3+ messages in thread
From: Martin Lau @ 2016-11-28 19:36 UTC (permalink / raw)
To: Daniel Borkmann, David Ahern, netdev@vger.kernel.org; +Cc: Alexei Starovoitov
On Mon, Nov 28, 2016 at 10:17:23AM +0100, Daniel Borkmann wrote:
> On 11/28/2016 05:32 AM, David Ahern wrote:
> >Build of samples/bpf on debian/jessie fails with:
> >
> > HOSTCC /home/dsa/kernel-3.git/samples/bpf/test_lru_dist.o
> >/home/dsa/kernel-3.git/samples/bpf/test_lru_dist.c: In function ‘main’:
> >/home/dsa/kernel-3.git/samples/bpf/test_lru_dist.c:490:9: error: variable ‘r’ has initializer but incomplete type
> > struct rlimit r = {RLIM_INFINITY, RLIM_INFINITY};
> > ^
> >/home/dsa/kernel-3.git/samples/bpf/test_lru_dist.c:490:21: error: ‘RLIM_INFINITY’ undeclared (first use in this function)
> > struct rlimit r = {RLIM_INFINITY, RLIM_INFINITY};
> > ^
> >/home/dsa/kernel-3.git/samples/bpf/test_lru_dist.c:490:21: note: each undeclared identifier is reported only once for each function it appears in
> >/home/dsa/kernel-3.git/samples/bpf/test_lru_dist.c:490:9: warning: excess elements in struct initializer
> > struct rlimit r = {RLIM_INFINITY, RLIM_INFINITY};
> > ^
> >/home/dsa/kernel-3.git/samples/bpf/test_lru_dist.c:490:9: warning: (near initialization for ‘r’)
> >/home/dsa/kernel-3.git/samples/bpf/test_lru_dist.c:490:9: warning: excess elements in struct initializer
> >/home/dsa/kernel-3.git/samples/bpf/test_lru_dist.c:490:9: warning: (near initialization for ‘r’)
> >/home/dsa/kernel-3.git/samples/bpf/test_lru_dist.c:490:16: error: storage size of ‘r’ isn’t known
> > struct rlimit r = {RLIM_INFINITY, RLIM_INFINITY};
> >
> >Add sys/resource.h to the include list
> >
> >Fixes: 5db58faf989f ("bpf: Add tests for the LRU bpf_htab")
> >Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
> >Cc: Martin KaFai Lau <kafai@fb.com>
>
> Ran into the same issue, fixed here already:
>
> https://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/commit/?id=e00c7b216f34444252f3771f7d4ed48d4f032636
Thanks for David's report/patch and the earlier Daniel's fix. Sorry that I
missed it since it compiles fine in my current dev setup (CentOS6). I
can also reproduce in my newer arch-linux setup.
--Martin
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-11-28 19:37 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-28 4:32 [PATCH net-next] bpf: samples: Fix compile of test_lru_dist.c David Ahern
2016-11-28 9:17 ` Daniel Borkmann
2016-11-28 19:36 ` Martin Lau
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).