Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: Venkat Rao Bagalkote <venkat88@linux.ibm.com>
To: Hari Bathini <hbathini@linux.ibm.com>
Cc: bpf@vger.kernel.org, Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>,
	linux-kselftest@vger.kernel.org, Shuah Khan <shuah@kernel.org>
Subject: Re: [PATCH] selftests/bpf: test accounting of tail calls when prog is NULL
Date: Sat, 21 Feb 2026 09:18:43 +0530	[thread overview]
Message-ID: <112376c3-7cae-471b-b425-98ae17284c2b@linux.ibm.com> (raw)
In-Reply-To: <0cbbc97a-ebb8-41d8-ac88-2a954279d10c@linux.ibm.com>


On 16/02/26 8:31 pm, Venkat Rao Bagalkote wrote:
>
> On 16/02/26 4:41 pm, Hari Bathini wrote:
>>
>>
>> On 16/02/26 4:38 pm, Venkat wrote:
>>> Hello Hari,
>>>
>>> With this patch, tailcalls selftest is failing.
>>>
>>> # ./test_progs -t tailcalls
>>> tester_init:PASS:tester_log_buf 0 nsec
>>> process_subtest:PASS:obj_open_mem 0 nsec
>>> process_subtest:PASS:specs_alloc 0 nsec
>>> #448/1   tailcalls/tailcall_1:OK
>>> #448/2   tailcalls/tailcall_2:OK
>>> test_tailcall_count:PASS:tailcall 0 nsec
>>> test_tailcall_count:PASS:tailcall retval 0 nsec
>>> test_tailcall_count:PASS:tailcall count 0 nsec
>>> test_tailcall_count:FAIL:tailcall count unexpected tailcall count: 
>>> actual 32 != expected 33
>>> test_tailcall_count:PASS:tailcall 0 nsec
>>> test_tailcall_count:PASS:tailcall retval 0 nsec
>>> #448/3   tailcalls/tailcall_3:FAIL
>>> #448/4   tailcalls/tailcall_4:OK
>>> #448/5   tailcalls/tailcall_5:OK
>>> #448/6   tailcalls/tailcall_6:OK
>>> #448/7   tailcalls/tailcall_bpf2bpf_1:OK
>>> #448/8   tailcalls/tailcall_bpf2bpf_2:OK
>>> #448/9   tailcalls/tailcall_bpf2bpf_3:OK
>>> #448/10  tailcalls/tailcall_bpf2bpf_4:OK
>>> #448/11  tailcalls/tailcall_bpf2bpf_5:OK
>>> #448/12  tailcalls/tailcall_bpf2bpf_6:OK
>>> #448/13  tailcalls/tailcall_bpf2bpf_fentry:OK
>>> #448/14  tailcalls/tailcall_bpf2bpf_fexit:OK
>>> #448/15  tailcalls/tailcall_bpf2bpf_fentry_fexit:OK
>>> #448/16  tailcalls/tailcall_bpf2bpf_fentry_entry:OK
>>> #448/17  tailcalls/tailcall_poke:OK
>>> #448/18  tailcalls/tailcall_bpf2bpf_hierarchy_1:OK
>>> #448/19  tailcalls/tailcall_bpf2bpf_hierarchy_fentry:OK
>>> #448/20  tailcalls/tailcall_bpf2bpf_hierarchy_fexit:OK
>>> #448/21  tailcalls/tailcall_bpf2bpf_hierarchy_fentry_fexit:OK
>>> #448/22  tailcalls/tailcall_bpf2bpf_hierarchy_fentry_entry:OK
>>> #448/23  tailcalls/tailcall_bpf2bpf_hierarchy_2:OK
>>> #448/24  tailcalls/tailcall_bpf2bpf_hierarchy_3:OK
>>> #448/25  tailcalls/tailcall_freplace:OK
>>> #448/26  tailcalls/tailcall_bpf2bpf_freplace:OK
>>> #448/27  tailcalls/tailcall_failure:OK
>>> #448/28  tailcalls/reject_tail_call_spin_lock:OK
>>> #448/29  tailcalls/reject_tail_call_rcu_lock:OK
>>> #448/30  tailcalls/reject_tail_call_preempt_lock:OK
>>> #448/31  tailcalls/reject_tail_call_ref:OK
>>> #448/32  tailcalls/tailcall_sleepable:OK
>>> #448     tailcalls:FAIL
>>>
>>> All error logs:
>>> tester_init:PASS:tester_log_buf 0 nsec
>>> process_subtest:PASS:obj_open_mem 0 nsec
>>> process_subtest:PASS:specs_alloc 0 nsec
>>> test_tailcall_count:PASS:tailcall 0 nsec
>>> test_tailcall_count:PASS:tailcall retval 0 nsec
>>> test_tailcall_count:PASS:tailcall count 0 nsec
>>> test_tailcall_count:FAIL:tailcall count unexpected tailcall count: 
>>> actual 32 != expected 33
>>> test_tailcall_count:PASS:tailcall 0 nsec
>>> test_tailcall_count:PASS:tailcall retval 0 nsec
>>> #448/3   tailcalls/tailcall_3:FAIL
>>> #448     tailcalls:FAIL
>>> Summary: 0/31 PASSED, 0 SKIPPED, 1 FAILED
>>>
>>> Regards,
>>> Venkat.
>>>
>>>> On 16 Feb 2026, at 2:38 PM, Hari Bathini <hbathini@linux.ibm.com> 
>>>> wrote:
>>>>
>>>> Test whether tail call count is incorrectly accounted for, when the
>>>> tail call fails due to a missing BPF program.
>>>>
>>>> Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>
>>>> ---
>>>>
>>>> - powerpc64 BPF JIT has been incorrectly accounting for tailcall count
>>>>   even when BPF program to tailcall into is missing. A simple change
>>>>   to one of the tailcall selftests could have flagged it earlier.
>>>>
>>
>>>> https://lore.kernel.org/all/20260216065639.1750181-2-hbathini@linux.ibm.com/ 
>>>>
>
Tested by applying V2 version of above patch series, and tested this 
patch, and the test passes.


