All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kaixuxia@tencent.com, frankjpliu@tencent.com, kasong@tencent.com,
	sagazchen@tencent.com, kernelxing@tencent.com,
	aurelianliu@tencent.com, deshengwu@tencent.com,
	flyingpeng@tencent.com, jingqunli@tencent.com,
	jason.zeng@intel.com, wu.zheng@intel.com, yingbao.jia@intel.com,
	pei.p.jia@intel.com
Cc: oe-kbuild-all@lists.linux.dev
Subject: [opencloudos:next 18/98] net/toa/toa.c:122:33: sparse: sparse: incorrect type in initializer (different address spaces)
Date: Tue, 29 Oct 2024 13:55:09 +0800	[thread overview]
Message-ID: <202410291349.cMZeZttd-lkp@intel.com> (raw)

tree:   https://gitee.com/OpenCloudOS/OpenCloudOS-Kernel.git next
head:   ce9f9d823a41831d622fa11e29c3d620c044f51b
commit: 7384d821f268ce4c725e0f6649838794368ca071 [18/98] tkernel: net: add toa support
config: x86_64-randconfig-122-20241029 (https://download.01.org/0day-ci/archive/20241029/202410291349.cMZeZttd-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241029/202410291349.cMZeZttd-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202410291349.cMZeZttd-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
   net/toa/toa.c:28:24: sparse: sparse: symbol 'toa_stats' was not declared. Should it be static?
>> net/toa/toa.c:122:33: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got struct toa_stat_mib * @@
   net/toa/toa.c:122:33: sparse:     expected void const [noderef] __percpu *__vpp_verify
   net/toa/toa.c:122:33: sparse:     got struct toa_stat_mib *
   net/toa/toa.c:126:47: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __be16 [usertype] sin_port @@     got unsigned short [addressable] [usertype] port @@
   net/toa/toa.c:126:47: sparse:     expected restricted __be16 [usertype] sin_port
   net/toa/toa.c:126:47: sparse:     got unsigned short [addressable] [usertype] port
   net/toa/toa.c:127:54: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __be32 [usertype] s_addr @@     got unsigned int [addressable] [usertype] ip @@
   net/toa/toa.c:127:54: sparse:     expected restricted __be32 [usertype] s_addr
   net/toa/toa.c:127:54: sparse:     got unsigned int [addressable] [usertype] ip
   net/toa/toa.c:129:33: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got struct toa_stat_mib * @@
   net/toa/toa.c:129:33: sparse:     expected void const [noderef] __percpu *__vpp_verify
   net/toa/toa.c:129:33: sparse:     got struct toa_stat_mib *
   net/toa/toa.c:134:25: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got struct toa_stat_mib * @@
   net/toa/toa.c:134:25: sparse:     expected void const [noderef] __percpu *__vpp_verify
   net/toa/toa.c:134:25: sparse:     got struct toa_stat_mib *
   net/toa/toa.c:137:17: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got struct toa_stat_mib * @@
   net/toa/toa.c:137:17: sparse:     expected void const [noderef] __percpu *__vpp_verify
   net/toa/toa.c:137:17: sparse:     got struct toa_stat_mib *
   net/toa/toa.c:162:33: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got struct toa_stat_mib * @@
   net/toa/toa.c:162:33: sparse:     expected void const [noderef] __percpu *__vpp_verify
   net/toa/toa.c:162:33: sparse:     got struct toa_stat_mib *
   net/toa/toa.c:163:48: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __be16 [usertype] sin6_port @@     got unsigned short [addressable] [usertype] port @@
   net/toa/toa.c:163:48: sparse:     expected restricted __be16 [usertype] sin6_port
   net/toa/toa.c:163:48: sparse:     got unsigned short [addressable] [usertype] port
   net/toa/toa.c:164:94: sparse: sparse: incorrect type in argument 5 (different base types) @@     expected restricted __be32 [usertype] w4 @@     got unsigned int [addressable] [usertype] ip @@
   net/toa/toa.c:164:94: sparse:     expected restricted __be32 [usertype] w4
   net/toa/toa.c:164:94: sparse:     got unsigned int [addressable] [usertype] ip
   net/toa/toa.c:166:33: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got struct toa_stat_mib * @@
   net/toa/toa.c:166:33: sparse:     expected void const [noderef] __percpu *__vpp_verify
   net/toa/toa.c:166:33: sparse:     got struct toa_stat_mib *
   net/toa/toa.c:169:25: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got struct toa_stat_mib * @@
   net/toa/toa.c:169:25: sparse:     expected void const [noderef] __percpu *__vpp_verify
   net/toa/toa.c:169:25: sparse:     got struct toa_stat_mib *
   net/toa/toa.c:172:17: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got struct toa_stat_mib * @@
   net/toa/toa.c:172:17: sparse:     expected void const [noderef] __percpu *__vpp_verify
   net/toa/toa.c:172:17: sparse:     got struct toa_stat_mib *
   net/toa/toa.c:206:25: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got struct toa_stat_mib * @@
   net/toa/toa.c:206:25: sparse:     expected void const [noderef] __percpu *__vpp_verify
   net/toa/toa.c:206:25: sparse:     got struct toa_stat_mib *
   net/toa/toa.c:208:25: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got struct toa_stat_mib * @@
   net/toa/toa.c:208:25: sparse:     expected void const [noderef] __percpu *__vpp_verify
   net/toa/toa.c:208:25: sparse:     got struct toa_stat_mib *
   net/toa/toa.c:234:25: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got struct toa_stat_mib * @@
   net/toa/toa.c:234:25: sparse:     expected void const [noderef] __percpu *__vpp_verify
   net/toa/toa.c:234:25: sparse:     got struct toa_stat_mib *
   net/toa/toa.c:236:25: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got struct toa_stat_mib * @@
   net/toa/toa.c:236:25: sparse:     expected void const [noderef] __percpu *__vpp_verify
   net/toa/toa.c:236:25: sparse:     got struct toa_stat_mib *
   net/toa/toa.c:342:65: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got struct toa_stat_mib * @@
   net/toa/toa.c:342:65: sparse:     expected void const [noderef] __percpu *__vpp_verify
   net/toa/toa.c:342:65: sparse:     got struct toa_stat_mib *
>> net/toa/toa.c:374:19: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct toa_stat_mib *[addressable] [toplevel] ext_stats @@     got struct toa_stat_mib [noderef] __percpu * @@
   net/toa/toa.c:374:19: sparse:     expected struct toa_stat_mib *[addressable] [toplevel] ext_stats
   net/toa/toa.c:374:19: sparse:     got struct toa_stat_mib [noderef] __percpu *
>> net/toa/toa.c:389:29: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void [noderef] __percpu *__pdata @@     got struct toa_stat_mib *[addressable] [toplevel] ext_stats @@
   net/toa/toa.c:389:29: sparse:     expected void [noderef] __percpu *__pdata
   net/toa/toa.c:389:29: sparse:     got struct toa_stat_mib *[addressable] [toplevel] ext_stats
>> net/toa/toa.c:404:29: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void [noderef] __percpu *__pdata @@     got struct toa_stat_mib *[addressable] [assigned] [toplevel] ext_stats @@
   net/toa/toa.c:404:29: sparse:     expected void [noderef] __percpu *__pdata
   net/toa/toa.c:404:29: sparse:     got struct toa_stat_mib *[addressable] [assigned] [toplevel] ext_stats

vim +122 net/toa/toa.c

    96	
    97	/* get client ip from socket
    98	 * @param sock [in] the socket to getpeername() or getsockname()
    99	 * @param uaddr [out] the place to put client ip, port
   100	 * @param uaddr_len [out] lenth of @uaddr
   101	 * @peer [in] if(peer), try to get remote address; if(!peer), try to get local address
   102	 * @return return what the original inet_getname() returns.
   103	 */
   104	static int
   105	inet_getname_toa(struct socket *sock, struct sockaddr *uaddr, int peer)
   106	{
   107		int retval = 0;
   108		struct sock *sk = sock->sk;
   109		struct sockaddr_in *sin = (struct sockaddr_in *)uaddr;
   110		struct toa_data tdata;
   111	
   112		//TOA_DBG("inet_getname_toa called, sk->sk_user_data is %p\n", sk->sk_user_data);
   113	
   114		/* call orginal one */
   115		retval = inet_getname(sock, uaddr, peer);
   116	
   117		/* set our value if need */
   118		if (retval == 0 && NULL != sk->sk_user_data && peer) {
   119			if (sock_def_readable == sk->sk_data_ready) {
   120				memcpy(&tdata, &sk->sk_user_data, sizeof (tdata));
   121				if (TCPOPT_TOA == tdata.opcode && TCPOLEN_TOA == tdata.opsize) {
 > 122					TOA_INC_STATS(ext_stats, GETNAME_TOA_OK_CNT);
   123					//TOA_DBG("inet_getname_toa: set new sockaddr, ip %u.%u.%u.%u -> %u.%u.%u.%u, port %u -> %u\n",
   124					//		NIPQUAD(sin->sin_addr.s_addr), NIPQUAD(tdata.ip), ntohs(sin->sin_port),
   125					//		ntohs(tdata.port));
   126					sin->sin_port = tdata.port;
   127					sin->sin_addr.s_addr = tdata.ip;
   128				} else { /* sk_user_data doesn't belong to us */
   129					TOA_INC_STATS(ext_stats, GETNAME_TOA_MISMATCH_CNT);
   130					//TOA_DBG("inet_getname_toa: invalid toa data, ip %u.%u.%u.%u port %u opcode %u opsize %u\n",
   131					//		NIPQUAD(tdata.ip), ntohs(tdata.port), tdata.opcode, tdata.opsize);
   132				}
   133			} else {
   134				TOA_INC_STATS(ext_stats, GETNAME_TOA_BYPASS_CNT);
   135			}
   136		} else { /* no need to get client ip */
   137			TOA_INC_STATS(ext_stats, GETNAME_TOA_EMPTY_CNT);
   138		}
   139	
   140		return retval;
   141	}
   142	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

             reply	other threads:[~2024-10-29  5:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-29  5:55 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-10-30 15:44 [opencloudos:next 18/98] net/toa/toa.c:122:33: sparse: sparse: incorrect type in initializer (different address spaces) kernel test robot
2024-03-04  0:51 kernel test robot

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=202410291349.cMZeZttd-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=aurelianliu@tencent.com \
    --cc=deshengwu@tencent.com \
    --cc=flyingpeng@tencent.com \
    --cc=frankjpliu@tencent.com \
    --cc=jason.zeng@intel.com \
    --cc=jingqunli@tencent.com \
    --cc=kaixuxia@tencent.com \
    --cc=kasong@tencent.com \
    --cc=kernelxing@tencent.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=pei.p.jia@intel.com \
    --cc=sagazchen@tencent.com \
    --cc=wu.zheng@intel.com \
    --cc=yingbao.jia@intel.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.