lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <201801040317.tEFQay7W%fengguang.wu@intel.com>
Date:   Thu, 4 Jan 2018 03:53:20 +0800
From:   kbuild test robot <fengguang.wu@...el.com>
To:     "David S. Miller" <davem@...emloft.net>
Cc:     kbuild-all@...org, netdev@...r.kernel.org,
        Bob Copeland <me@...copeland.com>
Subject: [wireless-testsing2:master 1/4] drivers/net/netdevsim/bpf.c:130:14:
 sparse: incompatible types for 'case' statement

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-testing.git master
head:   6b3b30d0c31ddb2f4d8208c90bc2b4adef47204d
commit: af2cae39f6ab9dc596616d6a28c7772e1dd55e91 [1/4] Merge remote-tracking branch 'wireless-drivers-next/master'
reproduce:
        # apt-get install sparse
        git checkout af2cae39f6ab9dc596616d6a28c7772e1dd55e91
        make ARCH=x86_64 allmodconfig
        make C=1 CF=-D__CHECK_ENDIAN__

All errors (new ones prefixed by >>):

   drivers/net/netdevsim/bpf.c:130:14: sparse: undefined identifier 'TC_CLSBPF_REPLACE'
   drivers/net/netdevsim/bpf.c:132:14: sparse: undefined identifier 'TC_CLSBPF_ADD'
   drivers/net/netdevsim/bpf.c:134:14: sparse: undefined identifier 'TC_CLSBPF_DESTROY'
   drivers/net/netdevsim/bpf.c:130:14: sparse: incompatible types for 'case' statement
   drivers/net/netdevsim/bpf.c:132:14: sparse: incompatible types for 'case' statement
   drivers/net/netdevsim/bpf.c:134:14: sparse: incompatible types for 'case' statement
   drivers/net/netdevsim/bpf.c:130:14: sparse: Expected constant expression in case statement
   drivers/net/netdevsim/bpf.c:132:14: sparse: Expected constant expression in case statement
   drivers/net/netdevsim/bpf.c:134:14: sparse: Expected constant expression in case statement
   drivers/net/netdevsim/bpf.c: In function 'nsim_bpf_setup_tc_block_cb':
>> drivers/net/netdevsim/bpf.c:130:7: error: 'TC_CLSBPF_REPLACE' undeclared (first use in this function); did you mean 'TC_RED_REPLACE'?
     case TC_CLSBPF_REPLACE:
          ^~~~~~~~~~~~~~~~~
          TC_RED_REPLACE
   drivers/net/netdevsim/bpf.c:130:7: note: each undeclared identifier is reported only once for each function it appears in
>> drivers/net/netdevsim/bpf.c:132:7: error: 'TC_CLSBPF_ADD' undeclared (first use in this function); did you mean 'TC_CLSBPF_STATS'?
     case TC_CLSBPF_ADD:
          ^~~~~~~~~~~~~
          TC_CLSBPF_STATS
>> drivers/net/netdevsim/bpf.c:134:7: error: 'TC_CLSBPF_DESTROY' undeclared (first use in this function); did you mean 'TC_CLSBPF_STATS'?
     case TC_CLSBPF_DESTROY:
          ^~~~~~~~~~~~~~~~~
          TC_CLSBPF_STATS

sparse warnings: (new ones prefixed by >>)


vim +/case +130 drivers/net/netdevsim/bpf.c

