Re: [PATCH bpf-next 3/3] bpf: Inline calls to bpf_loop when callback is known

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Eduard,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on bpf-next/master]

url:    https://github.com/intel-lab-lkp/linux/commits/Eduard-Zingerman/bpf_loop-inlining/20220528-075454
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
config: x86_64-randconfig-a013 (https://download.01.org/0day-ci/archive/20220528/202205281148.rY3lJqB4-lkp@xxxxxxxxx/config)
compiler: gcc-11 (Debian 11.3.0-1) 11.3.0
reproduce (this is a W=1 build):
        # https://github.com/intel-lab-lkp/linux/commit/05c5a11449d4e5c75ada599a71d8290bef8a5d1a
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Eduard-Zingerman/bpf_loop-inlining/20220528-075454
        git checkout 05c5a11449d4e5c75ada599a71d8290bef8a5d1a
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash kernel/bpf/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

   kernel/bpf/verifier.c: In function 'adjust_stack_depth_for_loop_inlining':
>> kernel/bpf/verifier.c:7127:16: warning: variable 'subprog_start' set but not used [-Wunused-but-set-variable]
    7127 |         int i, subprog_start, subprog_end, cur_subprog = 0;
         |                ^~~~~~~~~~~~~


vim +/subprog_start +7127 kernel/bpf/verifier.c

  7117	
  7118	/* For all sub-programs in the program (including main) checks
  7119	 * insn_aux_data to see if there are bpf_loop calls that require
  7120	 * inlining. If such calls are found subprog stack_depth is increased
  7121	 * by the size of 3 registers. Reserved space would be used in the
  7122	 * do_misc_fixups to spill values of the R6, R7, R8 to use these
  7123	 * registers for loop iteration.
  7124	 */
  7125	static void adjust_stack_depth_for_loop_inlining(struct bpf_verifier_env *env)
  7126	{
> 7127		int i, subprog_start, subprog_end, cur_subprog = 0;
  7128		struct bpf_subprog_info *subprog = env->subprog_info;
  7129		int insn_cnt = env->prog->len;
  7130	
  7131		subprog_start = subprog[cur_subprog].start;
  7132		subprog_end = env->subprog_cnt > 1
  7133			? subprog[cur_subprog + 1].start
  7134			: insn_cnt;
  7135		for (i = 0; i < insn_cnt; i++) {
  7136			if (fit_for_bpf_loop_inline(&env->insn_aux_data[i])) {
  7137				/* reserve space for 3 registers  */
  7138				subprog->stack_depth += BPF_REG_SIZE * 3;
  7139				/* skip to the next subprog */
  7140				i = subprog_end - 1;
  7141			}
  7142			if (i == subprog_end - 1) {
  7143				subprog_start = subprog_end;
  7144				cur_subprog++;
  7145				if (cur_subprog < env->subprog_cnt)
  7146					subprog_end = subprog[cur_subprog + 1].start;
  7147			}
  7148		}
  7149	
  7150		env->prog->aux->stack_depth = env->subprog_info[0].stack_depth;
  7151	}
  7152	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux