bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Martin KaFai Lau <kafai@fb.com>
To: Hou Tao <houtao1@huawei.com>
Cc: Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>, <netdev@vger.kernel.org>,
	<bpf@vger.kernel.org>
Subject: Re: [PATCH bpf-next 2/5] bpf: factor out a helper to prepare trampoline for struct_ops prog
Date: Fri, 1 Oct 2021 10:39:32 -0700	[thread overview]
Message-ID: <20211001173932.d6tknlfnqg2o6uu3@kafai-mbp> (raw)
In-Reply-To: <74247c43-39df-6872-4de6-8f4136ac37cd@huawei.com>

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
{

}

  reply	other threads:[~2021-10-01 17:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-28  2:52 [PATCH bpf-next 0/5] introduce dummy BPF STRUCT_OPS Hou Tao
2021-09-28  2:52 ` [PATCH bpf-next 1/5] bpf: add dummy BPF STRUCT_OPS for test purpose Hou Tao
2021-09-28  2:52 ` [PATCH bpf-next 2/5] bpf: factor out a helper to prepare trampoline for struct_ops prog Hou Tao
2021-09-29 17:56   ` Martin KaFai Lau
2021-09-30 10:17     ` Hou Tao
2021-10-01 17:39       ` Martin KaFai Lau [this message]
2021-09-28  2:52 ` [PATCH bpf-next 3/5] bpf: do .test_run in dummy BPF STRUCT_OPS Hou Tao
2021-09-29 18:55   ` Martin KaFai Lau
2021-09-30 11:05     ` Hou Tao
2021-10-01 19:09       ` Martin KaFai Lau
2021-09-28  2:52 ` [PATCH bpf-next 4/5] bpf: hook .test_run for struct_ops program Hou Tao
2021-09-28  2:52 ` [PATCH bpf-next 5/5] selftests/bpf: test return value handling for struct_ops prog Hou Tao
2021-09-28 23:19   ` Andrii Nakryiko
2021-09-30 11:08     ` Hou Tao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211001173932.d6tknlfnqg2o6uu3@kafai-mbp \
    --to=kafai@fb.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=houtao1@huawei.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).