All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Tanner Love <tannerlove.kernel@gmail.com>, netdev@vger.kernel.org
Cc: kbuild-all@lists.01.org, davem@davemloft.net,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>,
	Eric Dumazet <edumazet@google.com>,
	Willem de Bruijn <willemb@google.com>,
	Petar Penkov <ppenkov@google.com>,
	Jakub Kicinski <kuba@kernel.org>,
	"Michael S . Tsirkin" <mst@redhat.com>
Subject: Re: [PATCH net-next v7 1/3] net: flow_dissector: extend bpf flow dissector support with vnet hdr
Date: Fri, 18 Jun 2021 01:07:58 +0800	[thread overview]
Message-ID: <202106180013.j1Brew82-lkp@intel.com> (raw)
In-Reply-To: <20210616203448.995314-2-tannerlove.kernel@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 5162 bytes --]

Hi Tanner,

Thank you for the patch! Perhaps something to improve:

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

url:    https://github.com/0day-ci/linux/commits/Tanner-Love/virtio_net-add-optional-flow-dissection-in-virtio_net_hdr_to_skb/20210617-082208
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 0c33795231bff5df410bd405b569c66851e92d4b
config: s390-randconfig-s031-20210617 (attached as .config)
compiler: s390-linux-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.3-341-g8af24329-dirty
        # https://github.com/0day-ci/linux/commit/b03a1eb684b925a09ae011d0e620d98ebf3b0abd
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Tanner-Love/virtio_net-add-optional-flow-dissection-in-virtio_net_hdr_to_skb/20210617-082208
        git checkout b03a1eb684b925a09ae011d0e620d98ebf3b0abd
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' W=1 ARCH=s390 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


sparse warnings: (new ones prefixed by >>)
>> net/core/flow_dissector.c:882:40: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __virtio16 [assigned] [usertype] hdr_len @@     got unsigned short @@
   net/core/flow_dissector.c:882:40: sparse:     expected restricted __virtio16 [assigned] [usertype] hdr_len
   net/core/flow_dissector.c:882:40: sparse:     got unsigned short
>> net/core/flow_dissector.c:884:41: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __virtio16 [assigned] [usertype] gso_size @@     got unsigned short @@
   net/core/flow_dissector.c:884:41: sparse:     expected restricted __virtio16 [assigned] [usertype] gso_size
   net/core/flow_dissector.c:884:41: sparse:     got unsigned short
>> net/core/flow_dissector.c:886:43: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __virtio16 [assigned] [usertype] csum_start @@     got unsigned short @@
   net/core/flow_dissector.c:886:43: sparse:     expected restricted __virtio16 [assigned] [usertype] csum_start
   net/core/flow_dissector.c:886:43: sparse:     got unsigned short
>> net/core/flow_dissector.c:888:44: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __virtio16 [assigned] [usertype] csum_offset @@     got unsigned short @@
   net/core/flow_dissector.c:888:44: sparse:     expected restricted __virtio16 [assigned] [usertype] csum_offset
   net/core/flow_dissector.c:888:44: sparse:     got unsigned short

