[linux-next:master 3822/14669] drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c:544:31: sparse: sparse: incorrect type in assignment (different base types)

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

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   d67bc7812221606e1886620a357b13f906814af7
commit: dc1a9bf2c8169d9f607502162af1858a73a18cb8 [3822/14669] octeontx2-pf: Add UDP segmentation offload support
config: arm64-randconfig-s032-20201012 (attached as .config)
compiler: aarch64-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.2-229-g0c6896f4-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=dc1a9bf2c8169d9f607502162af1858a73a18cb8
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout dc1a9bf2c8169d9f607502162af1858a73a18cb8
        # 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__' ARCH=arm64 

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


"sparse warnings: (new ones prefixed by >>)"
>> drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c:544:31: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned short [usertype] iplen @@     got restricted __be16 [usertype] @@
>> drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c:544:31: sparse:     expected unsigned short [usertype] iplen
>> drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c:544:31: sparse:     got restricted __be16 [usertype]
>> drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c:546:54: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __be16 [usertype] tot_len @@     got unsigned short [usertype] iplen @@
>> drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c:546:54: sparse:     expected restricted __be16 [usertype] tot_len
>> drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c:546:54: sparse:     got unsigned short [usertype] iplen
>> drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c:549:60: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __be16 [usertype] payload_len @@     got unsigned short [usertype] iplen @@
>> drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c:549:60: sparse:     expected restricted __be16 [usertype] payload_len
   drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c:549:60: sparse:     got unsigned short [usertype] iplen

vim +544 drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c

   503	
   504	/* Add SQE extended header subdescriptor */
   505	static void otx2_sqe_add_ext(struct otx2_nic *pfvf, struct otx2_snd_queue *sq,
   506				     struct sk_buff *skb, int *offset)
   507	{
   508		struct nix_sqe_ext_s *ext;
   509	
   510		ext = (struct nix_sqe_ext_s *)(sq->sqe_base + *offset);
   511		ext->subdc = NIX_SUBDC_EXT;
   512		if (skb_shinfo(skb)->gso_size) {
   513			ext->lso = 1;
   514			ext->lso_sb = skb_transport_offset(skb) + tcp_hdrlen(skb);
   515			ext->lso_mps = skb_shinfo(skb)->gso_size;
   516	
   517			/* Only TSOv4 and TSOv6 GSO offloads are supported */
   518			if (skb_shinfo(skb)->gso_type & SKB_GSO_TCPV4) {
   519				ext->lso_format = pfvf->hw.lso_tsov4_idx;
   520	
   521				/* HW adds payload size to 'ip_hdr->tot_len' while
   522				 * sending TSO segment, hence set payload length
   523				 * in IP header of the packet to just header length.
   524				 */
   525				ip_hdr(skb)->tot_len =
   526					htons(ext->lso_sb - skb_network_offset(skb));
   527			} else if (skb_shinfo(skb)->gso_type & SKB_GSO_TCPV6) {
   528				ext->lso_format = pfvf->hw.lso_tsov6_idx;
   529	
   530				ipv6_hdr(skb)->payload_len =
   531					htons(ext->lso_sb - skb_network_offset(skb));
   532			} else if (skb_shinfo(skb)->gso_type & SKB_GSO_UDP_L4) {
   533				__be16 l3_proto = vlan_get_protocol(skb);
   534				struct udphdr *udph = udp_hdr(skb);
   535				u16 iplen;
   536	
   537				ext->lso_sb = skb_transport_offset(skb) +
   538						sizeof(struct udphdr);
   539	
   540				/* HW adds payload size to length fields in IP and
   541				 * UDP headers while segmentation, hence adjust the
   542				 * lengths to just header sizes.
   543				 */
 > 544				iplen = htons(ext->lso_sb - skb_network_offset(skb));
   545				if (l3_proto == htons(ETH_P_IP)) {
 > 546					ip_hdr(skb)->tot_len = iplen;
   547					ext->lso_format = pfvf->hw.lso_udpv4_idx;
   548				} else {
 > 549					ipv6_hdr(skb)->payload_len = iplen;
   550					ext->lso_format = pfvf->hw.lso_udpv6_idx;
   551				}
   552	
   553				udph->len = htons(sizeof(struct udphdr));
   554			}
   555		} else if (skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) {
   556			ext->tstmp = 1;
   557		}
   558	
   559		*offset += sizeof(*ext);
   560	}
   561	

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

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux