BPF List
 help / color / mirror / Atom feed
From: bot+bpf-ci@kernel.org
To: paulhoussel2@gmail.com,paulhoussel2@gmail.com,eddyz87@gmail.com,bpf@vger.kernel.org,linux-kselftest@vger.kernel.org,linux-kernel@vger.kernel.org
Cc: martin.horth@telecom-sudparis.eu,ouail.derghal@imt-atlantique.fr,guilhem.jazeron@inria.fr,ludovic.paillat@inria.fr,robin.theveniaut@irit.fr,tristan.daudibert@gmail.com,ast@kernel.org,daniel@iogearbox.net,andrii@kernel.org,martin.lau@linux.dev,song@kernel.org,yonghong.song@linux.dev,john.fastabend@gmail.com,kpsingh@kernel.org,sdf@fomichev.me,haoluo@google.com,jolsa@kernel.org,shuah@kernel.org,paul.houssel@orange.com,ast@kernel.org,andrii@kernel.org,daniel@iogearbox.net,martin.lau@kernel.org,eddyz87@gmail.com,yonghong.song@linux.dev,clm@meta.com,ihor.solodrai@linux.dev
Subject: Re: [PATCH v3 1/2] libbpf: fix BTF dedup to support recursive typedef definitions
Date: Thu, 13 Nov 2025 11:42:41 +0000 (UTC)	[thread overview]
Message-ID: <8a586dfbb76e489a4dadc1852769a24c3ef79ffcc4007df2084d047052bdde05@mail.kernel.org> (raw)
In-Reply-To: <d0458ec2290e85a8c885432359a33ba8596ba992.1763024337.git.paul.houssel@orange.com>

[-- Attachment #1: Type: text/plain, Size: 2097 bytes --]

> diff --git a/tools/lib/bpf/btf.c b/tools/lib/bpf/btf.c
> index 9f141395c..5c4035eb9 100644
> --- a/tools/lib/bpf/btf.c
> +++ b/tools/lib/bpf/btf.c

[ ... ]

> @@ -4844,14 +4865,31 @@ static void btf_dedup_merge_hypot_map(struct btf_dedup *d)
>  	}
>  }
>
> +static inline long btf_hash_by_kind(struct btf_type *t, __u16 kind)
> +{
> +	if (kind == BTF_KIND_TYPEDEF)
> +		return btf_hash_typedef(t);
> +	else
> +		return btf_hash_struct(t);
> +}
> +
> +static inline bool btf_equal_by_kind(struct btf_type *t1, struct btf_type *t2, __u16 kind)
> +{
> +	if (kind == BTF_KIND_TYPEDEF)
> +		return btf_equal_typedef(t1, t2);
> +	else
> +		return btf_shallow_equal_struct(t1, t2);
> +}
> +
>  /*
> - * Deduplicate struct/union types.
> + * Deduplicate struct/union and typedef types.
>   *
>   * For each struct/union type its type signature hash is calculated, taking
>   * into account type's name, size, number, order and names of fields, but
>   * ignoring type ID's referenced from fields, because they might not be deduped
> - * completely until after reference types deduplication phase. This type hash
> - * is used to iterate over all potential canonical types, sharing same hash.
> + * completely until after reference types deduplication phase. For each typedef
> + * type, the hash is computed based on the type's name and size. This type hash
> + * is used to iterate over all potential canonical types, sharingsame hash.
                                                                   ^^^^^^^^^^

This isn't a bug, but there's a typo here - "sharingsame" should be
"sharing same" (two words).

>   * For each canonical candidate we check whether type graphs that they form
>   * (through referenced types in fields and so on) are equivalent using algorithm
>   * implemented in `btf_dedup_is_equiv`. If such equivalence is found and

[ ... ]


---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md

CI run summary: https://github.com/kernel-patches/bpf/actions/runs/19329986070

  reply	other threads:[~2025-11-13 11:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-13 11:14 [PATCH v3 0/2] libbpf: fix BTF dedup to support recursive typedef Paul Houssel
2025-11-13 11:14 ` [PATCH v3 1/2] libbpf: fix BTF dedup to support recursive typedef definitions Paul Houssel
2025-11-13 11:42   ` bot+bpf-ci [this message]
2025-11-13 11:14 ` [PATCH v3 2/2] selftests/bpf: add BTF dedup tests for " Paul Houssel

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=8a586dfbb76e489a4dadc1852769a24c3ef79ffcc4007df2084d047052bdde05@mail.kernel.org \
    --to=bot+bpf-ci@kernel.org \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=clm@meta.com \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=guilhem.jazeron@inria.fr \
    --cc=haoluo@google.com \
    --cc=ihor.solodrai@linux.dev \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kpsingh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=ludovic.paillat@inria.fr \
    --cc=martin.horth@telecom-sudparis.eu \
    --cc=martin.lau@kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=ouail.derghal@imt-atlantique.fr \
    --cc=paul.houssel@orange.com \
    --cc=paulhoussel2@gmail.com \
    --cc=robin.theveniaut@irit.fr \
    --cc=sdf@fomichev.me \
    --cc=shuah@kernel.org \
    --cc=song@kernel.org \
    --cc=tristan.daudibert@gmail.com \
    --cc=yonghong.song@linux.dev \
    /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