From: Christoph Paasch <cpaasch at apple.com>
To: mptcp at lists.01.org
Subject: Re: [MPTCP] [PATCH 05/18] tcp6: Prepare for maximum TCP option-space
Date: Thu, 05 Oct 2017 00:41:38 -0700 [thread overview]
Message-ID: <20171005074138.GQ4897@Chimay.local> (raw)
In-Reply-To: alpine.OSX.2.21.1710041523440.28273@syyang-mobl2.amr.corp.intel.com
[-- Attachment #1: Type: text/plain, Size: 2684 bytes --]
On 04/10/17 - 15:33:35, Mat Martineau wrote:
>
> On Tue, 3 Oct 2017, Christoph Paasch wrote:
>
> > With a generic TCP-option framework we don't know in advance how much
> > space will be used. So, estimate the worst and allocate the maximum.
> > Later on, we pull skb->tail back in again.
>
> v2 of the option registration patch will conflict with this. The prepare
> callback does figure out the number of option bytes required before writing
> to the outgoing skb, so that can happen before the alloc_skb().
No worries, I will take care of the conflicts.
Will be working on a v2 of my patchset to handle the incoming data path as
well.
Christoph
>
>
> Mat
>
>
> >
> > Signed-off-by: Christoph Paasch <cpaasch(a)apple.com>
> > ---
> > net/ipv6/tcp_ipv6.c | 16 ++++++++--------
> > 1 file changed, 8 insertions(+), 8 deletions(-)
> >
> > diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
> > index 64d94afa427f..17f7e0cd8755 100644
> > --- a/net/ipv6/tcp_ipv6.c
> > +++ b/net/ipv6/tcp_ipv6.c
> > @@ -784,17 +784,11 @@ static void tcp_v6_send_response(const struct sock *sk, struct sk_buff *skb, u32
> > struct flowi6 fl6;
> > struct net *net = sk ? sock_net(sk) : dev_net(skb_dst(skb)->dev);
> > struct sock *ctl_sk = net->ipv6.tcp_sk;
> > - unsigned int tot_len = sizeof(struct tcphdr);
> > + unsigned int tot_len = sizeof(struct tcphdr) + MAX_TCP_OPTION_SPACE;
> > + unsigned int reduce = 0; /* By how much to pull skb->tail back in? */
> > struct dst_entry *dst;
> > __be32 *topt;
> >
> > - if (tsecr)
> > - tot_len += TCPOLEN_TSTAMP_ALIGNED;
> > -#ifdef CONFIG_TCP_MD5SIG
> > - if (key)
> > - tot_len += TCPOLEN_MD5SIG_ALIGNED;
> > -#endif
> > -
> > buff = alloc_skb(MAX_HEADER + sizeof(struct ipv6hdr) + tot_len,
> > GFP_ATOMIC);
> > if (!buff)
> > @@ -823,6 +817,8 @@ static void tcp_v6_send_response(const struct sock *sk, struct sk_buff *skb, u32
> > (TCPOPT_TIMESTAMP << 8) | TCPOLEN_TIMESTAMP);
> > *topt++ = htonl(tsval);
> > *topt++ = htonl(tsecr);
> > +
> > + reduce += TCPOLEN_TSTAMP_ALIGNED;
> > }
> >
> > #ifdef CONFIG_TCP_MD5SIG
> > @@ -832,9 +828,13 @@ static void tcp_v6_send_response(const struct sock *sk, struct sk_buff *skb, u32
> > tcp_v6_md5_hash_hdr((__u8 *)topt, key,
> > &ipv6_hdr(skb)->saddr,
> > &ipv6_hdr(skb)->daddr, t1);
> > +
> > + reduce += TCPOLEN_MD5SIG_ALIGNED;
> > }
> > #endif
> >
> > + buff->tail -= reduce;
> > +
> > memset(&fl6, 0, sizeof(fl6));
> > fl6.daddr = ipv6_hdr(skb)->saddr;
> > fl6.saddr = ipv6_hdr(skb)->daddr;
> > --
> > 2.14.1
> >
> >
>
> --
> Mat Martineau
> Intel OTC
next reply other threads:[~2017-10-05 7:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-05 7:41 Christoph Paasch [this message]
-- strict thread matches above, loose matches on Subject: below --
2017-10-04 22:33 [MPTCP] [PATCH 05/18] tcp6: Prepare for maximum TCP option-space Mat Martineau
2017-10-03 16:21 Christoph Paasch
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=20171005074138.GQ4897@Chimay.local \
--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.