netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox.net>
To: Yonghong Song <yhs@fb.com>,
	ast@fb.com, davem@davemloft.net, netdev@vger.kernel.org
Cc: kernel-team@fb.com
Subject: Re: [PATCH net v2] selftests/bpf: fix broken build due to types.h
Date: Thu, 18 May 2017 01:52:53 +0200	[thread overview]
Message-ID: <591CE255.9090406@iogearbox.net> (raw)
In-Reply-To: <5927830d-fac2-a204-47e7-78f0e4149afb@fb.com>

On 05/18/2017 01:48 AM, Yonghong Song wrote:
> On 5/17/17 3:57 PM, Daniel Borkmann wrote:
>> On 05/18/2017 12:18 AM, Yonghong Song wrote:
>>> Commit 0a5539f66133 ("bpf: Provide a linux/types.h override
>>> for bpf selftests.") caused a build failure for tools/testing/selftest/bpf
>>> because of some missing types:
>>>      $ make -C tools/testing/selftests/bpf/
>>>      ...
>>>      In file included from /home/yhs/work/net-next/tools/testing/selftests/bpf/test_pkt_access.c:8:
>>>      ../../../include/uapi/linux/bpf.h:170:3: error: unknown type name '__aligned_u64'
>>>                      __aligned_u64   key;
>>>      ...
>>>      /usr/include/linux/swab.h:160:8: error: unknown type name '__always_inline'
>>>      static __always_inline __u16 __swab16p(const __u16 *p)
>>>      ...
>>> The type __aligned_u64 is defined in linux:include/uapi/linux/types.h.
>>>
>>> The fix is to copy missing type definition into
>>> tools/testing/selftests/bpf/include/uapi/linux/types.h.
>>> Adding additional include "string.h" resolves __always_inline issue.
>>>
>>> Fixes: 0a5539f66133 ("bpf: Provide a linux/types.h override for bpf selftests.")
>>> Signed-off-by: Yonghong Song <yhs@fb.com>
>>
>> Can you elaborate why string.h specifically? Can't we define the
>> __always_inline ourselves?
>
> Actually, yes, we can define __always_inline ourselves in each bpf program or in some common header files used by all selftests bpf
> programs.
>
> I use string.h because several other bpf programs
> (test_xdp.c test_l4lb.c test_tcp_estats.c) they all have
> __always_inline and string.h, so they do not have issue.
> I discovered this pattern so I just add string.h into test_pkt_access.c
> as well.

Ok, thanks for clarifying.

      reply	other threads:[~2017-05-17 23:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-17 22:18 [PATCH net v2] selftests/bpf: fix broken build due to types.h Yonghong Song
2017-05-17 22:45 ` David Miller
2017-05-17 22:57 ` Daniel Borkmann
2017-05-17 23:01   ` David Miller
2017-05-17 23:15     ` Daniel Borkmann
2017-05-17 23:18       ` David Miller
2017-05-18  0:46     ` Yonghong Song
2017-05-17 23:48   ` Yonghong Song
2017-05-17 23:52     ` Daniel Borkmann [this message]

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=591CE255.9090406@iogearbox.net \
    --to=daniel@iogearbox.net \
    --cc=ast@fb.com \
    --cc=davem@davemloft.net \
    --cc=kernel-team@fb.com \
    --cc=netdev@vger.kernel.org \
    --cc=yhs@fb.com \
    /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 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).