[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aKzMxKViOGjxFhiW@mini-arch>
Date: Mon, 25 Aug 2025 13:51:16 -0700
From: Stanislav Fomichev <stfomichev@...il.com>
To: Kuniyuki Iwashima <kuniyu@...gle.com>
Cc: Alexei Starovoitov <ast@...nel.org>,
Andrii Nakryiko <andrii@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Martin KaFai Lau <martin.lau@...ux.dev>,
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 v2 bpf-next/net 2/8] bpf: Add a bpf hook in
__inet_accept().
On 08/25, Kuniyuki Iwashima wrote:
> We will store a flag in sk->sk_memcg by bpf_setsockopt().
>
> For a new child socket, memcg is not allocated until accept(),
> and the child's sk_memcg is not always the parent's one.
>
> For details, see commit e876ecc67db8 ("cgroup: memcg: net: do not
> associate sock with unrelated cgroup") and commit d752a4986532
> ("net: memcg: late association of sock to memcg").
>
> Let's add a new hook for BPF_PROG_TYPE_CGROUP_SOCK in
> __inet_accept().
>
> This hook does not fail by not supporting bpf_set_retval().
>
> Signed-off-by: Kuniyuki Iwashima <kuniyu@...gle.com>
And similarly to [0], doing it in sock_ops's BPF_SOCK_OPS_PASSIVE_ESTABLISHED_CB
is not an option because you want to run in the process context instead
of softirq?
0: https://lore.kernel.org/netdev/daa73a77-3366-45b4-a770-fde87d4f50d8@linux.dev/
Powered by blists - more mailing lists