31d3ad83 Jakub Kicinski 2017-12-01  103  
31d3ad83 Jakub Kicinski 2017-12-01  104  int nsim_bpf_setup_tc_block_cb(enum tc_setup_type type,
31d3ad83 Jakub Kicinski 2017-12-01  105  			       void *type_data, void *cb_priv)
31d3ad83 Jakub Kicinski 2017-12-01  106  {
31d3ad83 Jakub Kicinski 2017-12-01  107  	struct tc_cls_bpf_offload *cls_bpf = type_data;
31d3ad83 Jakub Kicinski 2017-12-01  108  	struct bpf_prog *prog = cls_bpf->prog;
31d3ad83 Jakub Kicinski 2017-12-01  109  	struct netdevsim *ns = cb_priv;
31d3ad83 Jakub Kicinski 2017-12-01  110  	bool skip_sw;
31d3ad83 Jakub Kicinski 2017-12-01  111  
31d3ad83 Jakub Kicinski 2017-12-01  112  	if (type != TC_SETUP_CLSBPF ||
31d3ad83 Jakub Kicinski 2017-12-01  113  	    !tc_can_offload(ns->netdev) ||
31d3ad83 Jakub Kicinski 2017-12-01  114  	    cls_bpf->common.protocol != htons(ETH_P_ALL) ||
31d3ad83 Jakub Kicinski 2017-12-01  115  	    cls_bpf->common.chain_index)
31d3ad83 Jakub Kicinski 2017-12-01  116  		return -EOPNOTSUPP;
31d3ad83 Jakub Kicinski 2017-12-01  117  
31d3ad83 Jakub Kicinski 2017-12-01  118  	skip_sw = cls_bpf->gen_flags & TCA_CLS_FLAGS_SKIP_SW;
31d3ad83 Jakub Kicinski 2017-12-01  119  
31d3ad83 Jakub Kicinski 2017-12-01  120  	if (nsim_xdp_offload_active(ns))
31d3ad83 Jakub Kicinski 2017-12-01  121  		return -EBUSY;
31d3ad83 Jakub Kicinski 2017-12-01  122  
31d3ad83 Jakub Kicinski 2017-12-01  123  	if (!ns->bpf_tc_accept)
31d3ad83 Jakub Kicinski 2017-12-01  124  		return -EOPNOTSUPP;
31d3ad83 Jakub Kicinski 2017-12-01  125  	/* Note: progs without skip_sw will probably not be dev bound */
31d3ad83 Jakub Kicinski 2017-12-01  126  	if (prog && !prog->aux->offload && !ns->bpf_tc_non_bound_accept)
31d3ad83 Jakub Kicinski 2017-12-01  127  		return -EOPNOTSUPP;
31d3ad83 Jakub Kicinski 2017-12-01  128  
31d3ad83 Jakub Kicinski 2017-12-01  129  	switch (cls_bpf->command) {
31d3ad83 Jakub Kicinski 2017-12-01 @130  	case TC_CLSBPF_REPLACE:
31d3ad83 Jakub Kicinski 2017-12-01  131  		return nsim_bpf_offload(ns, prog, true);
31d3ad83 Jakub Kicinski 2017-12-01 @132  	case TC_CLSBPF_ADD:
31d3ad83 Jakub Kicinski 2017-12-01  133  		return nsim_bpf_offload(ns, prog, false);
31d3ad83 Jakub Kicinski 2017-12-01 @134  	case TC_CLSBPF_DESTROY:
31d3ad83 Jakub Kicinski 2017-12-01  135  		return nsim_bpf_offload(ns, NULL, true);
31d3ad83 Jakub Kicinski 2017-12-01  136  	default:
31d3ad83 Jakub Kicinski 2017-12-01  137  		return -EOPNOTSUPP;
31d3ad83 Jakub Kicinski 2017-12-01  138  	}
31d3ad83 Jakub Kicinski 2017-12-01  139  }
31d3ad83 Jakub Kicinski 2017-12-01  140  

:::::: The code at line 130 was first introduced by commit
:::::: 31d3ad832948c75139b0e5b653912f7898a1d5d5 netdevsim: add bpf offload support

:::::: TO: Jakub Kicinski <jakub.kicinski@...ronome.com>
:::::: CC: Daniel Borkmann <daniel@...earbox.net>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Download attachment ".config.gz" of type "application/gzip" (62408 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