Re: [PATCH bpf-next v2 2/2] selftests/bpf: Add case to test bpf_in_interrupt kfunc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 26/8/25 01:26, Eduard Zingerman wrote:
> On Mon, 2025-08-25 at 21:15 +0800, Leon Hwang wrote:
>>  cd tools/testing/selftests/bpf
>>  ./test_progs -t irq
>>  #143/29  irq/in_interrupt:OK
>>  #143     irq:OK
>>  Summary: 1/34 PASSED, 0 SKIPPED, 0 FAILED
>>
>> Signed-off-by: Leon Hwang <leon.hwang@xxxxxxxxx>
>> ---
>>  tools/testing/selftests/bpf/progs/irq.c | 7 +++++++
>>  1 file changed, 7 insertions(+)
>>
>> diff --git a/tools/testing/selftests/bpf/progs/irq.c b/tools/testing/selftests/bpf/progs/irq.c
>> index 74d912b22de90..65a796fd1d615 100644
>> --- a/tools/testing/selftests/bpf/progs/irq.c
>> +++ b/tools/testing/selftests/bpf/progs/irq.c
>> @@ -563,4 +563,11 @@ int irq_wrong_kfunc_class_2(struct __sk_buff *ctx)
>>  	return 0;
>>  }
>>  
>> +SEC("?tc")
>> +__success
> 
> Could you please extend this test to verify generated x86 assembly
> code? (see __arch_x86_64 and __jited macro usage in verifier_tailcall_jit.c).

I’ll try to extend it, depending on the specific x86 implementation.

> Also, is it necessary to extend this test to actually verify returned
> value?

Not necessary — let’s just return 0 here.

Thanks,
Leon

> 
>> +int in_interrupt(struct __sk_buff *ctx)
>> +{
>> +	return bpf_in_interrupt();
>> +}
>> +
>>  char _license[] SEC("license") = "GPL";





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux