Netdev List
 help / color / mirror / Atom feed
* [wireless-testsing2:master 1/4] drivers/net/netdevsim/bpf.c:130:14: sparse: incompatible types for 'case' statement
@ 2018-01-03 19:53 kbuild test robot
  2018-01-04  1:02 ` Jakub Kicinski
  0 siblings, 1 reply; 4+ messages in thread
From: kbuild test robot @ 2018-01-03 19:53 UTC (permalink / raw)
  To: David S. Miller; +Cc: kbuild-all, netdev, Bob Copeland

[-- 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 --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [wireless-testsing2:master 1/4] drivers/net/netdevsim/bpf.c:130:14: sparse: incompatible types for 'case' statement
  2018-01-03 19:53 [wireless-testsing2:master 1/4] drivers/net/netdevsim/bpf.c:130:14: sparse: incompatible types for 'case' statement kbuild test robot
@ 2018-01-04  1:02 ` Jakub Kicinski
  2018-01-04 15:56   ` Bob Copeland
  2018-01-06  7:04   ` Fengguang Wu
  0 siblings, 2 replies; 4+ messages in thread
From: Jakub Kicinski @ 2018-01-04  1:02 UTC (permalink / raw)
  To: kbuild test robot; +Cc: David S. Miller, kbuild-all, netdev, Bob Copeland

On Thu, 4 Jan 2018 03:53:20 +0800, kbuild test robot wrote:
> 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__

>    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

FWIW looks like the tree contains old net-next code and latest net
(linux/master) code.  Pulling from net-next will solve this.

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

Interestingly Daniel and I were not CCed on the report, is this
intentional?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [wireless-testsing2:master 1/4] drivers/net/netdevsim/bpf.c:130:14: sparse: incompatible types for 'case' statement
  2018-01-04  1:02 ` Jakub Kicinski
@ 2018-01-04 15:56   ` Bob Copeland
  2018-01-06  7:04   ` Fengguang Wu
  1 sibling, 0 replies; 4+ messages in thread
From: Bob Copeland @ 2018-01-04 15:56 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: kbuild test robot, David S. Miller, kbuild-all, netdev

On Wed, Jan 03, 2018 at 05:02:37PM -0800, Jakub Kicinski wrote:
> >    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
> 
> FWIW looks like the tree contains old net-next code and latest net
> (linux/master) code.  Pulling from net-next will solve this.
>

Thanks, yes, sorry about the noise.  This tree doesn't always pull net-next,
but I'll do so and compile-test netdevsim in next build.

> > :::::: TO: Jakub Kicinski <jakub.kicinski@netronome.com>
> > :::::: CC: Daniel Borkmann <daniel@iogearbox.net>
> 
> Interestingly Daniel and I were not CCed on the report, is this
> intentional?

One for kbuildbot team I guess, not sure how it determines whom to email.
Personally I would be ok if only myself and maybe linux-wireless got the
emails for this tree since most build failures are similar noise.

-- 
Bob Copeland %% https://bobcopeland.com/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [wireless-testsing2:master 1/4] drivers/net/netdevsim/bpf.c:130:14: sparse: incompatible types for 'case' statement
  2018-01-04  1:02 ` Jakub Kicinski
  2018-01-04 15:56   ` Bob Copeland
@ 2018-01-06  7:04   ` Fengguang Wu
  1 sibling, 0 replies; 4+ messages in thread
From: Fengguang Wu @ 2018-01-06  7:04 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: David S. Miller, kbuild-all, netdev, Bob Copeland

On Wed, Jan 03, 2018 at 05:02:37PM -0800, Jakub Kicinski wrote:
>On Thu, 4 Jan 2018 03:53:20 +0800, kbuild test robot wrote:
>> 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__
>
>>    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
>
>FWIW looks like the tree contains old net-next code and latest net
>(linux/master) code.  Pulling from net-next will solve this.
>
>> :::::: TO: Jakub Kicinski <jakub.kicinski@netronome.com>
>> :::::: CC: Daniel Borkmann <daniel@iogearbox.net>
>
>Interestingly Daniel and I were not CCed on the report, is this
>intentional?

Yeah the above ":::::: TO/CC" lines are for manual addition when
appropriate. They are the author/committer of the commit that last
modified the code line in question.

Thanks,
Fengguang

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-01-06  7:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-03 19:53 [wireless-testsing2:master 1/4] drivers/net/netdevsim/bpf.c:130:14: sparse: incompatible types for 'case' statement kbuild test robot
2018-01-04  1:02 ` Jakub Kicinski
2018-01-04 15:56   ` Bob Copeland
2018-01-06  7:04   ` Fengguang Wu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox