From: Eduard Zingerman <eddyz87@gmail.com>
To: Leon Hwang <leon.hwang@linux.dev>,
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: Mon, 21 Jul 2025 10:11:30 -0700 [thread overview]
Message-ID: <c55df650fe8a491d5ae6640f5e08707bab9c30dc.camel@gmail.com> (raw)
In-Reply-To: <d8d4cd89-2953-45d1-9f81-ab633aa3e4cd@linux.dev>
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).
next prev parent reply other threads:[~2025-07-21 17:11 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 [this message]
2025-07-22 14:29 ` Leon Hwang
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=c55df650fe8a491d5ae6640f5e08707bab9c30dc.camel@gmail.com \
--to=eddyz87@gmail.com \
--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=kernel-patches-bot@fb.com \
--cc=leon.hwang@linux.dev \
--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.