[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20211001173932.d6tknlfnqg2o6uu3@kafai-mbp>
Date: Fri, 1 Oct 2021 10:39:32 -0700
From: Martin KaFai Lau <kafai@...com>
To: Hou Tao <houtao1@...wei.com>
CC: Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Andrii Nakryiko <andrii@...nel.org>, <netdev@...r.kernel.org>,
<bpf@...r.kernel.org>
Subject: Re: [PATCH bpf-next 2/5] bpf: factor out a helper to prepare
trampoline for struct_ops prog
On Thu, Sep 30, 2021 at 06:17:33PM +0800, Hou Tao wrote:
> >> +int bpf_prepare_st_ops_prog(struct bpf_tramp_progs *tprogs,
> >> + struct bpf_prog *prog,
> >> + const struct btf_func_model *model,
> >> + void *image, void *image_end)
> > The existing struct_ops functions in the kernel now have naming like
> > bpf_struct_ops_.*(). How about renaming it to
> > bpf_struct_ops_prepare_trampoline()?
> bpf_struct_ops_prepare_trampoline() may be a little long, and it will make
> the indentations of its parameters look ugly, so how about
> bpf_struct_ops_prep_prog() ?
hmm... naming is hard...
but it is preparing the trampoline instead of preparing the
prog, and most other bpf funcs are using 'prepare' instead of 'prep'.
My preference is a better naming on what the func does and a
consistent naming with others. The indentation looks fine also.
It is not too bad ;)
bpf_struct_ops_prepare_prog()
arch_prepare_bpf_trampoline()
bpf_struct_ops_prepare_trampoline()
The params indentation looks fine and within 80 cols:
int bpf_struct_ops_prepare_trampoline(struct bpf_tramp_progs *tprogs,
struct bpf_prog *prog,
const struct btf_func_model *model,
void *image, void *image_end0
{
}
Powered by blists - more mailing lists