Commit 6f0d7198 authored by Florian Westphal's avatar Florian Westphal Committed by David S. Miller

mptcp: setsockopt: add SO_INCOMING_CPU

Replicate to all subflows.
Acked-by: default avatarPaolo Abeni <pabeni@redhat.com>
Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
Signed-off-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 36704413
......@@ -101,6 +101,9 @@ static void mptcp_sol_socket_sync_intval(struct mptcp_sock *msk, int optname, in
sk_dst_reset(ssk);
}
break;
case SO_INCOMING_CPU:
WRITE_ONCE(ssk->sk_incoming_cpu, val);
break;
}
subflow->setsockopt_seq = msk->setsockopt_seq;
......@@ -125,6 +128,15 @@ static int mptcp_sol_socket_intval(struct mptcp_sock *msk, int optname, int val)
return 0;
}
static void mptcp_so_incoming_cpu(struct mptcp_sock *msk, int val)
{
struct sock *sk = (struct sock *)msk;
WRITE_ONCE(sk->sk_incoming_cpu, val);
mptcp_sol_socket_sync_intval(msk, SO_INCOMING_CPU, val);
}
static int mptcp_setsockopt_sol_socket_int(struct mptcp_sock *msk, int optname,
sockptr_t optval, unsigned int optlen)
{
......@@ -145,6 +157,9 @@ static int mptcp_setsockopt_sol_socket_int(struct mptcp_sock *msk, int optname,
case SO_RCVBUF:
case SO_RCVBUFFORCE:
return mptcp_sol_socket_intval(msk, optname, val);
case SO_INCOMING_CPU:
mptcp_so_incoming_cpu(msk, val);
return 0;
}
return -ENOPROTOOPT;
......@@ -230,6 +245,7 @@ static int mptcp_setsockopt_sol_socket(struct mptcp_sock *msk, int optname,
case SO_RCVBUF:
case SO_RCVBUFFORCE:
case SO_MARK:
case SO_INCOMING_CPU:
return mptcp_setsockopt_sol_socket_int(msk, optname, optval, optlen);
case SO_LINGER:
return mptcp_setsockopt_sol_socket_linger(msk, optval, optlen);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment