Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp822895ybl; Wed, 8 Jan 2020 06:29:37 -0800 (PST) X-Google-Smtp-Source: APXvYqyp/6ZxsarTFFOX3h79BhyNzsPRLLtAp4DtPzceRM0kQJyxKcBz9zg+kWaG/TO0Pxb4ufAX X-Received: by 2002:a05:6830:2102:: with SMTP id i2mr4306081otc.123.1578493777241; Wed, 08 Jan 2020 06:29:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578493777; cv=none; d=google.com; s=arc-20160816; b=eLOAlTOSaiAXU0qHd35ywbrfwLOJolB20ZGIPN3Ks4tHQhukU8xlan4vErth7nVpdg P3kW01eaKbtRvZ1ClVu+d+ZDYsW35b42ue1XusThSBbvSw1rgjpBEapScohn0spiRc1w /FtAPXRRxjNCZRdJd2bp5l28NMqQLFavjvaFSd43HFvM+DhbbIRlfjB3b2JD9cSlee5Q TFULONr4Y87esv1nz5vudSX2Cd2W33hc8LEpDABo7oR3W73g3rXSUW0YHDnCObiuXIqE alrUUuEPxVrmxUrh2THlcsp8rP0jNlB0t/7Cv9P9W4+CMmfljsoLvJLCrTNL5klYKATb bv7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=ODlfgr6xLn+/2Tc7kRWoeyV5M/3VsXL12wvBK0xTD74=; b=H/OuJBITMBy6pApG2ZfZi3KbCzRSCzUNPfFLy6hiZWOxr4GZLoTo6JJKIx5X9jQVnM zFjnl4OUqtNN1A2QpNJYMjLWPsrBB4FdhTIzGtqUuczNH6ao4lkMekTVo8ki5vqAlGYz kczDKTPNHCodtKhkB6jCQX1miv8ZjJGh+IhHAr0qS4VMc17WIkMNusTpQEHbhY2/BjJS aHbwnIwZFXbAI2TwOLiQgymM7o9RM9MO8UbehMUh1XTMswzvRHCAh+WU1cV6yFR5RWc5 HWBrvTSMadFaQNhIR1Y/1ijk+W9Vy+v55T59B/oGIM7UAzzitf7yTm1lO59EsJb1EFNH S75g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x20si1896303otq.222.2020.01.08.06.29.24; Wed, 08 Jan 2020 06:29:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728282AbgAHNlx (ORCPT + 99 others); Wed, 8 Jan 2020 08:41:53 -0500 Received: from mx2.suse.de ([195.135.220.15]:50544 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726144AbgAHNlw (ORCPT ); Wed, 8 Jan 2020 08:41:52 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 6BEF8AE52; Wed, 8 Jan 2020 13:41:50 +0000 (UTC) Date: Wed, 8 Jan 2020 13:41:48 +0000 From: Michal Rostecki To: Quentin Monnet Cc: Michal Rostecki , bpf@vger.kernel.org, Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , Andrii Nakryiko , Jakub Kicinski , Stanislav Fomichev , Peter Wu , Prashant Bhole , 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 Message-ID: <20200108134148.GD2954@wotan.suse.de> References: <20200107130308.20242-1-mrostecki@opensuse.org> <20200107130308.20242-3-mrostecki@opensuse.org> <70565317-89af-358f-313c-c4b327cdca4a@netronome.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <70565317-89af-358f-313c-c4b327cdca4a@netronome.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > > 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 > > --- > > 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