From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Borkmann Subject: Re: [PATCH v2 bpf-next 0/3] bpf: cleanups on managing subprog information Date: Fri, 4 May 2018 21:20:47 +0200 Message-ID: <0c0a5432-4bea-3b3d-337a-bf1a3dd39086@iogearbox.net> References: <1525292239-1309-1-git-send-email-jiong.wang@netronome.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: john.fastabend@gmail.com, ecree@solarflare.com, netdev@vger.kernel.org, oss-drivers@netronome.com To: Jiong Wang , alexei.starovoitov@gmail.com, borkmann@iogearbox.net Return-path: Received: from www62.your-server.de ([213.133.104.62]:44159 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751834AbeEDTUu (ORCPT ); Fri, 4 May 2018 15:20:50 -0400 In-Reply-To: <1525292239-1309-1-git-send-email-jiong.wang@netronome.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 05/02/2018 10:17 PM, Jiong Wang wrote: > This patch set clean up some code logic related with managing subprog > information. > > Part of the set are inspried by Edwin's code in his RFC: > > "bpf/verifier: subprog/func_call simplifications" > > but with clearer separation so it could be easier to review. > > - Path 1 unifies main prog and subprogs. All of them are registered in > env->subprog_starts. > > - After patch 1, it is clear that subprog_starts and subprog_stack_depth > could be merged as both of them now have main and subprog unified. > Patch 2 therefore does the merge, all subprog information are centred > at bpf_subprog_info. > > - Patch 3 goes further to introduce a new fake "exit" subprog which > serves as an ending marker to the subprog list. We could then turn the > following code snippets across verifier: > > if (env->subprog_cnt == cur_subprog + 1) > subprog_end = insn_cnt; > else > subprog_end = env->subprog_info[cur_subprog + 1].start; > > into: > subprog_end = env->subprog_info[cur_subprog + 1].start; > > There is no functional change by this patch set. > No bpf selftest (both non-jit and jit) regression found after this set. > > v2: > - fixed adjust_subprog_starts to also update fake "exit" subprog start. > - for John's suggestion on renaming subprog to prog, I could work on > a follow-up patch if it is recognized as worth the change. > > Jiong Wang (3): > bpf: unify main prog and subprog > bpf: centre subprog information fields > bpf: add faked "ending" subprog > > include/linux/bpf_verifier.h | 9 ++-- > kernel/bpf/verifier.c | 121 ++++++++++++++++++++++--------------------- > 2 files changed, 67 insertions(+), 63 deletions(-) > LGTM, applied to bpf-next, thanks Jiong!