All of lore.kernel.org
 help / color / mirror / Atom feed
* [MPTCP] Re: [PATCH v2 mptcp-next 2/2] mptcp: move recbuf adjustment to recvmsg path
@ 2020-05-25 14:55 Paolo Abeni
  0 siblings, 0 replies; only message in thread
From: Paolo Abeni @ 2020-05-25 14:55 UTC (permalink / raw)
  To: mptcp

[-- Attachment #1: Type: text/plain, Size: 1211 bytes --]

On Mon, 2020-05-25 at 14:02 +0200, Florian Westphal wrote:
> @@ -933,6 +926,22 @@ static bool __mptcp_move_skbs(struct mptcp_sock *msk)
>  	return moved > 0;
>  }
>  
> +static void mptcp_rcv_space_adjust(struct mptcp_sock *msk)
> +{
> +	struct sock *sk = (struct sock *)msk;
> +	const struct mptcp_subflow_context *subflow;
> +	const struct sock *ssk;
> +	int rcvbuf = 0;

Reverse x-mas tree ;)

> @@ -975,8 +987,10 @@ static int mptcp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len,
>  		copied += bytes_read;
>  
>  		if (skb_queue_empty(&sk->sk_receive_queue) &&
> -		    __mptcp_move_skbs(msk))
> +		    __mptcp_move_skbs(msk)) {
> +			mptcp_rcv_space_adjust(msk);
>  			continue;
> +		}
>  
>  		/* only the master socket status is relevant here. The exit
>  		 * conditions mirror closely tcp_recvmsg()

We currently don't check the SOCK_RCVBUF_LOCK here, while we do that in
the other mptcp_rcv_space_adjust() call-site.

It likely should not matter as ssk userlocks mimics msk's ones, but for
consistency we could always do the test before trying to update the
buffer (e.g. move the userlocks check inside mptcp_rcv_space_adjust()),
WDYT?

Thanks!

Paolo

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-05-25 14:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-25 14:55 [MPTCP] Re: [PATCH v2 mptcp-next 2/2] mptcp: move recbuf adjustment to recvmsg path Paolo Abeni

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.