* [PATCH net-next 0/3] Misc BPF cleanup
@ 2017-04-24 13:31 Alexander Alemayhu
2017-04-24 13:31 ` [PATCH net-next 1/3] samples/bpf: add -Wno-unknown-warning-option to clang Alexander Alemayhu
` (4 more replies)
0 siblings, 5 replies; 11+ messages in thread
From: Alexander Alemayhu @ 2017-04-24 13:31 UTC (permalink / raw)
To: netdev; +Cc: Alexander Alemayhu, daniel, ast
Hei,
while looking into making the Makefile in samples/bpf better handle O= I saw
several warnings when running `make clean && make samples/bpf/`. This series
reduces those warnings.
Thanks.
Alexander Alemayhu (3):
samples/bpf: add -Wno-unknown-warning-option to clang
samples/bpf: add static to function with no prototype
samples/bpf: check before defining offsetof
samples/bpf/Makefile | 1 +
samples/bpf/cookie_uid_helper_example.c | 2 +-
samples/bpf/test_lru_dist.c | 4 +++-
3 files changed, 5 insertions(+), 2 deletions(-)
--
2.9.3
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH net-next 1/3] samples/bpf: add -Wno-unknown-warning-option to clang
2017-04-24 13:31 [PATCH net-next 0/3] Misc BPF cleanup Alexander Alemayhu
@ 2017-04-24 13:31 ` Alexander Alemayhu
2017-04-24 14:37 ` Daniel Borkmann
2017-04-24 13:31 ` [PATCH net-next 2/3] samples/bpf: add static to function with no prototype Alexander Alemayhu
` (3 subsequent siblings)
4 siblings, 1 reply; 11+ messages in thread
From: Alexander Alemayhu @ 2017-04-24 13:31 UTC (permalink / raw)
To: netdev; +Cc: Alexander Alemayhu, daniel, ast
I was initially going to remove '-Wno-address-of-packed-member' because I
thought it was not supposed to be there but Daniel suggested using
'-Wno-unknown-warning-option'.
This silences several warnings similiar to the one below
warning: unknown warning option '-Wno-address-of-packed-member' [-Wunknown-warning-option]
1 warning generated.
clang -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/6.3.1/include -I./arch/x86/include -I./arch/x86/include/generated/uapi -I./arch/x86/include/generated -I./include
-I./arch/x86/include/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/kconfig.h \
-D__KERNEL__ -D__ASM_SYSREG_H -Wno-unused-value -Wno-pointer-sign \
-Wno-compare-distinct-pointer-types \
-Wno-gnu-variable-sized-type-not-at-end \
-Wno-address-of-packed-member -Wno-tautological-compare \
-O2 -emit-llvm -c samples/bpf/xdp_tx_iptunnel_kern.c -o -| llc -march=bpf -filetype=obj -o samples/bpf/xdp_tx_iptunnel_kern.o
$ clang --version
clang version 3.9.1 (tags/RELEASE_391/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Signed-off-by: Alexander Alemayhu <alexander@alemayhu.com>
---
samples/bpf/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile
index d42b495b0992..6c7468eb3684 100644
--- a/samples/bpf/Makefile
+++ b/samples/bpf/Makefile
@@ -189,4 +189,5 @@ $(obj)/%.o: $(src)/%.c
-Wno-compare-distinct-pointer-types \
-Wno-gnu-variable-sized-type-not-at-end \
-Wno-address-of-packed-member -Wno-tautological-compare \
+ -Wno-unknown-warning-option \
-O2 -emit-llvm -c $< -o -| $(LLC) -march=bpf -filetype=obj -o $@
--
2.9.3
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH net-next 2/3] samples/bpf: add static to function with no prototype
2017-04-24 13:31 [PATCH net-next 0/3] Misc BPF cleanup Alexander Alemayhu
2017-04-24 13:31 ` [PATCH net-next 1/3] samples/bpf: add -Wno-unknown-warning-option to clang Alexander Alemayhu
@ 2017-04-24 13:31 ` Alexander Alemayhu
2017-04-24 14:40 ` Daniel Borkmann
2017-04-24 13:31 ` [PATCH net-next 3/3] samples/bpf: check before defining offsetof Alexander Alemayhu
` (2 subsequent siblings)
4 siblings, 1 reply; 11+ messages in thread
From: Alexander Alemayhu @ 2017-04-24 13:31 UTC (permalink / raw)
To: netdev; +Cc: Alexander Alemayhu, daniel, ast
Fixes the following warning
samples/bpf/cookie_uid_helper_example.c: At top level:
samples/bpf/cookie_uid_helper_example.c:276:6: warning: no previous prototype for ‘finish’ [-Wmissing-prototypes]
void finish(int ret)
^~~~~~
HOSTLD samples/bpf/per_socket_stats_example
Signed-off-by: Alexander Alemayhu <alexander@alemayhu.com>
---
samples/bpf/cookie_uid_helper_example.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/samples/bpf/cookie_uid_helper_example.c b/samples/bpf/cookie_uid_helper_example.c
index ad5afedf2e70..9ce55840d61d 100644
--- a/samples/bpf/cookie_uid_helper_example.c
+++ b/samples/bpf/cookie_uid_helper_example.c
@@ -273,7 +273,7 @@ static int usage(void)
return 1;
}
-void finish(int ret)
+static void finish(int ret)
{
test_finish = true;
}
--
2.9.3
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH net-next 3/3] samples/bpf: check before defining offsetof
2017-04-24 13:31 [PATCH net-next 0/3] Misc BPF cleanup Alexander Alemayhu
2017-04-24 13:31 ` [PATCH net-next 1/3] samples/bpf: add -Wno-unknown-warning-option to clang Alexander Alemayhu
2017-04-24 13:31 ` [PATCH net-next 2/3] samples/bpf: add static to function with no prototype Alexander Alemayhu
@ 2017-04-24 13:31 ` Alexander Alemayhu
2017-04-24 14:41 ` Daniel Borkmann
2017-04-24 14:45 ` [PATCH net-next 0/3] Misc BPF cleanup Alexei Starovoitov
2017-04-24 20:20 ` David Miller
4 siblings, 1 reply; 11+ messages in thread
From: Alexander Alemayhu @ 2017-04-24 13:31 UTC (permalink / raw)
To: netdev; +Cc: Alexander Alemayhu, daniel, ast
Fixes the following warning
samples/bpf/test_lru_dist.c:28:0: warning: "offsetof" redefined
#define offsetof(TYPE, MEMBER) ((size_t)&((TYPE *)0)->MEMBER)
In file included from ./tools/lib/bpf/bpf.h:25:0,
from samples/bpf/libbpf.h:5,
from samples/bpf/test_lru_dist.c:24:
/usr/lib/gcc/x86_64-redhat-linux/6.3.1/include/stddef.h:417:0: note: this is the location of the previous definition
#define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER)
Signed-off-by: Alexander Alemayhu <alexander@alemayhu.com>
---
samples/bpf/test_lru_dist.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/samples/bpf/test_lru_dist.c b/samples/bpf/test_lru_dist.c
index d96dc88d3b04..73c357142268 100644
--- a/samples/bpf/test_lru_dist.c
+++ b/samples/bpf/test_lru_dist.c
@@ -25,7 +25,9 @@
#include "bpf_util.h"
#define min(a, b) ((a) < (b) ? (a) : (b))
-#define offsetof(TYPE, MEMBER) ((size_t)&((TYPE *)0)->MEMBER)
+#ifndef offsetof
+# define offsetof(TYPE, MEMBER) ((size_t)&((TYPE *)0)->MEMBER)
+#endif
#define container_of(ptr, type, member) ({ \
const typeof( ((type *)0)->member ) *__mptr = (ptr); \
(type *)( (char *)__mptr - offsetof(type,member) );})
--
2.9.3
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH net-next 1/3] samples/bpf: add -Wno-unknown-warning-option to clang
2017-04-24 13:31 ` [PATCH net-next 1/3] samples/bpf: add -Wno-unknown-warning-option to clang Alexander Alemayhu
@ 2017-04-24 14:37 ` Daniel Borkmann
0 siblings, 0 replies; 11+ messages in thread
From: Daniel Borkmann @ 2017-04-24 14:37 UTC (permalink / raw)
To: Alexander Alemayhu, netdev; +Cc: ast
On 04/24/2017 03:31 PM, Alexander Alemayhu wrote:
> I was initially going to remove '-Wno-address-of-packed-member' because I
> thought it was not supposed to be there but Daniel suggested using
> '-Wno-unknown-warning-option'.
>
> This silences several warnings similiar to the one below
>
> warning: unknown warning option '-Wno-address-of-packed-member' [-Wunknown-warning-option]
> 1 warning generated.
Yeah, that feature seems fairly new (Feb 2017 accepted if I
see this correctly): https://reviews.llvm.org/D20561
Given the -Wno-address-of-packed-member was there to silence
warnings in the first place, we should also silence warnings
when -Wno-address-of-packed-member is unknown to clang/llvm.
[...]
>
> Signed-off-by: Alexander Alemayhu <alexander@alemayhu.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH net-next 2/3] samples/bpf: add static to function with no prototype
2017-04-24 13:31 ` [PATCH net-next 2/3] samples/bpf: add static to function with no prototype Alexander Alemayhu
@ 2017-04-24 14:40 ` Daniel Borkmann
0 siblings, 0 replies; 11+ messages in thread
From: Daniel Borkmann @ 2017-04-24 14:40 UTC (permalink / raw)
To: Alexander Alemayhu, netdev; +Cc: ast
On 04/24/2017 03:31 PM, Alexander Alemayhu wrote:
> Fixes the following warning
>
> samples/bpf/cookie_uid_helper_example.c: At top level:
> samples/bpf/cookie_uid_helper_example.c:276:6: warning: no previous prototype for ‘finish’ [-Wmissing-prototypes]
> void finish(int ret)
> ^~~~~~
> HOSTLD samples/bpf/per_socket_stats_example
>
> Signed-off-by: Alexander Alemayhu <alexander@alemayhu.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH net-next 3/3] samples/bpf: check before defining offsetof
2017-04-24 13:31 ` [PATCH net-next 3/3] samples/bpf: check before defining offsetof Alexander Alemayhu
@ 2017-04-24 14:41 ` Daniel Borkmann
2017-04-25 14:27 ` David Laight
0 siblings, 1 reply; 11+ messages in thread
From: Daniel Borkmann @ 2017-04-24 14:41 UTC (permalink / raw)
To: Alexander Alemayhu, netdev; +Cc: ast
On 04/24/2017 03:31 PM, Alexander Alemayhu wrote:
> Fixes the following warning
>
> samples/bpf/test_lru_dist.c:28:0: warning: "offsetof" redefined
> #define offsetof(TYPE, MEMBER) ((size_t)&((TYPE *)0)->MEMBER)
>
> In file included from ./tools/lib/bpf/bpf.h:25:0,
> from samples/bpf/libbpf.h:5,
> from samples/bpf/test_lru_dist.c:24:
> /usr/lib/gcc/x86_64-redhat-linux/6.3.1/include/stddef.h:417:0: note: this is the location of the previous definition
> #define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER)
>
> Signed-off-by: Alexander Alemayhu <alexander@alemayhu.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH net-next 0/3] Misc BPF cleanup
2017-04-24 13:31 [PATCH net-next 0/3] Misc BPF cleanup Alexander Alemayhu
` (2 preceding siblings ...)
2017-04-24 13:31 ` [PATCH net-next 3/3] samples/bpf: check before defining offsetof Alexander Alemayhu
@ 2017-04-24 14:45 ` Alexei Starovoitov
2017-04-24 20:20 ` David Miller
4 siblings, 0 replies; 11+ messages in thread
From: Alexei Starovoitov @ 2017-04-24 14:45 UTC (permalink / raw)
To: Alexander Alemayhu, netdev; +Cc: daniel
On 4/24/17 6:31 AM, Alexander Alemayhu wrote:
> Hei,
>
> while looking into making the Makefile in samples/bpf better handle O= I saw
> several warnings when running `make clean && make samples/bpf/`. This series
> reduces those warnings.
Cleanup looks good to me.
Acked-by: Alexei Starovoitov <ast@kernel.org>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH net-next 0/3] Misc BPF cleanup
2017-04-24 13:31 [PATCH net-next 0/3] Misc BPF cleanup Alexander Alemayhu
` (3 preceding siblings ...)
2017-04-24 14:45 ` [PATCH net-next 0/3] Misc BPF cleanup Alexei Starovoitov
@ 2017-04-24 20:20 ` David Miller
4 siblings, 0 replies; 11+ messages in thread
From: David Miller @ 2017-04-24 20:20 UTC (permalink / raw)
To: alexander; +Cc: netdev, daniel, ast
From: Alexander Alemayhu <alexander@alemayhu.com>
Date: Mon, 24 Apr 2017 15:31:05 +0200
> while looking into making the Makefile in samples/bpf better handle O= I saw
> several warnings when running `make clean && make samples/bpf/`. This series
> reduces those warnings.
Series applied, thanks.
^ permalink raw reply [flat|nested] 11+ messages in thread
* RE: [PATCH net-next 3/3] samples/bpf: check before defining offsetof
2017-04-24 14:41 ` Daniel Borkmann
@ 2017-04-25 14:27 ` David Laight
2017-04-26 5:17 ` Alexander Alemayhu
0 siblings, 1 reply; 11+ messages in thread
From: David Laight @ 2017-04-25 14:27 UTC (permalink / raw)
To: 'Daniel Borkmann', Alexander Alemayhu, netdev; +Cc: ast
From: Daniel Borkmann
> Sent: 24 April 2017 15:41
> To: Alexander Alemayhu; netdev@vger.kernel.org
> Cc: ast@fb.com
> Subject: Re: [PATCH net-next 3/3] samples/bpf: check before defining offsetof
>
> On 04/24/2017 03:31 PM, Alexander Alemayhu wrote:
> > Fixes the following warning
> >
> > samples/bpf/test_lru_dist.c:28:0: warning: "offsetof" redefined
> > #define offsetof(TYPE, MEMBER) ((size_t)&((TYPE *)0)->MEMBER)
> >
> > In file included from ./tools/lib/bpf/bpf.h:25:0,
> > from samples/bpf/libbpf.h:5,
> > from samples/bpf/test_lru_dist.c:24:
> > /usr/lib/gcc/x86_64-redhat-linux/6.3.1/include/stddef.h:417:0: note: this is the location of the
> previous definition
> > #define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER)
> >
> > Signed-off-by: Alexander Alemayhu <alexander@alemayhu.com>
>
> Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Isn't the correct fix to include stddef.h ?
David
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH net-next 3/3] samples/bpf: check before defining offsetof
2017-04-25 14:27 ` David Laight
@ 2017-04-26 5:17 ` Alexander Alemayhu
0 siblings, 0 replies; 11+ messages in thread
From: Alexander Alemayhu @ 2017-04-26 5:17 UTC (permalink / raw)
To: David Laight; +Cc: 'Daniel Borkmann', netdev, ast
On Tue, Apr 25, 2017 at 02:27:16PM +0000, David Laight wrote:
>
> Isn't the correct fix to include stddef.h ?
>
If you think it's the correct fix, please send a patch to netdev.
Thanks.
--
Mit freundlichen Grüßen
Alexander Alemayhu
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2017-04-26 5:17 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-24 13:31 [PATCH net-next 0/3] Misc BPF cleanup Alexander Alemayhu
2017-04-24 13:31 ` [PATCH net-next 1/3] samples/bpf: add -Wno-unknown-warning-option to clang Alexander Alemayhu
2017-04-24 14:37 ` Daniel Borkmann
2017-04-24 13:31 ` [PATCH net-next 2/3] samples/bpf: add static to function with no prototype Alexander Alemayhu
2017-04-24 14:40 ` Daniel Borkmann
2017-04-24 13:31 ` [PATCH net-next 3/3] samples/bpf: check before defining offsetof Alexander Alemayhu
2017-04-24 14:41 ` Daniel Borkmann
2017-04-25 14:27 ` David Laight
2017-04-26 5:17 ` Alexander Alemayhu
2017-04-24 14:45 ` [PATCH net-next 0/3] Misc BPF cleanup Alexei Starovoitov
2017-04-24 20:20 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.