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>] [day] [month] [year] [list]
Message-ID: <202007020041.3zG9S9jx%lkp@intel.com>
Date:   Thu, 2 Jul 2020 00:31:43 +0800
From:   kernel test robot <lkp@...el.com>
To:     Vladimir Oltean <vladimir.oltean@....com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org
Subject: drivers/net/ethernet/freescale/enetc/enetc_ethtool.c:333:31: sparse:
 sparse: incorrect type in assignment (different base types)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   7c30b859a947535f2213277e827d7ac7dcff9c84
commit: feb5d98e0a156274fbf334362f56359d19f614fa enetc: remove "depends on (ARCH_LAYERSCAPE || COMPILE_TEST)"
date:   4 months ago
config: powerpc64-randconfig-s032-20200701 (attached as .config)
compiler: powerpc64-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-3-gfa153962-dirty
        git checkout feb5d98e0a156274fbf334362f56359d19f614fa
        # 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=powerpc64 

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


sparse warnings: (new ones prefixed by >>)

>> drivers/net/ethernet/freescale/enetc/enetc_ethtool.c:333:31: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int @@     got restricted __be32 [usertype] ip4src @@
   drivers/net/ethernet/freescale/enetc/enetc_ethtool.c:333:31: sparse:     expected unsigned int
   drivers/net/ethernet/freescale/enetc/enetc_ethtool.c:333:31: sparse:     got restricted __be32 [usertype] ip4src
   drivers/net/ethernet/freescale/enetc/enetc_ethtool.c:334:31: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int @@     got restricted __be32 [usertype] ip4src @@
   drivers/net/ethernet/freescale/enetc/enetc_ethtool.c:334:31: sparse:     expected unsigned int
   drivers/net/ethernet/freescale/enetc/enetc_ethtool.c:334:31: sparse:     got restricted __be32 [usertype] ip4src
