From: Tony Ambardar <tony.ambardar@gmail.com>
To: YiFei Zhu <zhuyifei@google.com>
Cc: bpf@vger.kernel.org, linux-kselftest@vger.kernel.org,
Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii@kernel.org>,
Martin KaFai Lau <martin.lau@linux.dev>,
Eduard Zingerman <eddyz87@gmail.com>, Song Liu <song@kernel.org>,
Yonghong Song <yonghong.song@linux.dev>,
John Fastabend <john.fastabend@gmail.com>,
KP Singh <kpsingh@kernel.org>,
Stanislav Fomichev <sdf@fomichev.me>, Hao Luo <haoluo@google.com>,
Jiri Olsa <jolsa@kernel.org>, Mykola Lysenko <mykolal@fb.com>,
Shuah Khan <shuah@kernel.org>, Yucong Sun <sunyucong@gmail.com>,
Eric Dumazet <edumazet@google.com>,
Kuniyuki Iwashima <kuniyu@amazon.co.jp>,
Jakub Sitnicki <jakub@cloudflare.com>,
Dave Marchevsky <davemarchevsky@fb.com>,
David Vernet <void@manifault.com>,
Carlos Neira <cneirabustos@gmail.com>,
Joanne Koong <joannelkoong@gmail.com>,
Petar Penkov <ppenkov@google.com>,
Willem de Bruijn <willemb@google.com>,
Yan Zhai <yan@cloudflare.com>,
Vadim Fedorenko <vadim.fedorenko@linux.dev>
Subject: Re: [PATCH bpf-next v1 19/19] selftests/bpf: Fix errors compiling cg_storage_multi.h with musl libc
Date: Wed, 24 Jul 2024 16:54:42 -0700 [thread overview]
Message-ID: <ZqGUQoBb0lpKD37v@kodidev-ubuntu> (raw)
In-Reply-To: <CAA-VZPm-tBOD_vfYeLs57gPkoJmbZTw-4odO05H_UxTvZLvPTg@mail.gmail.com>
On Tue, Jul 23, 2024 at 03:35:22PM -0700, YiFei Zhu wrote:
> On Mon, Jul 22, 2024 at 10:56 PM Tony Ambardar <tony.ambardar@gmail.com> wrote:
> >
> > Remove a redundant include of '<asm/types.h>', whose needed definitions are
> > already included (via '<linux/types.h>') in cg_storage_multi_egress_only.c,
> > cg_storage_multi_isolated.c, and cg_storage_multi_shared.c. This avoids
> > redefinition errors seen compiling for mips64el/musl-libc like:
> >
> > In file included from progs/cg_storage_multi_egress_only.c:13:
> > In file included from progs/cg_storage_multi.h:6:
> > In file included from /usr/mips64el-linux-gnuabi64/include/asm/types.h:23:
> > /usr/include/asm-generic/int-l64.h:29:25: error: typedef redefinition with different types ('long' vs 'long long')
> > 29 | typedef __signed__ long __s64;
> > | ^
> > /usr/include/asm-generic/int-ll64.h:30:44: note: previous definition is here
> > 30 | __extension__ typedef __signed__ long long __s64;
> > | ^
> >
> > Fixes: 9e5bd1f7633b ("selftests/bpf: Test CGROUP_STORAGE map can't be used by multiple progs")
> > Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
> > ---
> > tools/testing/selftests/bpf/progs/cg_storage_multi.h | 2 --
> > 1 file changed, 2 deletions(-)
> >
> > diff --git a/tools/testing/selftests/bpf/progs/cg_storage_multi.h b/tools/testing/selftests/bpf/progs/cg_storage_multi.h
> > index a0778fe7857a..41d59f0ee606 100644
> > --- a/tools/testing/selftests/bpf/progs/cg_storage_multi.h
> > +++ b/tools/testing/selftests/bpf/progs/cg_storage_multi.h
> > @@ -3,8 +3,6 @@
> > #ifndef __PROGS_CG_STORAGE_MULTI_H
> > #define __PROGS_CG_STORAGE_MULTI_H
> >
> > -#include <asm/types.h>
> > -
> > struct cgroup_value {
> > __u32 egress_pkts;
> > __u32 ingress_pkts;
> > --
> > 2.34.1
> >
>
> Hmm, some linter checks prefer headers themselves include everything
> they use. This header uses __u32 and after this patch it would include
> no headers. Would it be okay to include <linux/types.h> or we don't
> care?
>
> YiFei Zhu
Good point, I agree even the readability suffers without headers.
Replacing <asm/types.h> with <linux/types.h> makes more sense, and
guards in the latter avoid the conflicts noted above. I'll queue this
change for a v2. Appreciate the feedback!
Cheers,
Tony Ambardar
next prev parent reply other threads:[~2024-07-24 23:54 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-23 5:54 [PATCH bpf-next v1 00/19] selftests/bpf: Improve libc portability / musl support (part 1) Tony Ambardar
2024-07-23 5:54 ` [PATCH bpf-next v1 01/19] selftests/bpf: Use pid_t consistently in test_progs.c Tony Ambardar
2024-07-24 2:40 ` Geliang Tang
2024-07-23 5:54 ` [PATCH bpf-next v1 02/19] selftests/bpf: Fix compile error from rlim_t in sk_storage_map.c Tony Ambardar
2024-07-23 5:54 ` [PATCH bpf-next v1 03/19] selftests/bpf: Fix error compiling bpf_iter_setsockopt.c with musl libc Tony Ambardar
2024-07-24 3:11 ` Geliang Tang
2024-07-23 5:54 ` [PATCH bpf-next v1 04/19] selftests/bpf: Drop unneeded include in unpriv_helpers.c Tony Ambardar
2024-07-23 5:54 ` [PATCH bpf-next v1 05/19] selftests/bpf: Drop unneeded include in sk_lookup.c Tony Ambardar
2024-07-23 5:54 ` [PATCH bpf-next v1 06/19] selftests/bpf: Drop unneeded include in flow_dissector.c Tony Ambardar
2024-07-23 5:54 ` [PATCH bpf-next v1 07/19] selftests/bpf: Fix missing ARRAY_SIZE() definition in bench.c Tony Ambardar
2024-07-24 7:08 ` Geliang Tang
2024-07-25 1:28 ` Tony Ambardar
2024-07-23 5:54 ` [PATCH bpf-next v1 08/19] selftests/bpf: Fix missing UINT_MAX definitions in benchmarks Tony Ambardar
2024-07-23 5:54 ` [PATCH bpf-next v1 09/19] selftests/bpf: Fix missing BUILD_BUG_ON() declaration Tony Ambardar
2024-07-23 5:54 ` [PATCH bpf-next v1 10/19] selftests/bpf: Fix include of <sys/fcntl.h> Tony Ambardar
2024-07-23 5:54 ` [PATCH bpf-next v1 11/19] selftests/bpf: Fix compiling parse_tcp_hdr_opt.c with musl-libc Tony Ambardar
2024-07-23 5:54 ` [PATCH bpf-next v1 12/19] selftests/bpf: Fix compiling kfree_skb.c " Tony Ambardar
2024-07-23 5:54 ` [PATCH bpf-next v1 13/19] selftests/bpf: Fix compiling flow_dissector.c " Tony Ambardar
2024-07-23 5:54 ` [PATCH bpf-next v1 14/19] selftests/bpf: Fix compiling tcp_rtt.c " Tony Ambardar
2024-07-23 5:54 ` [PATCH bpf-next v1 15/19] selftests/bpf: Fix compiling core_reloc.c " Tony Ambardar
2024-07-23 5:54 ` [PATCH bpf-next v1 16/19] selftests/bpf: Fix errors compiling lwt_redirect.c with musl libc Tony Ambardar
2024-07-23 5:54 ` [PATCH bpf-next v1 17/19] selftests/bpf: Fix errors compiling decap_sanity.c " Tony Ambardar
2024-07-23 5:54 ` [PATCH bpf-next v1 18/19] selftests/bpf: Fix errors compiling crypto_sanity.c " Tony Ambardar
2024-07-23 9:55 ` Vadim Fedorenko
2024-07-23 5:54 ` [PATCH bpf-next v1 19/19] selftests/bpf: Fix errors compiling cg_storage_multi.h " Tony Ambardar
2024-07-23 22:35 ` YiFei Zhu
2024-07-24 23:45 ` Andrii Nakryiko
2024-07-24 23:54 ` Tony Ambardar [this message]
2024-07-23 6:45 ` [PATCH bpf-next v1 00/19] selftests/bpf: Improve libc portability / musl support (part 1) bot+bpf-ci
2024-07-24 23:52 ` Andrii Nakryiko
2024-07-25 0:28 ` Tony Ambardar
2024-07-25 0:45 ` Andrii Nakryiko
2024-07-25 0:00 ` patchwork-bot+netdevbpf
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=ZqGUQoBb0lpKD37v@kodidev-ubuntu \
--to=tony.ambardar@gmail.com \
--cc=andrii@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=cneirabustos@gmail.com \
--cc=daniel@iogearbox.net \
--cc=davemarchevsky@fb.com \
--cc=eddyz87@gmail.com \
--cc=edumazet@google.com \
--cc=haoluo@google.com \
--cc=jakub@cloudflare.com \
--cc=joannelkoong@gmail.com \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kpsingh@kernel.org \
--cc=kuniyu@amazon.co.jp \
--cc=linux-kselftest@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=mykolal@fb.com \
--cc=ppenkov@google.com \
--cc=sdf@fomichev.me \
--cc=shuah@kernel.org \
--cc=song@kernel.org \
--cc=sunyucong@gmail.com \
--cc=vadim.fedorenko@linux.dev \
--cc=void@manifault.com \
--cc=willemb@google.com \
--cc=yan@cloudflare.com \
--cc=yonghong.song@linux.dev \
--cc=zhuyifei@google.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