vim +882 net/core/flow_dissector.c

   866	
   867	bool bpf_flow_dissect(struct bpf_prog *prog, struct bpf_flow_dissector *ctx,
   868			      __be16 proto, int nhoff, int hlen, unsigned int flags,
   869			      const struct virtio_net_hdr *vhdr,
   870			      bool vhdr_is_little_endian)
   871	{
   872		struct bpf_flow_keys *flow_keys = ctx->flow_keys;
   873		u32 result;
   874	
   875	/* vnet hdr is either machine endian (virtio spec < v1) or le (>= v1) */
   876	#if defined(__BIG_ENDIAN_BITFIELD)
   877		struct virtio_net_hdr vnet_hdr_local;
   878	
   879		if (vhdr && vhdr_is_little_endian) {
   880			vnet_hdr_local.flags = vhdr->flags;
   881			vnet_hdr_local.gso_type = vhdr->gso_type;
 > 882			vnet_hdr_local.hdr_len = __virtio16_to_cpu(false,
   883								   vhdr->hdr_len);
 > 884			vnet_hdr_local.gso_size = __virtio16_to_cpu(false,
   885								    vhdr->gso_size);
 > 886			vnet_hdr_local.csum_start = __virtio16_to_cpu(false,
   887								      vhdr->csum_start);
 > 888			vnet_hdr_local.csum_offset = __virtio16_to_cpu(false,
   889								       vhdr->csum_offset);
   890			vhdr = &vnet_hdr_local;
   891		}
   892	#endif
   893	
   894		/* Pass parameters to the BPF program */
   895		memset(flow_keys, 0, sizeof(*flow_keys));
   896		flow_keys->n_proto = proto;
   897		flow_keys->nhoff = nhoff;
   898		flow_keys->thoff = flow_keys->nhoff;
   899		flow_keys->vhdr = vhdr;
   900	
   901		BUILD_BUG_ON((int)BPF_FLOW_DISSECTOR_F_PARSE_1ST_FRAG !=
   902			     (int)FLOW_DISSECTOR_F_PARSE_1ST_FRAG);
   903		BUILD_BUG_ON((int)BPF_FLOW_DISSECTOR_F_STOP_AT_FLOW_LABEL !=
   904			     (int)FLOW_DISSECTOR_F_STOP_AT_FLOW_LABEL);
   905		BUILD_BUG_ON((int)BPF_FLOW_DISSECTOR_F_STOP_AT_ENCAP !=
   906			     (int)FLOW_DISSECTOR_F_STOP_AT_ENCAP);
   907		flow_keys->flags = flags;
   908	
   909		result = bpf_prog_run_pin_on_cpu(prog, ctx);
   910	
   911		flow_keys->nhoff = clamp_t(u16, flow_keys->nhoff, nhoff, hlen);
   912		flow_keys->thoff = clamp_t(u16, flow_keys->thoff,
   913					   flow_keys->nhoff, hlen);
   914	
   915		return result == BPF_OK;
   916	}
   917	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 17392 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH net-next v7 1/3] net: flow_dissector: extend bpf flow dissector support with vnet hdr
Date: Fri, 18 Jun 2021 01:07:58 +0800	[thread overview]
Message-ID: <202106180013.j1Brew82-lkp@intel.com> (raw)
In-Reply-To: <20210616203448.995314-2-tannerlove.kernel@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 5262 bytes --]

Hi Tanner,

Thank you for the patch! Perhaps something to improve:

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

url:    https://github.com/0day-ci/linux/commits/Tanner-Love/virtio_net-add-optional-flow-dissection-in-virtio_net_hdr_to_skb/20210617-082208
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 0c33795231bff5df410bd405b569c66851e92d4b
config: s390-randconfig-s031-20210617 (attached as .config)
compiler: s390-linux-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.3-341-g8af24329-dirty
        # https://github.com/0day-ci/linux/commit/b03a1eb684b925a09ae011d0e620d98ebf3b0abd
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Tanner-Love/virtio_net-add-optional-flow-dissection-in-virtio_net_hdr_to_skb/20210617-082208
        git checkout b03a1eb684b925a09ae011d0e620d98ebf3b0abd
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' W=1 ARCH=s390 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


sparse warnings: (new ones prefixed by >>)
>> net/core/flow_dissector.c:882:40: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __virtio16 [assigned] [usertype] hdr_len @@     got unsigned short @@
   net/core/flow_dissector.c:882:40: sparse:     expected restricted __virtio16 [assigned] [usertype] hdr_len
   net/core/flow_dissector.c:882:40: sparse:     got unsigned short
>> net/core/flow_dissector.c:884:41: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __virtio16 [assigned] [usertype] gso_size @@     got unsigned short @@
   net/core/flow_dissector.c:884:41: sparse:     expected restricted __virtio16 [assigned] [usertype] gso_size
   net/core/flow_dissector.c:884:41: sparse:     got unsigned short
>> net/core/flow_dissector.c:886:43: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __virtio16 [assigned] [usertype] csum_start @@     got unsigned short @@
   net/core/flow_dissector.c:886:43: sparse:     expected restricted __virtio16 [assigned] [usertype] csum_start
   net/core/flow_dissector.c:886:43: sparse:     got unsigned short
>> net/core/flow_dissector.c:888:44: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __virtio16 [assigned] [usertype] csum_offset @@     got unsigned short @@
   net/core/flow_dissector.c:888:44: sparse:     expected restricted __virtio16 [assigned] [usertype] csum_offset
   net/core/flow_dissector.c:888:44: sparse:     got unsigned short

