From: Florian Westphal <fw@strlen.de>
To: Mat Martineau <mathew.j.martineau@linux.intel.com>
Cc: Florian Westphal <fw@strlen.de>, mptcp@lists.linux.dev
Subject: Re: [PATCH v2 mptcp-next 3/4] mptcp: add SIOCINQ, OUTQ and OUTQNSD ioctls
Date: Fri, 12 Nov 2021 12:06:58 +0100 [thread overview]
Message-ID: <20211112110658.GA3541@breakpoint.cc> (raw)
In-Reply-To: <246033df-61f-5b44-d7fd-9cd95cf8dc6b@linux.intel.com>
Mat Martineau <mathew.j.martineau@linux.intel.com> wrote:
> > + lock_sock(sk);
> > + if (skb_queue_empty(&msk->receive_queue))
>
> I'm guessing that the idea here is that answering with a nonzero value is
> enough to get the userspace program to do another read, rather than always
> imposing overhead to dig through the subflow rx buffers and
> sk->sk_receive_queue? That does seem like a good way to go, at least with
> regard to calling __mptcp_move_skbs().
>
> Would it be useful to check sk->sk_receive_queue and splice if non-empty
> (which is relatively cheap) to get a slightly more accurate inq number? To
> maybe answer this question for myself - the socket lock was just acquired so
> it's unlikely for skbs to have been added to sk_receive_queue, and the extra
> complexity may not be worth it.
The idea was to avoid a bogus '0' answer; msk rx queue might be empty
but sk_rx q might have new data.
I can make the __mptcp_move_skbs() unconditional, as you said we already
acquired the msk socket lock so might as well splice pending subflows
and so on.
next prev parent reply other threads:[~2021-11-12 11:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-11 15:14 [PATCH v2 mptcp-next 0/4] TCP_INQ support Florian Westphal
2021-11-11 15:14 ` [PATCH v2 mptcp-next 1/4] mptcp: add TCP_INQ cmsg support Florian Westphal
2021-11-11 15:14 ` [PATCH v2 mptcp-next 2/4] selftests: mptcp: add TCP_INQ support Florian Westphal
2021-11-11 15:14 ` [PATCH v2 mptcp-next 3/4] mptcp: add SIOCINQ, OUTQ and OUTQNSD ioctls Florian Westphal
2021-11-12 1:03 ` Mat Martineau
2021-11-12 11:06 ` Florian Westphal [this message]
2021-11-11 15:14 ` [PATCH v2 mptcp-next 4/4] selftests: mptcp: add inq test case Florian Westphal
2021-11-12 1:18 ` Mat Martineau
2021-11-12 4:30 ` Mat Martineau
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=20211112110658.GA3541@breakpoint.cc \
--to=fw@strlen.de \
--cc=mathew.j.martineau@linux.intel.com \
--cc=mptcp@lists.linux.dev \
/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