From: Eric Dumazet <edumazet@google.com>
To: Yafang Shao <laoar.shao@gmail.com>
Cc: David Miller <davem@davemloft.net>,
netdev <netdev@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net-next 2/2] tcp: propagate GSO to the new skb built in tcp collapse
Date: Fri, 27 Jul 2018 20:13:19 -0700 [thread overview]
Message-ID: <CANn89iKFH_F0_Ri76Zsez2Nn8JZ9obprsk+OE7i+enGC=n8Syw@mail.gmail.com> (raw)
In-Reply-To: <1532746900-11710-2-git-send-email-laoar.shao@gmail.com>
On Fri, Jul 27, 2018 at 8:02 PM Yafang Shao <laoar.shao@gmail.com> wrote:
>
> Currently the collapsed SKB doesn't propagate the GSO information to the
> new SKB.
> The GSO should be propagated for better tracking, i.e. when this SKB is
> dropped we could know how many network segments are dropped.
What is "the GSO" ?
>
> Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
> ---
> net/ipv4/tcp_input.c | 12 ++++++++++--
> 1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
> index 90f83eb..af52e4e 100644
> --- a/net/ipv4/tcp_input.c
> +++ b/net/ipv4/tcp_input.c
> @@ -4893,6 +4893,8 @@ void tcp_rbtree_insert(struct rb_root *root, struct sk_buff *skb)
> if (!nskb)
> break;
>
> + skb_shinfo(nskb)->gso_size = skb_shinfo(skb)->gso_size;
> + skb_shinfo(nskb)->gso_type = skb_shinfo(skb)->gso_type;
Why gso_size and gso_type are important ?
Where later in the stack these values are used ?
> memcpy(nskb->cb, skb->cb, sizeof(skb->cb));
> #ifdef CONFIG_TLS_DEVICE
> nskb->decrypted = skb->decrypted;
> @@ -4906,18 +4908,24 @@ void tcp_rbtree_insert(struct rb_root *root, struct sk_buff *skb)
>
> /* Copy data, releasing collapsed skbs. */
> while (copy > 0) {
> - int offset = start - TCP_SKB_CB(skb)->seq;
> int size = TCP_SKB_CB(skb)->end_seq - start;
> + int offset = start - TCP_SKB_CB(skb)->seq;
>
> BUG_ON(offset < 0);
> if (size > 0) {
> - size = min(copy, size);
> + if (copy >= size)
> + skb_shinfo(nskb)->gso_segs +=
> + max_t(u16, 1, skb_shinfo(skb)->gso_segs);
> + else
> + size = copy;
> +
So... what happens if copy was partial ?
Your patch does not really fix the uncertainty, it merely shifts it a bit.
next prev parent reply other threads:[~2018-07-28 3:14 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-28 3:01 [PATCH net-next 1/2] tcp: call tcp_drop() in tcp collapse Yafang Shao
2018-07-28 3:01 ` [PATCH net-next 2/2] tcp: propagate GSO to the new skb built " Yafang Shao
2018-07-28 3:13 ` Eric Dumazet [this message]
2018-07-28 3:22 ` Yafang Shao
2018-07-28 3:06 ` [PATCH net-next 1/2] tcp: call tcp_drop() " Eric Dumazet
2018-07-28 3:34 ` Yafang Shao
2018-07-28 3:38 ` Eric Dumazet
2018-07-28 7:42 ` Yafang Shao
2018-07-28 16:28 ` Eric Dumazet
2018-07-30 2:06 ` Yafang Shao
2018-07-30 2:27 ` Eric Dumazet
2018-07-30 5:40 ` Yafang Shao
2018-07-30 15:56 ` Eric Dumazet
2018-07-31 0:48 ` Yafang Shao
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='CANn89iKFH_F0_Ri76Zsez2Nn8JZ9obprsk+OE7i+enGC=n8Syw@mail.gmail.com' \
--to=edumazet@google.com \
--cc=davem@davemloft.net \
--cc=laoar.shao@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).