Re: [PATCH net-next v5 01/15] net-timestamp: add support for bpf_setsockopt()

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

 



Thanks for the report.

On Sun, Jan 12, 2025 at 10:50 PM kernel test robot <lkp@xxxxxxxxx> wrote:
>
> Hi Jason,
>
> kernel test robot noticed the following build warnings:
>
> [auto build test WARNING on net-next/main]
>
> url:    https://github.com/intel-lab-lkp/linux/commits/Jason-Xing/net-timestamp-add-support-for-bpf_setsockopt/20250112-194115
> base:   net-next/main
> patch link:    https://lore.kernel.org/r/20250112113748.73504-2-kerneljasonxing%40gmail.com
> patch subject: [PATCH net-next v5 01/15] net-timestamp: add support for bpf_setsockopt()
> config: i386-buildonly-randconfig-005-20250112 (https://download.01.org/0day-ci/archive/20250112/202501122252.dqEPb1Wd-lkp@xxxxxxxxx/config)
> compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250112/202501122252.dqEPb1Wd-lkp@xxxxxxxxx/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@xxxxxxxxx>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202501122252.dqEPb1Wd-lkp@xxxxxxxxx/
>
> All warnings (new ones prefixed by >>):
>
>    net/core/filter.c: In function 'sk_bpf_set_cb_flags':
>    net/core/filter.c:5237:11: error: 'struct sock' has no member named 'sk_bpf_cb_flags'
>     5237 |         sk->sk_bpf_cb_flags = sk_bpf_cb_flags;
>          |           ^~

Strange. In this series, I've already ensured that the caller of
sk_bpf_set_cb_flags is protected under CONFIG_BPF_SYSCALL, which is
the same as sk_bpf_cb_flags.

I wonder how it accesses the sk_bpf_cb_flags field if the function it
belongs to is not used, see more details as below (like "defined but
not used").

Thanks,
Jason

>    net/core/filter.c: At top level:
> >> net/core/filter.c:5225:12: warning: 'sk_bpf_set_cb_flags' defined but not used [-Wunused-function]
>     5225 | static int sk_bpf_set_cb_flags(struct sock *sk, char *optval, bool getopt)
>          |            ^~~~~~~~~~~~~~~~~~~
>
>
> vim +/sk_bpf_set_cb_flags +5225 net/core/filter.c
>
>   5224
> > 5225  static int sk_bpf_set_cb_flags(struct sock *sk, char *optval, bool getopt)
>   5226  {
>   5227          u32 sk_bpf_cb_flags;
>   5228
>   5229          if (getopt)
>   5230                  return -EINVAL;
>   5231
>   5232          sk_bpf_cb_flags = *(u32 *)optval;
>   5233
>   5234          if (sk_bpf_cb_flags & ~SK_BPF_CB_MASK)
>   5235                  return -EINVAL;
>   5236
> > 5237          sk->sk_bpf_cb_flags = sk_bpf_cb_flags;
>   5238
>   5239          return 0;
>   5240  }
>   5241
>
> --
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests/wiki





[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