Re: [PATCH bpf-next] libbpf: simplify BPF_CORE_READ_BITFIELD_PROBED usage

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

 




On 11/6/19 1:58 PM, Alexei Starovoitov wrote:
> On Wed, Nov 6, 2019 at 1:21 PM Yonghong Song <yhs@xxxxxx> wrote:
>>
>>
>>
>> On 11/6/19 12:15 PM, Andrii Nakryiko wrote:
>>> Streamline BPF_CORE_READ_BITFIELD_PROBED interface to follow
>>> BPF_CORE_READ_BITFIELD (direct) and BPF_CORE_READ, in general, i.e., just
>>> return read result or 0, if underlying bpf_probe_read() failed.
>>>
>>> In practice, real applications rarely check bpf_probe_read() result, because
>>> it has to always work or otherwise it's a bug. So propagating internal
>>> bpf_probe_read() error from this macro hurts usability without providing real
>>> benefits in practice. This patch fixes the issue and simplifies usage,
>>> noticeable even in selftest itself.
>>
>> Agreed. This will be consistent with direct read where
>> returning value will be 0 if any fault happens.
>>
>> In really rare cases, if user want to distinguish good value 0 from
>> bpf_probe_read() returning error, all building macros are in the header
>> file, user can have a custom solution. But let us have API work
>> for common use case with good usability.
>>
>>>
>>> Cc: Yonghong Song <yhs@xxxxxx>
>>> Signed-off-by: Andrii Nakryiko <andriin@xxxxxx>
>>
>> Acked-by: Yonghong Song <yhs@xxxxxx>
> 
> Applied. Thanks
> 
> Yonghong, please trim your replies.

Sorry, forgot to do. Will remember next time.




[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