From: kbuild test robot <fengguang.wu@intel.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: kbuild-all@01.org, netdev@vger.kernel.org,
Bob Copeland <me@bobcopeland.com>
Subject: [wireless-testsing2:master 1/4] drivers/net/netdevsim/bpf.c:130:14: sparse: incompatible types for 'case' statement
Date: Thu, 4 Jan 2018 03:53:20 +0800 [thread overview]
Message-ID: <201801040317.tEFQay7W%fengguang.wu@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 5187 bytes --]
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@netronome.com>
:::::: CC: Daniel Borkmann <daniel@iogearbox.net>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 62408 bytes --]
next reply other threads:[~2018-01-03 19:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-03 19:53 kbuild test robot [this message]
2018-01-04 1:02 ` [wireless-testsing2:master 1/4] drivers/net/netdevsim/bpf.c:130:14: sparse: incompatible types for 'case' statement Jakub Kicinski
2018-01-04 15:56 ` Bob Copeland
2018-01-06 7:04 ` Fengguang Wu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201801040317.tEFQay7W%fengguang.wu@intel.com \
--to=fengguang.wu@intel.com \
--cc=davem@davemloft.net \
--cc=kbuild-all@01.org \
--cc=me@bobcopeland.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox