netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Justin Capella <justincapella@gmail.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: "Eric Dumazet" <eric.dumazet@gmail.com>,
	"Toke Høiland-Jørgensen" <toke@redhat.com>,
	linux-wireless@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: debugging TCP stalls on high-speed wifi
Date: Thu, 12 Dec 2019 20:15:14 -0800	[thread overview]
Message-ID: <CAMrEMU-WdaAe2wOxsnMn=npPyAjf1KkuxA8cHE==yez_rUELUQ@mail.gmail.com> (raw)
In-Reply-To: <14cedbb9300f887fecc399ebcdb70c153955f876.camel@sipsolutions.net>

Could TCP window size (waiting for ACKnowledgements) be a contributing factor?

On Thu, Dec 12, 2019 at 6:52 AM Johannes Berg <johannes@sipsolutions.net> wrote:
>
> Hi Eric, all,
>
> I've been debugging (much thanks to bpftrace) TCP stalls on wifi, in
> particular on iwlwifi.
>
> What happens, essentially, is that we transmit large aggregates (63
> packets of 7.5k A-MSDU size each, for something on the order of 500kB
> per PPDU). Theoretically we can have ~240 A-MSDUs on our hardware
> queues, and the hardware aggregates them into up to 63 to send as a
> single PPDU.
>
> At HE rates (160 MHz, high rates) such a large PPDU takes less than 2ms
> to transmit.
>
> I'm seeing around 1400 Mbps TCP throughput (a bit more than 1800 UDP),
> but I'm expecting more. A bit more than 1800 for UDP is about the max I
> can expect on this AP (it only does 8k A-MSDU size), but I'd think TCP
> then shouldn't be so much less (and our Windows drivers gets >1600).
>
>
> What I see is that occasionally - and this doesn't happen all the time
> but probably enough to matter - we reclaim a few of those large
> aggregates and free the transmit SKBs, and then we try to pull from
> mac80211's TXQs but they're empty.
>
> At this point - we've just freed 400+k of data, I'd expect TCP to
> immediately push more, but it doesn't happen. I sometimes see another
> set of reclaims emptying the queue entirely (literally down to 0 packets
> on the queue) and it then takes another millisecond or two for TCP to
> start pushing packets again.
>
> Once that happens, I also observe that TCP stops pushing large TSO
> packets and goes down to sometimes less than a single A-MSDU (i.e.
> ~7.5k) in a TSO, perhaps even an MTU-sized frame - didn't check this,
> only the # of frames we make out of this.
>
>
> If you have any thoughts on this, I'd appreciate it.
>
>
> Something I've been wondering is if our TSO implementation causes
> issues, but apart from higher CPU usage I see no real difference if I
> turned it off. I thought so because it splits up the SKBs into those A-
> MSDU sized chunks using skb_gso_segment() and then splits them down into
> MTU-sized all packed together into an A-MSDU using the hardware engine.
> But that means we release a bunch of A-MSDU-sized SKBs back to the TCP
> stack when they transmitted.
>
> Another thought I had was our broken NAPI, but this is TX traffic so the
> only RX thing is sync, and I'm currently still using kernel 5.4 anyway.
>
> Thanks,
> johannes
>

  parent reply	other threads:[~2019-12-13  4:15 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-12 14:50 debugging TCP stalls on high-speed wifi Johannes Berg
2019-12-12 15:11 ` Neal Cardwell
2019-12-12 15:47   ` Johannes Berg
2019-12-12 18:11     ` Eric Dumazet
2019-12-12 21:11       ` Johannes Berg
2019-12-12 21:29         ` Ben Greear
2019-12-12 21:46           ` Johannes Berg
2019-12-12 21:58             ` Ben Greear
2019-12-12 21:50         ` Eric Dumazet
2019-12-12 21:53           ` Johannes Berg
2019-12-12 23:42         ` Dave Taht
2019-12-13  0:59           ` [Make-wifi-fast] " Simon Barber
2019-12-13  1:46             ` Eric Dumazet
2019-12-13  1:57               ` Simon Barber
2019-12-13  4:42               ` Dave Taht
2019-12-13  8:08           ` Johannes Berg
2019-12-13  9:10         ` Krishna Chaitanya
2020-01-24 10:34           ` Johannes Berg
2020-01-24 23:49             ` Eric Dumazet
2019-12-13  4:15 ` Justin Capella [this message]
2019-12-13  7:43   ` Johannes Berg
  -- strict thread matches above, loose matches on Subject: below --
2019-12-16 18:14 Simon Barber
2019-12-16 19:20 ` Eric Dumazet

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='CAMrEMU-WdaAe2wOxsnMn=npPyAjf1KkuxA8cHE==yez_rUELUQ@mail.gmail.com' \
    --to=justincapella@gmail.com \
    --cc=eric.dumazet@gmail.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=toke@redhat.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).