Re: [PATCH v4 bpf-next 3/9] bpf: Introduce KF_ARG_PTR_TO_CONST_STR

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

 




> On Oct 23, 2023, at 5:49 PM, Alexei Starovoitov <alexei.starovoitov@xxxxxxxxx> wrote:
> 
> On Mon, Oct 23, 2023 at 3:41 PM Song Liu <song@xxxxxxxxxx> wrote:
>> +
>> +        __bpf_kfunc bpf_get_file_xattr(..., const char *name__const_str,
> ...
>> +               case KF_ARG_PTR_TO_CONST_STR:
> 
> CONST_STR was ok here, but as __const_str suffix is a bit too verbose.
> How about just __str ? I don't think we'll have non-const strings in
> the near future.

I thought about this. While we don't foresee non-const strings in the 
near future, I think __const_str is acceptable. These annotations are 
part of the core APIs of kfuncs. As we enabled other subsystems to add 
kfuncs without touching BPF core, it makes sense to keep the annoations
as stable as possible. Making __const_str a little shorter doesn't seem 
to justify the risk of changing it in the future. 

Also, we already have longer annotations like __refcounted_kptr. So I
personally prefer to keep the annotation as __const_str. 

Does this make sense? 

Thanks,
Song





[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