Subject: Re: [net-next, v3, 07/10] net: sock: extend SO_TIMESTAMPING for PHC binding

From: kernel test robot <[email-masked]>
Date: Wed, 16 Jun 2021 18:27:20 +0800

Hi Yangbo,

I love your patch! Yet something to improve:

[auto build test ERROR on 89212e160b81e778f829b89743570665810e3b13]

url:    https://github.com/0day-ci/linux/commits/Yangbo-Lu/ptp-support-virtual-clocks-and-timestamping/20210616-141518
base:   89212e160b81e778f829b89743570665810e3b13
config: um-x86_64_defconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
        # https://github.com/0day-ci/linux/commit/f03864a45f4fe97414824545398c837eead55409
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Yangbo-Lu/ptp-support-virtual-clocks-and-timestamping/20210616-141518
        git checkout f03864a45f4fe97414824545398c837eead55409
        # save the attached .config to linux build tree
        make W=1 ARCH=um SUBARCH=x86_64

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email-masked]>

All errors (new ones prefixed by >>):

   net/mptcp/sockopt.c: In function 'mptcp_setsockopt_sol_socket_tstamp':
>> net/mptcp/sockopt.c:148:12: error: 'optval' redeclared as different kind of symbol
     148 |  sockptr_t optval = KERNEL_SOCKPTR(&val);
         |            ^~~~~~
   net/mptcp/sockopt.c:145:22: note: previous definition of 'optval' was here
     145 |            sockptr_t optval,
         |            ~~~~~~~~~~^~~~~~

vim +/optval +148 net/mptcp/sockopt.c

6f0d7198084c40 Florian Westphal 2021-04-15  142  
f03864a45f4fe9 Yangbo Lu        2021-06-15  143  static int mptcp_setsockopt_sol_socket_tstamp(struct mptcp_sock *msk,
f03864a45f4fe9 Yangbo Lu        2021-06-15  144  					      int optname, int val,
f03864a45f4fe9 Yangbo Lu        2021-06-15  145  					      sockptr_t optval,
f03864a45f4fe9 Yangbo Lu        2021-06-15  146  					      unsigned int optlen)
9061f24bf82ec2 Florian Westphal 2021-06-03  147  {
9061f24bf82ec2 Florian Westphal 2021-06-03 @148  	sockptr_t optval = KERNEL_SOCKPTR(&val);
9061f24bf82ec2 Florian Westphal 2021-06-03  149  	struct mptcp_subflow_context *subflow;
9061f24bf82ec2 Florian Westphal 2021-06-03  150  	struct sock *sk = (struct sock *)msk;
9061f24bf82ec2 Florian Westphal 2021-06-03  151  	int ret;
9061f24bf82ec2 Florian Westphal 2021-06-03  152  
9061f24bf82ec2 Florian Westphal 2021-06-03  153  	ret = sock_setsockopt(sk->sk_socket, SOL_SOCKET, optname,
9061f24bf82ec2 Florian Westphal 2021-06-03  154  			      optval, sizeof(val));
9061f24bf82ec2 Florian Westphal 2021-06-03  155  	if (ret)
9061f24bf82ec2 Florian Westphal 2021-06-03  156  		return ret;
9061f24bf82ec2 Florian Westphal 2021-06-03  157  
9061f24bf82ec2 Florian Westphal 2021-06-03  158  	lock_sock(sk);
9061f24bf82ec2 Florian Westphal 2021-06-03  159  	mptcp_for_each_subflow(msk, subflow) {
9061f24bf82ec2 Florian Westphal 2021-06-03  160  		struct sock *ssk = mptcp_subflow_tcp_sock(subflow);
9061f24bf82ec2 Florian Westphal 2021-06-03  161  		bool slow = lock_sock_fast(ssk);
9061f24bf82ec2 Florian Westphal 2021-06-03  162  
9061f24bf82ec2 Florian Westphal 2021-06-03  163  		switch (optname) {
9061f24bf82ec2 Florian Westphal 2021-06-03  164  		case SO_TIMESTAMP_OLD:
9061f24bf82ec2 Florian Westphal 2021-06-03  165  		case SO_TIMESTAMP_NEW:
9061f24bf82ec2 Florian Westphal 2021-06-03  166  		case SO_TIMESTAMPNS_OLD:
9061f24bf82ec2 Florian Westphal 2021-06-03  167  		case SO_TIMESTAMPNS_NEW:
9061f24bf82ec2 Florian Westphal 2021-06-03  168  			sock_set_timestamp(sk, optname, !!val);
9061f24bf82ec2 Florian Westphal 2021-06-03  169  			break;
9061f24bf82ec2 Florian Westphal 2021-06-03  170  		case SO_TIMESTAMPING_NEW:
9061f24bf82ec2 Florian Westphal 2021-06-03  171  		case SO_TIMESTAMPING_OLD:
f03864a45f4fe9 Yangbo Lu        2021-06-15  172  			sock_set_timestamping(sk, optname, val, optval, optlen);
9061f24bf82ec2 Florian Westphal 2021-06-03  173  			break;
9061f24bf82ec2 Florian Westphal 2021-06-03  174  		}
9061f24bf82ec2 Florian Westphal 2021-06-03  175  
9061f24bf82ec2 Florian Westphal 2021-06-03  176  		unlock_sock_fast(ssk, slow);
9061f24bf82ec2 Florian Westphal 2021-06-03  177  	}
9061f24bf82ec2 Florian Westphal 2021-06-03  178  
9061f24bf82ec2 Florian Westphal 2021-06-03  179  	release_sock(sk);
9061f24bf82ec2 Florian Westphal 2021-06-03  180  	return 0;
9061f24bf82ec2 Florian Westphal 2021-06-03  181  }
9061f24bf82ec2 Florian Westphal 2021-06-03  182  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email-masked]