linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michal Rostecki <mrostecki@opensuse.org>
To: Quentin Monnet <quentin.monnet@netronome.com>
Cc: Michal Rostecki <mrostecki@opensuse.org>,
	bpf@vger.kernel.org, Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Martin KaFai Lau <kafai@fb.com>, Song Liu <songliubraving@fb.com>,
	Yonghong Song <yhs@fb.com>, Andrii Nakryiko <andriin@fb.com>,
	Jakub Kicinski <jakub.kicinski@netronome.com>,
	Stanislav Fomichev <sdf@google.com>,
	Peter Wu <peter@lekensteyn.nl>,
	Prashant Bhole <bhole_prashant_q7@lab.ntt.co.jp>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH bpf-next v2 2/2] bpftool: Add misc secion and probe for large INSN limit
Date: Wed, 8 Jan 2020 13:41:48 +0000	[thread overview]
Message-ID: <20200108134148.GD2954@wotan.suse.de> (raw)
In-Reply-To: <70565317-89af-358f-313c-c4b327cdca4a@netronome.com>

On Tue, Jan 07, 2020 at 02:36:15PM +0000, Quentin Monnet wrote:
> Nit: typo in subject ("secion").
> 
> 2020-01-07 14:03 UTC+0100 ~ Michal Rostecki <mrostecki@opensuse.org>
> > Introduce a new probe section (misc) for probes not related to concrete
> > map types, program types, functions or kernel configuration. Introduce a
> > probe for large INSN limit as the first one in that section.
> > 
> > Signed-off-by: Michal Rostecki <mrostecki@opensuse.org>
> > ---
> >  tools/bpf/bpftool/feature.c | 18 ++++++++++++++++++
> >  1 file changed, 18 insertions(+)
> > 
> > diff --git a/tools/bpf/bpftool/feature.c b/tools/bpf/bpftool/feature.c
> > index 03bdc5b3ac49..d8ce93092c45 100644
> > --- a/tools/bpf/bpftool/feature.c
> > +++ b/tools/bpf/bpftool/feature.c
> > @@ -572,6 +572,18 @@ probe_helpers_for_progtype(enum bpf_prog_type prog_type, bool supported_type,
> >  		printf("\n");
> >  }
> >  
> > +static void
> > +probe_large_insn_limit(const char *define_prefix, __u32 ifindex)
> > +{
> > +	bool res;
> > +
> > +	res = bpf_probe_large_insn_limit(ifindex);
> > +	print_bool_feature("have_large_insn_limit",
> > +			   "Large complexity and program size limit",
> 
> I am not sure we should mention "complexity" here. Although it is
> related to program size in the kernel commit you describe, the probe
> that is run is only on instruction number. This can make a difference
> for offloaded programs: When you probe a device, if kernel has commit
> c04c0d2b968a and supports up to 1M instructions, but hardware supports
> no more than 4k instructions, you may still benefit from the new value
> for BPF_COMPLEXITY_LIMIT_INSNS for complexity, but not for the total
> number of available instructions. In that case the probe will fail, and
> the message on complexity would not be accurate.
> 
> Looks good otherwise, thanks Michal!
> 
> Quentin

Thanks for review! Should I change the description just to "Large
program size limit" or "Large instruction limit"?

Michal

  reply	other threads:[~2020-01-08 13:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-07 13:03 [PATCH bpf-next v2 0/2] bpftool/libbpf: Add probe for large INSN limit Michal Rostecki
2020-01-07 13:03 ` [PATCH bpf-next v2 1/2] libbpf: " Michal Rostecki
2020-01-07 13:03 ` [PATCH bpf-next v2 2/2] bpftool: Add misc secion and " Michal Rostecki
2020-01-07 14:36   ` Quentin Monnet
2020-01-08 13:41     ` Michal Rostecki [this message]
2020-01-08 15:28       ` Quentin Monnet

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=20200108134148.GD2954@wotan.suse.de \
    --to=mrostecki@opensuse.org \
    --cc=andriin@fb.com \
    --cc=ast@kernel.org \
    --cc=bhole_prashant_q7@lab.ntt.co.jp \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=jakub.kicinski@netronome.com \
    --cc=kafai@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=peter@lekensteyn.nl \
    --cc=quentin.monnet@netronome.com \
    --cc=sdf@google.com \
    --cc=songliubraving@fb.com \
    --cc=yhs@fb.com \
    /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).