netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrii Nakryiko <andrii.nakryiko@gmail.com>
To: Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>
Cc: bpf <bpf@vger.kernel.org>, Networking <netdev@vger.kernel.org>,
	Alexei Starovoitov <ast@fb.com>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Kernel Team <kernel-team@fb.com>,
	Andrii Nakryiko <andriin@fb.com>
Subject: Re: [PATCH v2 bpf] libbpf: fix missing __WORDSIZE definition
Date: Thu, 18 Jul 2019 10:31:47 -0700	[thread overview]
Message-ID: <CAEf4BzaOMmVHGMMrKKRHtMDj2r09cQjuCyiSTF3mpjp+R0cvrQ@mail.gmail.com> (raw)
In-Reply-To: <20190718173021.2418606-1-andriin@fb.com>

On Thu, Jul 18, 2019 at 10:30 AM Andrii Nakryiko <andriin@fb.com> wrote:
>
> hashmap.h depends on __WORDSIZE being defined. It is defined by
> glibc/musl in different headers. It's an explicit goal for musl to be
> "non-detectable" at compilation time, so instead include glibc header if
> glibc is explicitly detected and fall back to musl header otherwise.
>
> Fixes: e3b924224028 ("libbpf: add resizable non-thread safe internal hashmap")
> Reported-by: Arnaldo Carvalho de Melo <acme@redhat.com>

Arnaldo,

As it compiled fine for me even before and I don't have a musl set up,
could you please verify this fixes the issue for perf for all your
test environments?

Thanks!

> Signed-off-by: Andrii Nakryiko <andriin@fb.com>
> ---
>  tools/lib/bpf/hashmap.h | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/tools/lib/bpf/hashmap.h b/tools/lib/bpf/hashmap.h
> index 03748a742146..bae8879cdf58 100644
> --- a/tools/lib/bpf/hashmap.h
> +++ b/tools/lib/bpf/hashmap.h
> @@ -10,6 +10,11 @@
>
>  #include <stdbool.h>
>  #include <stddef.h>
> +#ifdef __GLIBC__
> +#include <bits/wordsize.h>
> +#else
> +#include <bits/reg.h>
> +#endif
>  #include "libbpf_internal.h"
>
>  static inline size_t hash_bits(size_t h, int bits)
> --
> 2.17.1
>

  reply	other threads:[~2019-07-18 17:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-18 17:30 [PATCH v2 bpf] libbpf: fix missing __WORDSIZE definition Andrii Nakryiko
2019-07-18 17:31 ` Andrii Nakryiko [this message]
2019-07-26 20:49 ` Arnaldo Carvalho de Melo
2019-07-26 23:01   ` Andrii Nakryiko
2019-07-27  0:03     ` Arnaldo Carvalho de Melo

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=CAEf4BzaOMmVHGMMrKKRHtMDj2r09cQjuCyiSTF3mpjp+R0cvrQ@mail.gmail.com \
    --to=andrii.nakryiko@gmail.com \
    --cc=acme@redhat.com \
    --cc=andriin@fb.com \
    --cc=arnaldo.melo@gmail.com \
    --cc=ast@fb.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kernel-team@fb.com \
    --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 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).