From: Peter Krystad <peter.krystad at linux.intel.com>
To: mptcp at lists.01.org
Subject: Re: [MPTCP] [RFC 1/3] mptcp: Slightly refactor mptcp_established_options_xxx()
Date: Tue, 28 May 2019 11:39:44 -0700 [thread overview]
Message-ID: <5031748d93cd359c4943abffeea7202171e65223.camel@linux.intel.com> (raw)
In-Reply-To: 2c913f4b58de8dd723f281226eac7741b8db2c42.camel@redhat.com
[-- Attachment #1: Type: text/plain, Size: 2043 bytes --]
On Thu, 2019-05-23 at 11:00 +0200, Paolo Abeni wrote:
> Hi,
>
> Thank you for doing this and sharing the code early, very appreciated!
>
> On Wed, 2019-05-22 at 14:38 -0700, Peter Krystad wrote:
> > diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
> > index 1cd915890ce5..68a2311b56d4 100644
> > --- a/net/ipv4/tcp_output.c
> > +++ b/net/ipv4/tcp_output.c
> > @@ -797,20 +797,20 @@ static unsigned int tcp_established_options(struct sock *sk, struct sk_buff *skb
> > unsigned int remaining = MAX_TCP_OPTION_SPACE - size;
> > unsigned int opt_size;
> >
> > - if (mptcp_established_options(sk, &opt_size, &opts->mptcp)) {
> > - if (remaining >= opt_size) {
> > - opts->options |= OPTION_MPTCP;
> > - size += opt_size;
> > - }
> > - } else {
> > - unsigned int dss_size;
> > + if ((sk, skb, &opt_size,
> > + remaining, &opts->mptcp)) {
> > + opts->options |= OPTION_MPTCP;
> > + size += opt_size;
> > + remaining -= opt_size;
> > + }
> > +
> > + if (mptcp_established_options_dss(sk, skb, &opt_size,
> > + remaining, &opts->mptcp)) {
> > + opts->options |= OPTION_MPTCP;
> > + size += opt_size;
> > + remaining -= opt_size;
> > + }
> >
> > - if (mptcp_established_options_dss(sk, skb, &dss_size,
> > - remaining,
> > - &opts->mptcp)) {
> > - opts->options |= OPTION_MPTCP;
> > - size += dss_size;
> > - }
> > }
> > }
> >
>
> [Not strictly related to MP_JOIN] I think it could be possibly cleaner
> to expose to the TCP code a single mptcp_established_option() hook and
> handle there all the relevant cases ('plain', _dss() _addr() added by
> the next patch).
>
> The mptcp code should not change much, and possibly it would remove a
> bunch of duplicate checks (about subflow->mp_capable).
I agree a single hook is cleaner, this ended up like this to make the
individual commits stand alone better as features were added. I will revise
this.
Peter.
> Cheers,
>
> Paolo
>
next reply other threads:[~2019-05-28 18:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-28 18:39 Peter Krystad [this message]
-- strict thread matches above, loose matches on Subject: below --
2019-05-23 9:00 [MPTCP] [RFC 1/3] mptcp: Slightly refactor mptcp_established_options_xxx() Paolo Abeni
2019-05-22 21:38 Peter Krystad
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=5031748d93cd359c4943abffeea7202171e65223.camel@linux.intel.com \
--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.