Logs:

./test_progs -t tailcalls
#448/1   tailcalls/tailcall_1:OK
#448/2   tailcalls/tailcall_2:OK
#448/3   tailcalls/tailcall_3:OK
#448/4   tailcalls/tailcall_4:OK
#448/5   tailcalls/tailcall_5:OK
#448/6   tailcalls/tailcall_6:OK
#448/7   tailcalls/tailcall_bpf2bpf_1:OK
#448/8   tailcalls/tailcall_bpf2bpf_2:OK
#448/9   tailcalls/tailcall_bpf2bpf_3:OK
#448/10  tailcalls/tailcall_bpf2bpf_4:OK
#448/11  tailcalls/tailcall_bpf2bpf_5:OK
#448/12  tailcalls/tailcall_bpf2bpf_6:OK
#448/13  tailcalls/tailcall_bpf2bpf_fentry:OK
#448/14  tailcalls/tailcall_bpf2bpf_fexit:OK
#448/15  tailcalls/tailcall_bpf2bpf_fentry_fexit:OK
#448/16  tailcalls/tailcall_bpf2bpf_fentry_entry:OK
#448/17  tailcalls/tailcall_poke:OK
#448/18  tailcalls/tailcall_bpf2bpf_hierarchy_1:OK
#448/19  tailcalls/tailcall_bpf2bpf_hierarchy_fentry:OK
#448/20  tailcalls/tailcall_bpf2bpf_hierarchy_fexit:OK
#448/21  tailcalls/tailcall_bpf2bpf_hierarchy_fentry_fexit:OK
#448/22  tailcalls/tailcall_bpf2bpf_hierarchy_fentry_entry:OK
#448/23  tailcalls/tailcall_bpf2bpf_hierarchy_2:OK
#448/24  tailcalls/tailcall_bpf2bpf_hierarchy_3:OK
#448/25  tailcalls/tailcall_freplace:OK
#448/26  tailcalls/tailcall_bpf2bpf_freplace:OK
#448/27  tailcalls/tailcall_failure:OK
#448/28  tailcalls/reject_tail_call_spin_lock:OK
#448/29  tailcalls/reject_tail_call_rcu_lock:OK
#448/30  tailcalls/reject_tail_call_preempt_lock:OK
#448/31  tailcalls/reject_tail_call_ref:OK
#448/32  tailcalls/tailcall_sleepable:OK
#448     tailcalls:OK
Summary: 1/32 PASSED, 0 SKIPPED, 0 FAILED


Tested-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com>



My bad, I didnt apply the related patches, when I tested earlier.


Regards,

Venkat.

>
> Above patch was not applied, during the test.
>
>>
>> Hi Venkat,
>>
>> Can you confirm if the above kernel patch was used or not?
>
>
> Its with only below patch. Please refer git log.
>
>
> git log
> commit cb50b08d0c45e7f97e1364075a5ee399c63422d5 (HEAD -> master)
> Author: Hari Bathini <hbathini@linux.ibm.com>
> Date:   Mon Feb 16 14:38:02 2026 +0530
>
>     selftests/bpf: test accounting of tail calls when prog is NULL
>
>     Test whether tail call count is incorrectly accounted for, when the
>     tail call fails due to a missing BPF program.
>
>     Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>
>
> commit 0f2acd3148e0ef42bdacbd477f90e8533f96b2ac (origin/master, 
> origin/HEAD)
> Merge: 26a4cfaff82a a16ac6ca46d6
> Author: Linus Torvalds <torvalds@linux-foundation.org>
> Date:   Sun Feb 15 19:45:00 2026 -0800
>
>
> Regards,
>
> Venkat.
>
>>
>> - Hari
>>

  reply	other threads:[~2026-02-21  3:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-16  9:08 [PATCH] selftests/bpf: test accounting of tail calls when prog is NULL Hari Bathini
2026-02-16 11:08 ` Venkat
2026-02-16 11:11   ` Hari Bathini
2026-02-16 15:01     ` Venkat Rao Bagalkote
2026-02-21  3:48       ` Venkat Rao Bagalkote [this message]
2026-02-17 12:53 ` Ilya Leoshkevich
2026-02-20  6:34   ` Hari Bathini
2026-02-25  1:20 ` 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=112376c3-7cae-471b-b425-98ae17284c2b@linux.ibm.com \
    --to=venkat88@linux.ibm.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=hbathini@linux.ibm.com \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=shuah@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