All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Hwang <leon.hwang@linux.dev>
To: Eduard Zingerman <eddyz87@gmail.com>,
	Andrii Nakryiko <andrii.nakryiko@gmail.com>
Cc: bpf@vger.kernel.org, ast@kernel.org, andrii@kernel.org,
	daniel@iogearbox.net, yonghong.song@linux.dev, song@kernel.org,
	dxu@dxuuu.xyz, deso@posteo.net, kernel-patches-bot@fb.com
Subject: Re: [PATCH bpf-next 1/3] bpf: Introduce BPF_F_CPU flag for percpu_array map
Date: Tue, 22 Jul 2025 22:29:18 +0800	[thread overview]
Message-ID: <d7185c14-3fd4-4316-a920-17db547c8b3a@linux.dev> (raw)
In-Reply-To: <c55df650fe8a491d5ae6640f5e08707bab9c30dc.camel@gmail.com>



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


  reply	other threads:[~2025-07-22 14:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-17 19:37 [PATCH bpf-next 0/3] bpf: Introduce BPF_F_CPU flag for percpu_array map Leon Hwang
2025-07-17 19:37 ` [PATCH bpf-next 1/3] " Leon Hwang
2025-07-18 15:52   ` Andrii Nakryiko
2025-07-21 17:08     ` Leon Hwang
2025-07-21 17:11       ` Eduard Zingerman
2025-07-22 14:29         ` Leon Hwang [this message]
2025-07-17 19:37 ` [PATCH bpf-next 2/3] bpf, libbpf: Support BPF_F_CPU " Leon Hwang
2025-07-18 15:57   ` Andrii Nakryiko
2025-07-21 17:13     ` Leon Hwang
2025-07-17 19:37 ` [PATCH bpf-next 3/3] selftests/bpf: Add case to test BPF_F_CPU Leon Hwang

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=d7185c14-3fd4-4316-a920-17db547c8b3a@linux.dev \
    --to=leon.hwang@linux.dev \
    --cc=andrii.nakryiko@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=deso@posteo.net \
    --cc=dxu@dxuuu.xyz \
    --cc=eddyz87@gmail.com \
    --cc=kernel-patches-bot@fb.com \
    --cc=song@kernel.org \
    --cc=yonghong.song@linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.