>> drivers/net/ethernet/freescale/enetc/enetc_ethtool.c:335:31: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int @@     got restricted __be32 [usertype] ip4dst @@
   drivers/net/ethernet/freescale/enetc/enetc_ethtool.c:335:31: sparse:     expected unsigned int
   drivers/net/ethernet/freescale/enetc/enetc_ethtool.c:335:31: sparse:     got restricted __be32 [usertype] ip4dst
   drivers/net/ethernet/freescale/enetc/enetc_ethtool.c:336:31: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int @@     got restricted __be32 [usertype] ip4dst @@
   drivers/net/ethernet/freescale/enetc/enetc_ethtool.c:336:31: sparse:     expected unsigned int
   drivers/net/ethernet/freescale/enetc/enetc_ethtool.c:336:31: sparse:     got restricted __be32 [usertype] ip4dst
   drivers/net/ethernet/freescale/enetc/enetc_ethtool.c:350:31: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int @@     got restricted __be32 [usertype] ip4src @@
   drivers/net/ethernet/freescale/enetc/enetc_ethtool.c:350:31: sparse:     expected unsigned int
   drivers/net/ethernet/freescale/enetc/enetc_ethtool.c:350:31: sparse:     got restricted __be32 [usertype] ip4src
   drivers/net/ethernet/freescale/enetc/enetc_ethtool.c:351:31: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int @@     got restricted __be32 [usertype] ip4src @@
   drivers/net/ethernet/freescale/enetc/enetc_ethtool.c:351:31: sparse:     expected unsigned int
   drivers/net/ethernet/freescale/enetc/enetc_ethtool.c:351:31: sparse:     got restricted __be32 [usertype] ip4src
   drivers/net/ethernet/freescale/enetc/enetc_ethtool.c:352:31: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int @@     got restricted __be32 [usertype] ip4dst @@
   drivers/net/ethernet/freescale/enetc/enetc_ethtool.c:352:31: sparse:     expected unsigned int
   drivers/net/ethernet/freescale/enetc/enetc_ethtool.c:352:31: sparse:     got restricted __be32 [usertype] ip4dst
   drivers/net/ethernet/freescale/enetc/enetc_ethtool.c:353:31: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int @@     got restricted __be32 [usertype] ip4dst @@
   drivers/net/ethernet/freescale/enetc/enetc_ethtool.c:353:31: sparse:     expected unsigned int
   drivers/net/ethernet/freescale/enetc/enetc_ethtool.c:353:31: sparse:     got restricted __be32 [usertype] ip4dst
   drivers/net/ethernet/freescale/enetc/enetc_hw.h:325:16: sparse: sparse: cast to restricted __le64
   drivers/net/ethernet/freescale/enetc/enetc_hw.h:325:16: sparse: sparse: restricted __le64 degrades to integer
   drivers/net/ethernet/freescale/enetc/enetc_hw.h:325:16: sparse: sparse: cast to restricted __le64
   drivers/net/ethernet/freescale/enetc/enetc_hw.h:325:16: sparse: sparse: cast to restricted __le64
   drivers/net/ethernet/freescale/enetc/enetc_hw.h:325:16: sparse: sparse: restricted __le64 degrades to integer
   drivers/net/ethernet/freescale/enetc/enetc_hw.h:325:16: sparse: sparse: cast to restricted __le64
   drivers/net/ethernet/freescale/enetc/enetc_hw.h:325:16: sparse: sparse: cast to restricted __le64
   drivers/net/ethernet/freescale/enetc/enetc_hw.h:325:16: sparse: sparse: restricted __le64 degrades to integer
   drivers/net/ethernet/freescale/enetc/enetc_hw.h:325:16: sparse: sparse: cast to restricted __le64
   drivers/net/ethernet/freescale/enetc/enetc_hw.h:325:16: sparse: sparse: cast to restricted __le64
   drivers/net/ethernet/freescale/enetc/enetc_hw.h:325:16: sparse: sparse: restricted __le64 degrades to integer
   drivers/net/ethernet/freescale/enetc/enetc_hw.h:325:16: sparse: sparse: cast to restricted __le64
   drivers/net/ethernet/freescale/enetc/enetc_hw.h:325:16: sparse: sparse: cast to restricted __le64
   drivers/net/ethernet/freescale/enetc/enetc_hw.h:325:16: sparse: sparse: restricted __le64 degrades to integer
   drivers/net/ethernet/freescale/enetc/enetc_hw.h:325:16: sparse: sparse: cast to restricted __le64
   drivers/net/ethernet/freescale/enetc/enetc_hw.h:325:16: sparse: sparse: cast to restricted __le64
   drivers/net/ethernet/freescale/enetc/enetc_hw.h:325:16: sparse: sparse: restricted __le64 degrades to integer
   drivers/net/ethernet/freescale/enetc/enetc_hw.h:325:16: sparse: sparse: cast to restricted __le64
   drivers/net/ethernet/freescale/enetc/enetc_hw.h:325:16: sparse: sparse: cast to restricted __le64
   drivers/net/ethernet/freescale/enetc/enetc_hw.h:325:16: sparse: sparse: restricted __le64 degrades to integer
   drivers/net/ethernet/freescale/enetc/enetc_hw.h:325:16: sparse: sparse: cast to restricted __le64
   drivers/net/ethernet/freescale/enetc/enetc_hw.h:325:16: sparse: sparse: cast to restricted __le64
   drivers/net/ethernet/freescale/enetc/enetc_hw.h:325:16: sparse: sparse: restricted __le64 degrades to integer
   drivers/net/ethernet/freescale/enetc/enetc_hw.h:325:16: sparse: sparse: cast to restricted __le64
   drivers/net/ethernet/freescale/enetc/enetc_hw.h:325:16: sparse: sparse: cast to restricted __le64
   drivers/net/ethernet/freescale/enetc/enetc_hw.h:325:16: sparse: sparse: restricted __le64 degrades to integer
   drivers/net/ethernet/freescale/enetc/enetc_hw.h:325:16: sparse: sparse: cast to restricted __le64
   drivers/net/ethernet/freescale/enetc/enetc_hw.h:325:16: sparse: sparse: cast to restricted __le64
   drivers/net/ethernet/freescale/enetc/enetc_hw.h:325:16: sparse: sparse: restricted __le64 degrades to integer
   drivers/net/ethernet/freescale/enetc/enetc_hw.h:325:16: sparse: sparse: cast to restricted __le64
--
>> drivers/net/ethernet/freescale/enetc/enetc_qos.c:131:21: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __le32 @@     got unsigned int [usertype] @@
   drivers/net/ethernet/freescale/enetc/enetc_qos.c:131:21: sparse:     expected restricted __le32
   drivers/net/ethernet/freescale/enetc/enetc_qos.c:131:21: sparse:     got unsigned int [usertype]
   drivers/net/ethernet/freescale/enetc/enetc_qos.c:132:21: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __le32 @@     got unsigned int [usertype] @@
   drivers/net/ethernet/freescale/enetc/enetc_qos.c:132:21: sparse:     expected restricted __le32
   drivers/net/ethernet/freescale/enetc/enetc_qos.c:132:21: sparse:     got unsigned int [usertype]

