From: Paolo Abeni <pabeni@redhat.com>
To: Eric Dumazet <eric.dumazet@gmail.com>,
Oleksandr Natalenko <oleksandr@natalenko.name>,
David Miller <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>,
netdev <netdev@vger.kernel.org>,
Soheil Hassas Yeganeh <soheil@google.com>,
Neal Cardwell <ncardwell@google.com>
Subject: Re: [PATCH net] tcp_bbr: better deal with suboptimal GSO
Date: Wed, 21 Feb 2018 16:01:12 +0100 [thread overview]
Message-ID: <1519225272.2988.14.camel@redhat.com> (raw)
In-Reply-To: <1519224183.55655.40.camel@gmail.com>
Hi,
On Wed, 2018-02-21 at 06:43 -0800, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@google.com>
>
> BBR uses tcp_tso_autosize() in an attempt to probe what would be the
> burst sizes and to adjust cwnd in bbr_target_cwnd() with following
> gold formula :
>
> /* Allow enough full-sized skbs in flight to utilize end systems. */
> cwnd += 3 * bbr->tso_segs_goal;
>
> But GSO can be lacking or be constrained to very small
> units (ip link set dev ... gso_max_segs 2)
>
> What we really want is to have enough packets in flight so that both
> GSO and GRO are efficient.
>
> So in the case GSO is off or downgraded, we still want to have the same
> number of packets in flight as if GSO/TSO was fully operational, so
> that GRO can hopefully be working efficiently.
>
> To fix this issue, we make tcp_tso_autosize() unaware of
> sk->sk_gso_max_segs
>
> Only tcp_tso_segs() has to enforce the gso_max_segs limit.
>
> Tested:
>
> ethtool -K eth0 tso off gso off
> tc qd replace dev eth0 root pfifo_fast
>
> Before patch:
> for f in {1..5}; do ./super_netperf 1 -H lpaa24 -- -K bbr; done
> 691 (ss -temoi shows cwnd is stuck around 6 )
> 667
> 651
> 631
> 517
>
> After patch :
> # for f in {1..5}; do ./super_netperf 1 -H lpaa24 -- -K bbr; done
> 1733 (ss -temoi shows cwnd is around 386 )
> 1778
> 1746
> 1781
> 1718
>
> Fixes: 0f8782ea1497 ("tcp_bbr: add BBR congestion control")
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Reported-by: Oleksandr Natalenko <oleksandr@natalenko.name>
> ---
> net/ipv4/tcp_output.c | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
> index b2bca373f8bee35267df49b5947a6793fed71a12..6818042cd8a9a1778f54637861647091afd9a769 100644
> --- a/net/ipv4/tcp_output.c
> +++ b/net/ipv4/tcp_output.c
> @@ -1730,7 +1730,7 @@ u32 tcp_tso_autosize(const struct sock *sk, unsigned int mss_now,
> */
> segs = max_t(u32, bytes / mss_now, min_tso_segs);
>
> - return min_t(u32, segs, sk->sk_gso_max_segs);
> + return segs;
> }
> EXPORT_SYMBOL(tcp_tso_autosize);
>
Very minor nit, why don't:
return max_t(u32, bytes / mss_now, min_tso_segs);
and drop the 'segs' local variable?
Thanks,
Paolo
next prev parent reply other threads:[~2018-02-21 15:01 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-19 19:56 [PATCH net-next 0/6] tcp: remove non GSO code Eric Dumazet
2018-02-19 19:56 ` [PATCH net-next 1/6] tcp: switch to GSO being always on Eric Dumazet
2018-02-20 1:22 ` kbuild test robot
2018-02-19 19:56 ` [PATCH net-next 2/6] tcp: remove sk_can_gso() use Eric Dumazet
2018-02-19 19:56 ` [PATCH net-next 3/6] tcp: remove sk_check_csum_caps() Eric Dumazet
2018-02-19 19:56 ` [PATCH net-next 4/6] tcp: tcp_sendmsg() only deals with CHECKSUM_PARTIAL Eric Dumazet
2018-02-19 19:56 ` [PATCH net-next 5/6] tcp: remove dead code from tcp_set_skb_tso_segs() Eric Dumazet
2018-02-19 19:56 ` [PATCH net-next 6/6] tcp: remove dead code after CHECKSUM_PARTIAL adoption Eric Dumazet
2018-02-20 1:45 ` [PATCH net-next 0/6] tcp: remove non GSO code Soheil Hassas Yeganeh
2018-02-20 9:32 ` Oleksandr Natalenko
2018-02-20 15:39 ` Eric Dumazet
2018-02-20 18:57 ` Eric Dumazet
2018-02-20 19:35 ` Oleksandr Natalenko
2018-02-20 19:39 ` Eric Dumazet
2018-02-20 19:51 ` Oleksandr Natalenko
2018-02-20 19:56 ` Eric Dumazet
2018-02-20 20:06 ` Oleksandr Natalenko
2018-02-20 20:09 ` Eric Dumazet
2018-02-20 20:45 ` Oleksandr Natalenko
2018-02-20 23:21 ` Eric Dumazet
2018-02-21 6:14 ` Oleksandr Natalenko
2018-02-21 14:43 ` [PATCH net] tcp_bbr: better deal with suboptimal GSO Eric Dumazet
2018-02-21 15:01 ` Paolo Abeni [this message]
2018-02-21 15:09 ` Eric Dumazet
2018-02-21 15:55 ` Paolo Abeni
2018-02-21 15:14 ` Neal Cardwell
2018-02-21 15:18 ` Soheil Hassas Yeganeh
2018-02-22 19:16 ` David Miller
2018-02-21 19:37 ` [PATCH net-next 0/6] tcp: remove non GSO code David Miller
2018-02-28 20:10 ` Marcelo Ricardo Leitner
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=1519225272.2988.14.camel@redhat.com \
--to=pabeni@redhat.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=eric.dumazet@gmail.com \
--cc=ncardwell@google.com \
--cc=netdev@vger.kernel.org \
--cc=oleksandr@natalenko.name \
--cc=soheil@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).