Re: [PATCH bpf-next 1/3] bpf: Introduce BPF_F_CPU flag for percpu_array map

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

 




On 2025/7/22 01:11, Eduard Zingerman wrote:
> On Tue, 2025-07-22 at 01:08 +0800, Leon Hwang wrote:
> 
> [...]
> 
>>>> @@ -1941,19 +1945,25 @@ int generic_map_update_batch(struct bpf_map *map, struct file *map_file,
>>>>  {
>>>>         void __user *values = u64_to_user_ptr(attr->batch.values);
>>>>         void __user *keys = u64_to_user_ptr(attr->batch.keys);
>>>> -       u32 value_size, cp, max_count;
>>>> +       u32 value_size, cp, max_count, cpu = attr->batch.cpu;
>>>> +       u64 elem_flags = attr->batch.elem_flags;
>>>>         void *key, *value;
>>>>         int err = 0;
>>>>
>>>> -       if (attr->batch.elem_flags & ~BPF_F_LOCK)
>>>> +       if (elem_flags & ~(BPF_F_LOCK | BPF_F_CPU))
>>>>                 return -EINVAL;
>>>>
>>>> -       if ((attr->batch.elem_flags & BPF_F_LOCK) &&
>>>> +       if ((elem_flags & BPF_F_LOCK) &&
>>>>             !btf_record_has_field(map->record, BPF_SPIN_LOCK)) {
>>>>                 return -EINVAL;
>>>>         }
>>>>
>>>> -       value_size = bpf_map_value_size(map);
>>>> +       if ((elem_flags & BPF_F_CPU) &&
>>>> +               map->map_type != BPF_MAP_TYPE_PERCPU_ARRAY)
>>>
>>> nit: keep on the single line
>>>
>>
>> Ack.
>>
>> Btw, how many chars of one line do we allow? 100 chars?
> 
> Yes, 100 chars per line (Andrii is on PTO).

Hi Eduard,

Thank you for your reply.

I’ll keep that in mind for the future.

Thanks,
Leon





[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