vim +333 drivers/net/ethernet/freescale/enetc/enetc_ethtool.c

d382563f541b01 Claudiu Manoil 2019-01-22  308  
d382563f541b01 Claudiu Manoil 2019-01-22  309  static int enetc_set_cls_entry(struct enetc_si *si,
d382563f541b01 Claudiu Manoil 2019-01-22  310  			       struct ethtool_rx_flow_spec *fs, bool en)
d382563f541b01 Claudiu Manoil 2019-01-22  311  {
d382563f541b01 Claudiu Manoil 2019-01-22  312  	struct ethtool_tcpip4_spec *l4ip4_h, *l4ip4_m;
d382563f541b01 Claudiu Manoil 2019-01-22  313  	struct ethtool_usrip4_spec *l3ip4_h, *l3ip4_m;
d382563f541b01 Claudiu Manoil 2019-01-22  314  	struct ethhdr *eth_h, *eth_m;
d382563f541b01 Claudiu Manoil 2019-01-22  315  	struct enetc_cmd_rfse rfse = { {0} };
d382563f541b01 Claudiu Manoil 2019-01-22  316  
d382563f541b01 Claudiu Manoil 2019-01-22  317  	if (!en)
d382563f541b01 Claudiu Manoil 2019-01-22  318  		goto done;
d382563f541b01 Claudiu Manoil 2019-01-22  319  
d382563f541b01 Claudiu Manoil 2019-01-22  320  	switch (fs->flow_type & 0xff) {
d382563f541b01 Claudiu Manoil 2019-01-22  321  	case TCP_V4_FLOW:
d382563f541b01 Claudiu Manoil 2019-01-22  322  		l4ip4_h = &fs->h_u.tcp_ip4_spec;
d382563f541b01 Claudiu Manoil 2019-01-22  323  		l4ip4_m = &fs->m_u.tcp_ip4_spec;
d382563f541b01 Claudiu Manoil 2019-01-22  324  		goto l4ip4;
d382563f541b01 Claudiu Manoil 2019-01-22  325  	case UDP_V4_FLOW:
d382563f541b01 Claudiu Manoil 2019-01-22  326  		l4ip4_h = &fs->h_u.udp_ip4_spec;
d382563f541b01 Claudiu Manoil 2019-01-22  327  		l4ip4_m = &fs->m_u.udp_ip4_spec;
d382563f541b01 Claudiu Manoil 2019-01-22  328  		goto l4ip4;
d382563f541b01 Claudiu Manoil 2019-01-22  329  	case SCTP_V4_FLOW:
d382563f541b01 Claudiu Manoil 2019-01-22  330  		l4ip4_h = &fs->h_u.sctp_ip4_spec;
d382563f541b01 Claudiu Manoil 2019-01-22  331  		l4ip4_m = &fs->m_u.sctp_ip4_spec;
d382563f541b01 Claudiu Manoil 2019-01-22  332  l4ip4:
d382563f541b01 Claudiu Manoil 2019-01-22 @333  		rfse.sip_h[0] = l4ip4_h->ip4src;
d382563f541b01 Claudiu Manoil 2019-01-22  334  		rfse.sip_m[0] = l4ip4_m->ip4src;
d382563f541b01 Claudiu Manoil 2019-01-22 @335  		rfse.dip_h[0] = l4ip4_h->ip4dst;
d382563f541b01 Claudiu Manoil 2019-01-22  336  		rfse.dip_m[0] = l4ip4_m->ip4dst;
d382563f541b01 Claudiu Manoil 2019-01-22  337  		rfse.sport_h = ntohs(l4ip4_h->psrc);
d382563f541b01 Claudiu Manoil 2019-01-22  338  		rfse.sport_m = ntohs(l4ip4_m->psrc);
d382563f541b01 Claudiu Manoil 2019-01-22  339  		rfse.dport_h = ntohs(l4ip4_h->pdst);
d382563f541b01 Claudiu Manoil 2019-01-22  340  		rfse.dport_m = ntohs(l4ip4_m->pdst);
d382563f541b01 Claudiu Manoil 2019-01-22  341  		if (l4ip4_m->tos)
d382563f541b01 Claudiu Manoil 2019-01-22  342  			netdev_warn(si->ndev, "ToS field is not supported and was ignored\n");
d382563f541b01 Claudiu Manoil 2019-01-22  343  		rfse.ethtype_h = ETH_P_IP; /* IPv4 */
d382563f541b01 Claudiu Manoil 2019-01-22  344  		rfse.ethtype_m = 0xffff;
d382563f541b01 Claudiu Manoil 2019-01-22  345  		break;
d382563f541b01 Claudiu Manoil 2019-01-22  346  	case IP_USER_FLOW:
d382563f541b01 Claudiu Manoil 2019-01-22  347  		l3ip4_h = &fs->h_u.usr_ip4_spec;
d382563f541b01 Claudiu Manoil 2019-01-22  348  		l3ip4_m = &fs->m_u.usr_ip4_spec;
d382563f541b01 Claudiu Manoil 2019-01-22  349  
d382563f541b01 Claudiu Manoil 2019-01-22  350  		rfse.sip_h[0] = l3ip4_h->ip4src;
d382563f541b01 Claudiu Manoil 2019-01-22  351  		rfse.sip_m[0] = l3ip4_m->ip4src;
d382563f541b01 Claudiu Manoil 2019-01-22  352  		rfse.dip_h[0] = l3ip4_h->ip4dst;
d382563f541b01 Claudiu Manoil 2019-01-22  353  		rfse.dip_m[0] = l3ip4_m->ip4dst;
d382563f541b01 Claudiu Manoil 2019-01-22  354  		if (l3ip4_m->tos)
d382563f541b01 Claudiu Manoil 2019-01-22  355  			netdev_warn(si->ndev, "ToS field is not supported and was ignored\n");
d382563f541b01 Claudiu Manoil 2019-01-22  356  		rfse.ethtype_h = ETH_P_IP; /* IPv4 */
d382563f541b01 Claudiu Manoil 2019-01-22  357  		rfse.ethtype_m = 0xffff;
d382563f541b01 Claudiu Manoil 2019-01-22  358  		break;
d382563f541b01 Claudiu Manoil 2019-01-22  359  	case ETHER_FLOW:
d382563f541b01 Claudiu Manoil 2019-01-22  360  		eth_h = &fs->h_u.ether_spec;
d382563f541b01 Claudiu Manoil 2019-01-22  361  		eth_m = &fs->m_u.ether_spec;
d382563f541b01 Claudiu Manoil 2019-01-22  362  
d382563f541b01 Claudiu Manoil 2019-01-22  363  		ether_addr_copy_swap(rfse.smac_h, eth_h->h_source);
d382563f541b01 Claudiu Manoil 2019-01-22  364  		ether_addr_copy_swap(rfse.smac_m, eth_m->h_source);
d382563f541b01 Claudiu Manoil 2019-01-22  365  		ether_addr_copy_swap(rfse.dmac_h, eth_h->h_dest);
d382563f541b01 Claudiu Manoil 2019-01-22  366  		ether_addr_copy_swap(rfse.dmac_m, eth_m->h_dest);
d382563f541b01 Claudiu Manoil 2019-01-22  367  		rfse.ethtype_h = ntohs(eth_h->h_proto);
d382563f541b01 Claudiu Manoil 2019-01-22  368  		rfse.ethtype_m = ntohs(eth_m->h_proto);
d382563f541b01 Claudiu Manoil 2019-01-22  369  		break;
d382563f541b01 Claudiu Manoil 2019-01-22  370  	default:
d382563f541b01 Claudiu Manoil 2019-01-22  371  		return -EOPNOTSUPP;
d382563f541b01 Claudiu Manoil 2019-01-22  372  	}
d382563f541b01 Claudiu Manoil 2019-01-22  373  
d382563f541b01 Claudiu Manoil 2019-01-22  374  	rfse.mode |= ENETC_RFSE_EN;
d382563f541b01 Claudiu Manoil 2019-01-22  375  	if (fs->ring_cookie != RX_CLS_FLOW_DISC) {
d382563f541b01 Claudiu Manoil 2019-01-22  376  		rfse.mode |= ENETC_RFSE_MODE_BD;
d382563f541b01 Claudiu Manoil 2019-01-22  377  		rfse.result = fs->ring_cookie;
d382563f541b01 Claudiu Manoil 2019-01-22  378  	}
d382563f541b01 Claudiu Manoil 2019-01-22  379  done:
d382563f541b01 Claudiu Manoil 2019-01-22  380  	return enetc_set_fs_entry(si, &rfse, fs->location);
d382563f541b01 Claudiu Manoil 2019-01-22  381  }
d382563f541b01 Claudiu Manoil 2019-01-22  382  

:::::: The code at line 333 was first introduced by commit
:::::: d382563f541b01f6a38fb1edd762a4cfcd2ca52a enetc: Add RFS and RSS support

:::::: TO: Claudiu Manoil <claudiu.manoil@....com>
:::::: CC: David S. Miller <davem@...emloft.net>

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

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