MPTCP Linux Development
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: Geliang Tang <geliang.tang@suse.com>, mptcp@lists.linux.dev
Subject: Re: [PATCH mptcp-next v16 5/8] mptcp: add get_subflow wrapper
Date: Wed, 27 Apr 2022 10:56:57 +0200	[thread overview]
Message-ID: <f44dc02fdc2041cda773d6cb2a848a7b4f625dab.camel@redhat.com> (raw)
In-Reply-To: <d0234513a342a1c3e833c73663feac656d935cfc.camel@redhat.com>

On Wed, 2022-04-27 at 10:27 +0200, Paolo Abeni wrote:
> > +
> > +	msk->sched ? INDIRECT_CALL_INET_1(msk->sched->get_subflow,
> > +					  mptcp_get_subflow_default,
> > +					  msk, reinject, &data) :
> > +		     mptcp_get_subflow_default(msk, reinject, &data);
> 
> With this we have quite a lot of conditionals for the default
> scheduler. I think we can drop the INDIRECT_CALL_INET_1() wrapper, and
> rework the code so that msk->sched is always NULL with the default
> scheduler.

Even better, we could drop the mptcp_get_subflow_default() wrapper and
call directly the current scheduler when msk->sched is NULL, even
before filling the 'data' struct. That should fit nicely expecially if
we use 2 separate ops for plain xmit and retrans.

Overall that would lead to something alike:

---
static inline struct sock *mptcp_sched_get_send(struct mptcp_sock msk)
{
	struct mptcp_sched_data data;

        sock_owned_by_me(sk);

	/* the following check is moved out of mptcp_subflow_get_send */
        if (__mptcp_check_fallback(msk)) {
                if (!msk->first)
                        return NULL;
                return sk_stream_memory_free(msk->first) ? msk->first : NULL;
        }

	if (!msk->sched)
		return mptcp_subflow_get_send(msk);

	data.sock = msk->first; /* if needed */
	data.call_again = 0;	/* if needed */
	msk->sched->get_send(msk, &data);
	msk->last_snd = data.sock;
	return data.sock;
}
---
plus something similar for retrans.

Thanks!

Paolo


  reply	other threads:[~2022-04-27  8:57 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-27  1:56 [PATCH mptcp-next v16 0/8] BPF packet scheduler Geliang Tang
2022-04-27  1:56 ` [PATCH mptcp-next v16 1/8] mptcp: add struct mptcp_sched_ops Geliang Tang
2022-04-27  1:56 ` [PATCH mptcp-next v16 2/8] mptcp: register default scheduler Geliang Tang
2022-04-27  1:56 ` [PATCH mptcp-next v16 3/8] mptcp: add a new sysctl scheduler Geliang Tang
2022-04-27  1:56 ` [PATCH mptcp-next v16 4/8] mptcp: add sched in mptcp_sock Geliang Tang
2022-04-27  1:56 ` [PATCH mptcp-next v16 5/8] mptcp: add get_subflow wrapper Geliang Tang
2022-04-27  8:27   ` Paolo Abeni
2022-04-27  8:56     ` Paolo Abeni [this message]
2022-04-27 14:34     ` Geliang Tang
2022-04-27 16:53       ` Matthieu Baerts
2022-04-27  1:56 ` [PATCH mptcp-next v16 6/8] mptcp: add bpf_mptcp_sched_ops Geliang Tang
2022-04-27 13:29   ` kernel test robot
2022-04-27  1:56 ` [PATCH mptcp-next v16 7/8] selftests: bpf: add bpf_first scheduler Geliang Tang
2022-04-27  1:56 ` [PATCH mptcp-next v16 8/8] selftests: bpf: add bpf_first test Geliang Tang
2022-04-27  3:30   ` selftests: bpf: add bpf_first test: 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=f44dc02fdc2041cda773d6cb2a848a7b4f625dab.camel@redhat.com \
    --to=pabeni@redhat.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