From: Mat Martineau <mathew.j.martineau@linux.intel.com>
To: Geliang Tang <geliang.tang@suse.com>
Cc: mptcp@lists.linux.dev
Subject: Re: [PATCH mptcp-next v4 02/11] mptcp: add new argument ssk_first
Date: Tue, 4 Oct 2022 17:16:21 -0700 (PDT) [thread overview]
Message-ID: <49eef695-e843-f3ab-90fa-6ba21f654147@linux.intel.com> (raw)
In-Reply-To: <03e299e3fa96817a92e0f0f79f7bce938f732d96.1664720538.git.geliang.tang@suse.com>
On Sun, 2 Oct 2022, Geliang Tang wrote:
> The function mptcp_subflow_process_delegated() uses the input ssk first,
> while __mptcp_check_push() invokes the packet scheduler first.
>
> So this patch adds a new argument named ssk_first for the function
> __mptcp_subflow_push_pending() to deal with these two cases separately.
>
> With this change, the code that invokes the packet scheduler in the
> fuction __mptcp_check_push() can be removed, and replaced by invoking
> __mptcp_subflow_push_pending() directly.
>
> Signed-off-by: Geliang Tang <geliang.tang@suse.com>
> ---
> net/mptcp/protocol.c | 22 ++++++++--------------
> 1 file changed, 8 insertions(+), 14 deletions(-)
>
> diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
> index cc8e67543e76..bbc43212a20f 100644
> --- a/net/mptcp/protocol.c
> +++ b/net/mptcp/protocol.c
> @@ -1593,16 +1593,17 @@ void __mptcp_push_pending(struct sock *sk, unsigned int flags)
> __mptcp_check_send_data_fin(sk);
> }
>
> -static void __mptcp_subflow_push_pending(struct sock *sk, struct sock *ssk)
> +static void __mptcp_subflow_push_pending(struct sock *sk, struct sock *ssk,
> + bool ssk_first)
> {
> struct mptcp_sock *msk = mptcp_sk(sk);
> struct mptcp_sendmsg_info info = {
> .data_lock_held = true,
> };
> struct mptcp_data_frag *dfrag;
> + bool first = ssk_first;
Hi Geliang -
Thanks for the v4.
If you add 'first' as the new argument instead of ssk_first, then you can
remove this line and use 'first' everywhere.
- Mat
> struct sock *xmit_ssk;
> int len, copied = 0;
> - bool first = true;
>
> info.flags = 0;
> while ((dfrag = mptcp_send_head(sk))) {
> @@ -1612,8 +1613,7 @@ static void __mptcp_subflow_push_pending(struct sock *sk, struct sock *ssk)
> while (len > 0) {
> int ret = 0;
>
> - /* the caller already invoked the packet scheduler,
> - * check for a different subflow usage only after
> + /* check for a different subflow usage only after
> * spooling the first chunk of data
> */
> xmit_ssk = first ? ssk : mptcp_subflow_get_send(mptcp_sk(sk));
> @@ -3195,16 +3195,10 @@ void __mptcp_check_push(struct sock *sk, struct sock *ssk)
> if (!mptcp_send_head(sk))
> return;
>
> - if (!sock_owned_by_user(sk)) {
> - struct sock *xmit_ssk = mptcp_subflow_get_send(mptcp_sk(sk));
> -
> - if (xmit_ssk == ssk)
> - __mptcp_subflow_push_pending(sk, ssk);
> - else if (xmit_ssk)
> - mptcp_subflow_delegate(mptcp_subflow_ctx(xmit_ssk), MPTCP_DELEGATE_SEND);
> - } else {
> + if (!sock_owned_by_user(sk))
> + __mptcp_subflow_push_pending(sk, ssk, false);
> + else
> __set_bit(MPTCP_PUSH_PENDING, &mptcp_sk(sk)->cb_flags);
> - }
> }
>
> #define MPTCP_FLAGS_PROCESS_CTX_NEED (BIT(MPTCP_PUSH_PENDING) | \
> @@ -3295,7 +3289,7 @@ void mptcp_subflow_process_delegated(struct sock *ssk)
> if (test_bit(MPTCP_DELEGATE_SEND, &subflow->delegated_status)) {
> mptcp_data_lock(sk);
> if (!sock_owned_by_user(sk))
> - __mptcp_subflow_push_pending(sk, ssk);
> + __mptcp_subflow_push_pending(sk, ssk, true);
> else
> __set_bit(MPTCP_PUSH_PENDING, &mptcp_sk(sk)->cb_flags);
> mptcp_data_unlock(sk);
> --
> 2.35.3
>
>
>
--
Mat Martineau
Intel
next prev parent reply other threads:[~2022-10-05 0:16 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-02 14:25 [PATCH mptcp-next v4 00/11] refactor push pending Geliang Tang
2022-10-02 14:25 ` [PATCH mptcp-next v4 01/11] Squash to "mptcp: add get_subflow wrappers" Geliang Tang
2022-10-02 14:25 ` [PATCH mptcp-next v4 02/11] mptcp: add new argument ssk_first Geliang Tang
2022-10-05 0:16 ` Mat Martineau [this message]
2022-10-02 14:25 ` [PATCH mptcp-next v4 03/11] mptcp: move burst check out of subflow_get_send Geliang Tang
2022-10-05 0:20 ` Mat Martineau
2022-10-05 0:24 ` Mat Martineau
2022-10-02 14:25 ` [PATCH mptcp-next v4 04/11] mptcp: refactor push_pending logic Geliang Tang
2022-10-05 0:23 ` Mat Martineau
2022-10-02 14:25 ` [PATCH mptcp-next v4 05/11] mptcp: simplify push_pending Geliang Tang
2022-10-05 0:33 ` Mat Martineau
2022-10-02 14:25 ` [PATCH mptcp-next v4 06/11] mptcp: multi subflows push_pending Geliang Tang
2022-10-02 14:25 ` [PATCH mptcp-next v4 07/11] mptcp: use msk instead of mptcp_sk Geliang Tang
2022-10-02 14:25 ` [PATCH mptcp-next v4 08/11] mptcp: refactor subflow_push_pending logic Geliang Tang
2022-10-02 14:25 ` [PATCH mptcp-next v4 09/11] mptcp: simplify subflow_push_pending Geliang Tang
2022-10-02 14:25 ` [PATCH mptcp-next v4 10/11] mptcp: multi subflows subflow_push_pending Geliang Tang
2022-10-02 14:25 ` [PATCH mptcp-next v4 11/11] mptcp: multi subflows retrans support Geliang Tang
2022-10-06 15:43 ` mptcp: multi subflows retrans support: Tests Results MPTCP CI
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=49eef695-e843-f3ab-90fa-6ba21f654147@linux.intel.com \
--to=mathew.j.martineau@linux.intel.com \
--cc=geliang.tang@suse.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