netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Pengcheng Yang" <yangpc@wangsu.com>
To: "'Neal Cardwell'" <ncardwell@google.com>
Cc: "'Eric Dumazet'" <edumazet@google.com>,
	"'Yuchung Cheng'" <ycheng@google.com>, <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next] tcp: ensure to use the most recently sent skb when filling the rate sample
Date: Sat, 16 Apr 2022 00:44:16 +0800	[thread overview]
Message-ID: <000001d850e8$0c5743f0$2505cbd0$@wangsu.com> (raw)
In-Reply-To: <CADVnQymBgfzsyqdnm81bGiA6j=Kb96Ekz0XcYiUR2p-+tLbO6g@mail.gmail.com>

On Fri, Apr 15, 2022 at 12:12 AM Neal Cardwell <ncardwell@google.com> wrote:
> 
> On Wed, Apr 13, 2022 at 6:54 AM Pengcheng Yang <yangpc@wangsu.com> wrote:
> >
> > If an ACK (s)acks multiple skbs, we favor the information
> > from the most recently sent skb by choosing the skb with
> > the highest prior_delivered count.
> > But prior_delivered may be equal, because tp->delivered only
> > changes when receiving, which requires further comparison of
> > skb timestamp.
> >
> > Signed-off-by: Pengcheng Yang <yangpc@wangsu.com>
> 
> Thank you for posting this patch! I agree there is a bug there, and
> your patch is an improvement. However, I think this patch is not a
> complete solution, since it does not handle the case where there are
> multiple skbs with the tcp_skb_timestamp_us() (which can happen if a
> outgoing buffered TSO/GSO skb is later split into multiple skbs with
> the same timestamp).
> 
My initial thought was that this case would not affect the correctness of rate_sample,
since the timestamp of these skbs are the same.
So I am confused whether we have to find the *real* most recently (with the highest seq) skb
(at the cost of a little extra cost)?

> RACK has to deal with the same question "which skb was sent first?",
> and already has a solution in tcp_rack_sent_after(). I suggest we
> share code between RACK and tcp_rate_skb_delivered() to make this
> check. This might involve making a copy of tcp_rack_sent_after() in
> include/net/tcp.h, naming the .h copy to tcp_skb_sent_after(), and
> reworking this logic to save and use the sequence number and timestamp
> so that it can use the new tcp_skb_sent_after() helper. After this fix
> propagates to net-next we could later then change RACK to use the new
> tcp_skb_sent_after() function, so we have a single helper used in two
> places.
> 

Ok. I will send the V2 later according to your suggestion. Thanks neal.

> If you want to post a version of this patch that uses some approach
> like that, IMHO that would be welcome. If you do not have cycles, I am
> happy to post one when I get a moment.
> 
> thanks,
> neal


      reply	other threads:[~2022-04-15 16:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-13 10:54 [PATCH net-next] tcp: ensure to use the most recently sent skb when filling the rate sample Pengcheng Yang
2022-04-14 16:11 ` Neal Cardwell
2022-04-15 16:44   ` Pengcheng Yang [this message]

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='000001d850e8$0c5743f0$2505cbd0$@wangsu.com' \
    --to=yangpc@wangsu.com \
    --cc=edumazet@google.com \
    --cc=ncardwell@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=ycheng@google.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 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).