vim +882 net/core/flow_dissector.c

   866	
   867	bool bpf_flow_dissect(struct bpf_prog *prog, struct bpf_flow_dissector *ctx,
   868			      __be16 proto, int nhoff, int hlen, unsigned int flags,
   869			      const struct virtio_net_hdr *vhdr,
   870			      bool vhdr_is_little_endian)
   871	{
   872		struct bpf_flow_keys *flow_keys = ctx->flow_keys;
   873		u32 result;
   874	
   875	/* vnet hdr is either machine endian (virtio spec < v1) or le (>= v1) */
   876	#if defined(__BIG_ENDIAN_BITFIELD)
   877		struct virtio_net_hdr vnet_hdr_local;
   878	
   879		if (vhdr && vhdr_is_little_endian) {
   880			vnet_hdr_local.flags = vhdr->flags;
   881			vnet_hdr_local.gso_type = vhdr->gso_type;
 > 882			vnet_hdr_local.hdr_len = __virtio16_to_cpu(false,
   883								   vhdr->hdr_len);
 > 884			vnet_hdr_local.gso_size = __virtio16_to_cpu(false,
   885								    vhdr->gso_size);
 > 886			vnet_hdr_local.csum_start = __virtio16_to_cpu(false,
   887								      vhdr->csum_start);
 > 888			vnet_hdr_local.csum_offset = __virtio16_to_cpu(false,
   889								       vhdr->csum_offset);
   890			vhdr = &vnet_hdr_local;
   891		}
   892	#endif
   893	
   894		/* Pass parameters to the BPF program */
   895		memset(flow_keys, 0, sizeof(*flow_keys));
   896		flow_keys->n_proto = proto;
   897		flow_keys->nhoff = nhoff;
   898		flow_keys->thoff = flow_keys->nhoff;
   899		flow_keys->vhdr = vhdr;
   900	
   901		BUILD_BUG_ON((int)BPF_FLOW_DISSECTOR_F_PARSE_1ST_FRAG !=
   902			     (int)FLOW_DISSECTOR_F_PARSE_1ST_FRAG);
   903		BUILD_BUG_ON((int)BPF_FLOW_DISSECTOR_F_STOP_AT_FLOW_LABEL !=
   904			     (int)FLOW_DISSECTOR_F_STOP_AT_FLOW_LABEL);
   905		BUILD_BUG_ON((int)BPF_FLOW_DISSECTOR_F_STOP_AT_ENCAP !=
   906			     (int)FLOW_DISSECTOR_F_STOP_AT_ENCAP);
   907		flow_keys->flags = flags;
   908	
   909		result = bpf_prog_run_pin_on_cpu(prog, ctx);
   910	
   911		flow_keys->nhoff = clamp_t(u16, flow_keys->nhoff, nhoff, hlen);
   912		flow_keys->thoff = clamp_t(u16, flow_keys->thoff,
   913					   flow_keys->nhoff, hlen);
   914	
   915		return result == BPF_OK;
   916	}
   917	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 17392 bytes --]

  parent reply	other threads:[~2021-06-17 17:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-16 20:34 [PATCH net-next v7 0/3] virtio_net: add optional flow dissection in virtio_net_hdr_to_skb Tanner Love
2021-06-16 20:34 ` [PATCH net-next v7 1/3] net: flow_dissector: extend bpf flow dissector support with vnet hdr Tanner Love
2021-06-17  7:43   ` kernel test robot
2021-06-17  7:43     ` kernel test robot
2021-06-17 13:32   ` kernel test robot
2021-06-17 13:32     ` kernel test robot
2021-06-17 17:07   ` kernel test robot [this message]
2021-06-17 17:07     ` kernel test robot
2021-06-16 20:34 ` [PATCH net-next v7 2/3] virtio_net: add optional flow dissection in virtio_net_hdr_to_skb Tanner Love
2021-06-16 20:38   ` Tanner Love
2021-06-16 20:34 ` [PATCH net-next v7 3/3] selftests/net: amend bpf flow dissector prog to do vnet hdr validation Tanner Love

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=202106180013.j1Brew82-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kbuild-all@lists.01.org \
    --cc=kuba@kernel.org \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=ppenkov@google.com \
    --cc=tannerlove.kernel@gmail.com \
    --cc=willemb@google.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.