All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox.net>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: Re: more bpf samples build breakage...
Date: Mon, 01 May 2017 22:38:58 +0200	[thread overview]
Message-ID: <59079CE2.6010305@iogearbox.net> (raw)
In-Reply-To: <20170501.153005.983887567095122966.davem@davemloft.net>

On 05/01/2017 09:30 PM, David Miller wrote:
>
> Inlcuding bpf_util.h into test_pkt_access.c et al. broke the build even
> more so than it already is on sparc.
>
> The problem is we end up including all the stdio.h bits and eventually
> hit things like:
>
> In file included from /usr/include/stdio.h:933:
> /usr/include/bits/stdio-ldbl.h:28:20: error: cannot apply asm label to function after its first use
> __LDBL_REDIR_DECL (vfprintf)
> ~~~~~~~~~~~~~~~~~~~^~~~~~~~~
> /usr/include/sys/cdefs.h:373:26: note: expanded from macro '__LDBL_REDIR_DECL'
>    extern __typeof (name) name __asm (__ASMNAME ("__nldbl_" #name));
>
> So please let's put CLANG compiled helpers into header files
> specifically meant to be included by CLANG compiled BPF programs
> rather than the host build environment.

Argh, sorry for that and thanks for the quick fix. When I tested
this on x86_64, I didn't hit a compilation issue.

BPF selftests:

[root@apoc bpf]# make > /dev/null
Warning: tools/include/uapi/linux/bpf.h differs from kernel
[root@apoc bpf]# ./test_progs
test_pkt_access:PASS:ipv4 401 nsec
test_pkt_access:PASS:ipv6 271 nsec
test_xdp:PASS:ipv4 4617 nsec
test_xdp:PASS:ipv6 2979 nsec
test_l4lb:PASS:ipv4 921 nsec
test_l4lb:PASS:ipv6 717 nsec
Summary: 6 PASSED, 0 FAILED
[root@apoc bpf]#

BPF samples:

[root@apoc bpf]# make > /dev/null
In file included from /root/cilium/net-next/samples/bpf/cookie_uid_helper_example.c:54:0:
/root/cilium/net-next/samples/bpf/cookie_uid_helper_example.c: In function ‘prog_load’:
/root/cilium/net-next/samples/bpf/cookie_uid_helper_example.c:119:5: warning: overflow in implicit constant conversion [-Woverflow]
      -32 + offsetof(struct stats, uid)),
      ^
/root/cilium/net-next/samples/bpf/libbpf.h:135:12: note: in definition of macro ‘BPF_STX_MEM’
    .off   = OFF,     \
             ^
/root/cilium/net-next/samples/bpf/cookie_uid_helper_example.c:121:5: warning: overflow in implicit constant conversion [-Woverflow]
      -32 + offsetof(struct stats, packets), 1),
      ^
/root/cilium/net-next/samples/bpf/libbpf.h:155:12: note: in definition of macro ‘BPF_ST_MEM’
    .off   = OFF,     \
             ^
/root/cilium/net-next/samples/bpf/cookie_uid_helper_example.c:129:5: warning: overflow in implicit constant conversion [-Woverflow]
      -32 + offsetof(struct stats, bytes)),
      ^
/root/cilium/net-next/samples/bpf/libbpf.h:135:12: note: in definition of macro ‘BPF_STX_MEM’
    .off   = OFF,     \
             ^
[root@apoc bpf]#

Above warning is from 51570a5ab2b7 ("A Sample of using socket
cookie and uid for traffic monitoring"). I can see to send a
fix for it.

Thanks,
Daniel

  parent reply	other threads:[~2017-05-01 20:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-01 19:30 more bpf samples build breakage David Miller
2017-05-01 19:44 ` David Miller
2017-05-01 20:38 ` Daniel Borkmann [this message]
2017-05-01 20:45   ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=59079CE2.6010305@iogearbox.net \
    --to=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.