[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9ebf3b8d8d115e83a64c2181372017d6bbb8f51f.camel@gmail.com>
Date: Mon, 03 Feb 2025 21:57:27 -0800
From: Eduard Zingerman <eddyz87@...il.com>
To: Amery Hung <ameryhung@...il.com>, netdev@...r.kernel.org
Cc: bpf@...r.kernel.org, daniel@...earbox.net, andrii@...nel.org,
alexei.starovoitov@...il.com, martin.lau@...nel.org, kuba@...nel.org,
edumazet@...gle.com, xiyou.wangcong@...il.com, cong.wang@...edance.com,
jhs@...atatu.com, sinquersw@...il.com, toke@...hat.com, jiri@...nulli.us,
stfomichev@...il.com, ekarani.silvestre@....ufcg.edu.br,
yangpeihao@...u.edu.cn, yepeilin.cs@...il.com, ming.lei@...hat.com,
kernel-team@...a.com
Subject: Re: [PATCH bpf-next v3 02/18] bpf: Support getting referenced kptr
from struct_ops argument
On Fri, 2025-01-31 at 11:28 -0800, Amery Hung wrote:
> From: Amery Hung <amery.hung@...edance.com>
>
> Allows struct_ops programs to acqurie referenced kptrs from arguments
> by directly reading the argument.
>
> The verifier will acquire a reference for struct_ops a argument tagged
> with "__ref" in the stub function in the beginning of the main program.
> The user will be able to access the referenced kptr directly by reading
> the context as long as it has not been released by the program.
>
> This new mechanism to acquire referenced kptr (compared to the existing
> "kfunc with KF_ACQUIRE") is introduced for ergonomic and semantic reasons.
> In the first use case, Qdisc_ops, an skb is passed to .enqueue in the
> first argument. This mechanism provides a natural way for users to get a
> referenced kptr in the .enqueue struct_ops programs and makes sure that a
> qdisc will always enqueue or drop the skb.
>
> Signed-off-by: Amery Hung <amery.hung@...edance.com>
> ---
Acked-by: Eduard Zingerman <eddyz87@...il.com>
[...]
Powered by blists - more mailing lists