lkml.org 
[lkml]   [2020]   [Mar]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH bpf-next v2 1/7] bpf: Refactor trampoline update code
On 03-Mär 20:49, Andrii Nakryiko wrote:
> On Tue, Mar 3, 2020 at 5:56 PM KP Singh <kpsingh@chromium.org> wrote:
> >
> > From: KP Singh <kpsingh@google.com>
> >
> > As we need to introduce a third type of attachment for trampolines, the
> > flattened signature of arch_prepare_bpf_trampoline gets even more
> > complicated.
> >
> > Refactor the prog and count argument to arch_prepare_bpf_trampoline to
> > use bpf_tramp_progs to simplify the addition and accounting for new
> > attachment types.
> >
> > Signed-off-by: KP Singh <kpsingh@google.com>
> > ---
>
> See note about const-ification of trampoline and naming suggestion,
> but looks good overall:
>
> Acked-by: Andrii Nakryiko <andriin@fb.com>
>
> > +static struct bpf_tramp_progs *
> > +bpf_trampoline_update_progs(struct bpf_trampoline *tr, int *total)
>
> reading the code again, seems like bpf_trampoline_update_progs is
> really more like bpf_trampoline_get_progs, no? It doesn't modify
> trampoline itself, so might as well mark tr as const pointer.

Makes sense. I will send a v3 with these some minor fixes by EOD ZRH.

- KP

>
>
> > +{
> > + struct bpf_tramp_progs *tprogs;
> > + struct bpf_prog **progs;
> > + struct bpf_prog_aux *aux;
> > + int kind;
> > +
>
> [...]

\
 
 \ /
  Last update: 2020-03-04 16:12    [W:0.060 / U:15.536 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site