mptcp.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: Florian Westphal <fw@strlen.de>, mptcp@lists.01.org
Subject: [MPTCP] Re: [PATCH mptcp-next 3/9] mptcp: setsockopt: handle receive/send buffer and device bind
Date: Fri, 19 Mar 2021 12:44:39 +0100	[thread overview]
Message-ID: <cb98a92cc776c730c89c992182441bcf38561ae8.camel@redhat.com> (raw)
In-Reply-To: <20210317163828.27406-4-fw@strlen.de>

On Wed, 2021-03-17 at 17:38 +0100, Florian Westphal wrote:
> Similar to previous patch: needs to be mirrored to all subflows.
> 
> Device bind is simpler: it is only done on the initial (listener) sk.
> 
> Signed-off-by: Florian Westphal <fw@strlen.de>
> ---
>  net/mptcp/sockopt.c | 51 +++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 51 insertions(+)
> 
> diff --git a/net/mptcp/sockopt.c b/net/mptcp/sockopt.c
> index 33ca67e99f8f..9a87c50e21a4 100644
> --- a/net/mptcp/sockopt.c
> +++ b/net/mptcp/sockopt.c
> @@ -79,6 +79,38 @@ static int mptcp_so_priority(struct mptcp_sock *msk, int val)
>  	return 0;
>  }
>  
> +static int mptcp_so_sndrcvbuf(struct mptcp_sock *msk, int optname, int val)
> +{
> +	sockptr_t optval = KERNEL_SOCKPTR(&val);
> +	struct mptcp_subflow_context *subflow;
> +	struct sock *sk = (struct sock *)msk;
> +	int ret;
> +
> +	ret = sock_setsockopt(sk->sk_socket, SOL_SOCKET, optname,
> +			      optval, sizeof(val));
> +	if (ret)
> +		return ret;
> +
> +	lock_sock(sk);
> +	mptcp_for_each_subflow(msk, subflow) {
> +		struct sock *ssk = mptcp_subflow_tcp_sock(subflow);
> +		bool slow = lock_sock_fast(ssk);
> +		unsigned int ulock;
> +
> +		ulock = sk->sk_userlocks;
> +		ulock &= SOCK_SNDBUF_LOCK | SOCK_RCVBUF_LOCK;
> +
> +		ssk->sk_priority = val;
> +		ssk->sk_userlocks |= ulock;
> +		WRITE_ONCE(ssk->sk_sndbuf, sk->sk_sndbuf);
> +		WRITE_ONCE(ssk->sk_rcvbuf, sk->sk_rcvbuf);

I guess we should overwrite the snd/rcv buf size only if the
corrensponding LOCK is set ?!? The same below in the synchronization
part.

Cheers,

Paolo
_______________________________________________
mptcp mailing list -- mptcp@lists.01.org
To unsubscribe send an email to mptcp-leave@lists.01.org

  reply	other threads:[~2021-03-19 11:44 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-17 16:38 [MPTCP] [RFC PATCH mptcp-next 0/9] initial SOL_SOCKET support Florian Westphal
2021-03-17 16:38 ` [MPTCP] [PATCH mptcp-next 1/9] mptcp: add skeleton to sync msk socket options to subflows Florian Westphal
2021-03-19 11:33   ` [MPTCP] " Paolo Abeni
2021-03-19 12:34     ` Florian Westphal
2021-03-19 14:36       ` Paolo Abeni
2021-03-17 16:38 ` [MPTCP] [PATCH mptcp-next 2/9] mptcp: setsockopt: handle SO_KEEPALIVE and SO_PRIORITY Florian Westphal
2021-03-19 11:43   ` [MPTCP] " Paolo Abeni
2021-03-19 12:35     ` Florian Westphal
2021-03-17 16:38 ` [MPTCP] [PATCH mptcp-next 3/9] mptcp: setsockopt: handle receive/send buffer and device bind Florian Westphal
2021-03-19 11:44   ` Paolo Abeni [this message]
2021-03-19 12:37     ` [MPTCP] " Florian Westphal
2021-03-17 16:38 ` [MPTCP] [PATCH mptcp-next 8/9] mptcp: sockopt: add TCP_CONGESTION Florian Westphal
2021-03-19 11:54   ` [MPTCP] " Paolo Abeni
2021-03-19 12:19   ` Paolo Abeni
2021-03-17 16:38 ` [MPTCP] [PATCH mptcp-next 9/9] mptcp: sockopt: handle TCP_INFO Florian Westphal
2021-03-19 12:00   ` [MPTCP] " Paolo Abeni

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=cb98a92cc776c730c89c992182441bcf38561ae8.camel@redhat.com \
    --to=pabeni@redhat.com \
    --cc=fw@strlen.de \
    --cc=mptcp@lists.01.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).