From: Florian Westphal <fw at strlen.de>
To: mptcp at lists.01.org
Subject: [MPTCP] Re: [PATCH v2 2/2] mptcp: sendmsg: transmit on backup if other subflows have been closed
Date: Wed, 30 Oct 2019 16:58:02 +0100 [thread overview]
Message-ID: <20191030155802.GE876@breakpoint.cc> (raw)
In-Reply-To: 6a4d6f0bef7b05292e77ec1b7998837cc988c793.camel@redhat.com
[-- Attachment #1: Type: text/plain, Size: 1774 bytes --]
Paolo Abeni <pabeni(a)redhat.com> wrote:
> On Wed, 2019-10-30 at 15:03 +0100, Florian Westphal wrote:
> > diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
> > index d15d64d16136..2b847e079619 100644
> > --- a/net/mptcp/protocol.c
> > +++ b/net/mptcp/protocol.c
> > @@ -344,6 +344,38 @@ static int mptcp_sendmsg_frag(struct sock *sk, struct sock *ssk,
> > return ret;
> > }
> >
> > +static struct sock *mptcp_subflow_get_send(struct mptcp_sock *msk)
> > +{
> > + struct mptcp_subflow_context *subflow;
> > + struct sock *backup = NULL;
> > +
> > + sock_owned_by_me((const struct sock *)msk);
> > +
> > + mptcp_for_each_subflow(msk, subflow) {
> > + struct sock *ssk = mptcp_subflow_tcp_socket(subflow)->sk;
> > +
> > + if (!sk_stream_is_writeable(ssk)) {
> > + struct socket *sock = ssk->sk_socket;
> > +
> > + if (sock)
> > + set_bit(SOCK_NOSPACE, &sock->flags);
>
> Out of sheer ignorance, why is this required? I thought setting NOSPACE
> was required only before waiting for memory.
Its needed for tcp to call sk->sk_write_space() once the substream
becomes writeable.
> > - if (!msg_data_left(msg)) {
> > + if (unlikely(!msg_data_left(msg))) {
> > + ssk = mptcp_subflow_get(msk);
> > pr_debug("empty send");
> > ret = sock_sendmsg(ssk->sk_socket, msg);
> > goto out;
> > }
> >
> > + timeo = sock_sndtimeo(sk, msg->msg_flags & MSG_DONTWAIT);
> > +
> > + smp_mb__before_atomic();
> > + clear_bit(MPTCP_SEND_SPACE, &msk->flags);
> > + smp_mb__after_atomic();
>
> Perhaps the above lines could be moved just before the
> sk_stream_wait_memory() call below?
you mean
while (!ssk) {
clear_bit(MPTCP_SEND_SPACE, &msk->flags);
ret = sk_stream_wait_memory(sk, &timeo);
...
?
next reply other threads:[~2019-10-30 15:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-30 15:58 Florian Westphal [this message]
-- strict thread matches above, loose matches on Subject: below --
2019-10-30 17:21 [MPTCP] Re: [PATCH v2 2/2] mptcp: sendmsg: transmit on backup if other subflows have been closed Florian Westphal
2019-10-30 15:14 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=20191030155802.GE876@breakpoint.cc \
--to=unknown@example.com \
/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 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.