Hi Mat,
-----Original Message----- From: Mat Martineau mathew.j.martineau@linux.intel.com Sent: 2021年6月26日 9:00 To: Y.b. Lu yangbo.lu@nxp.com Cc: netdev@vger.kernel.org; linux-kernel@vger.kernel.org; linux-kselftest@vger.kernel.org; mptcp@lists.linux.dev; Richard Cochran richardcochran@gmail.com; David S . Miller davem@davemloft.net; Jakub Kicinski kuba@kernel.org; Matthieu Baerts matthieu.baerts@tessares.net; Shuah Khan shuah@kernel.org; Michal Kubecek mkubecek@suse.cz; Florian Fainelli f.fainelli@gmail.com; Andrew Lunn andrew@lunn.ch; Rui Sousa rui.sousa@nxp.com; Sebastien Laveze sebastien.laveze@nxp.com Subject: Re: [net-next, v4, 08/11] net: sock: extend SO_TIMESTAMPING for PHC binding
On Fri, 25 Jun 2021, Yangbo Lu wrote:
[...]
diff --git a/net/mptcp/sockopt.c b/net/mptcp/sockopt.c index ea38cbcd2ad4..e20aefc20d75 100644 --- a/net/mptcp/sockopt.c +++ b/net/mptcp/sockopt.c @@ -207,14 +207,26 @@ static int
mptcp_setsockopt_sol_socket_timestamping(struct mptcp_sock *msk,
{ struct mptcp_subflow_context *subflow; struct sock *sk = (struct sock *)msk;
- struct so_timestamping timestamping; int val, ret;
- ret = mptcp_get_int_option(msk, optval, optlen, &val);
- if (ret)
return ret;
- if (optlen == sizeof(timestamping)) {
if (copy_from_sockptr(×tamping, optval,
sizeof(timestamping)))
return -EFAULT;
- } else if (optlen == sizeof(int)) {
if (copy_from_sockptr(val, optval, sizeof(*val)))
^^^
As the kbuild bot noted, this needs to be a pointer. You could pass in ×tamping.flags and you wouldn't need the 'val' variable at all.
Ok, I sent v5 to fix. Sorry for the trouble. It seemed my test config missed to enable MPTCP.
Thanks.
-Mat
return -EFAULT;
memset(×tamping, 0, sizeof(timestamping));
timestamping.flags = val;
} else {
return -EINVAL;
}
ret = sock_setsockopt(sk->sk_socket, SOL_SOCKET, optname,
KERNEL_SOCKPTR(&val), sizeof(val));
KERNEL_SOCKPTR(×tamping),
if (ret) return ret;sizeof(timestamping));
@@ -224,7 +236,7 @@ static int
mptcp_setsockopt_sol_socket_timestamping(struct mptcp_sock *msk,
struct sock *ssk = mptcp_subflow_tcp_sock(subflow); bool slow = lock_sock_fast(ssk);
sock_set_timestamping(sk, optname, val);
unlock_sock_fast(ssk, slow); }sock_set_timestamping(sk, optname, timestamping);
-- 2.25.1
-- Mat Martineau Intel