[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9bc995b4-d0bd-41a8-8867-97507a55d449@linux.dev>
Date: Tue, 2 Sep 2025 12:10:45 -0700
From: Martin KaFai Lau <martin.lau@...ux.dev>
To: Kuniyuki Iwashima <kuniyu@...gle.com>
Cc: Alexei Starovoitov <ast@...nel.org>, Andrii Nakryiko <andrii@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
John Fastabend <john.fastabend@...il.com>,
Stanislav Fomichev <sdf@...ichev.me>, Johannes Weiner <hannes@...xchg.org>,
Michal Hocko <mhocko@...nel.org>, Roman Gushchin <roman.gushchin@...ux.dev>,
Shakeel Butt <shakeel.butt@...ux.dev>, "David S. Miller"
<davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Neal Cardwell <ncardwell@...gle.com>, Willem de Bruijn <willemb@...gle.com>,
Mina Almasry <almasrymina@...gle.com>, Kuniyuki Iwashima
<kuni1840@...il.com>, bpf@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCH v4 bpf-next/net 2/5] bpf: Support bpf_setsockopt() for
BPF_CGROUP_INET_SOCK_CREATE.
On 8/28/25 6:00 PM, Kuniyuki Iwashima wrote:
> +BPF_CALL_5(bpf_unlocked_sock_setsockopt, struct sock *, sk, int, level,
> + int, optname, char *, optval, int, optlen)
> +{
> + return __bpf_setsockopt(sk, level, optname, optval, optlen);
> +}
> +
> +static const struct bpf_func_proto bpf_unlocked_sock_setsockopt_proto = {
nit. There is a bpf_unlocked_"sk"_{get,set}sockopt_proto which its .func is also
taking "struct sock *". This one is sock_create specific, how about renaming it
to bpf_sock_create_{get,set}sockopt_proto. The same for the its .func.
> + .func = bpf_unlocked_sock_setsockopt,
> + .gpl_only = false,
> + .ret_type = RET_INTEGER,
> + .arg1_type = ARG_PTR_TO_CTX,
> + .arg2_type = ARG_ANYTHING,
> + .arg3_type = ARG_ANYTHING,
> + .arg4_type = ARG_PTR_TO_MEM | MEM_RDONLY,
> + .arg5_type = ARG_CONST_SIZE,
> +};
> +
> +BPF_CALL_5(bpf_unlocked_sock_getsockopt, struct sock *, sk, int, level,
> + int, optname, char *, optval, int, optlen)
> +{
> + return __bpf_getsockopt(sk, level, optname, optval, optlen);
> +}
> +
> +static const struct bpf_func_proto bpf_unlocked_sock_getsockopt_proto = {
> + .func = bpf_unlocked_sock_getsockopt,
> + .gpl_only = false,
> + .ret_type = RET_INTEGER,
> + .arg1_type = ARG_PTR_TO_CTX,
> + .arg2_type = ARG_ANYTHING,
> + .arg3_type = ARG_ANYTHING,
> + .arg4_type = ARG_PTR_TO_UNINIT_MEM,
> + .arg5_type = ARG_CONST_SIZE,
> +};
Powered by blists - more mailing lists