netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Sven Van Asbroeck <thesven73@gmail.com>
Cc: Jakub Kicinski <kuba@kernel.org>,
	Bryan Whitehead <bryan.whitehead@microchip.com>,
	Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>,
	David S Miller <davem@davemloft.net>,
	netdev <netdev@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net v1 2/2] lan743x: boost performance: limit PCIe bandwidth requirement
Date: Tue, 8 Dec 2020 23:51:25 +0100	[thread overview]
Message-ID: <20201208225125.GA2602479@lunn.ch> (raw)
In-Reply-To: <CAGngYiVSHRGC+eOCeF3Kyj_wOVqxJHvoc9fXRk-w+sVRjeSpcw@mail.gmail.com>

> That's a good question. I used perf to create a flame graph of what
> the cpu was doing when receiving data at high speed. It showed that
> __dma_page_dev_to_cpu took up most of the cpu time. Which is triggered
> by dma_unmap_single(9K, DMA_FROM_DEVICE).
> 
> So I assumed that it's a PCIe dma bandwidth issue, but I could be wrong -
> I didn't do any PCIe bandwidth measurements.

Sometimes it is actually cache operations which take all the
time. This needs to invalidate the cache, so that when the memory is
then accessed, it get fetched from RAM. On SMP machines, cache
invalidation can be expensive, due to all the cross CPU operations.
I've actually got better performance by building a UP kernel on some
low core count ARM CPUs.

There are some tricks which can be played. Do you actually need all
9K? Does the descriptor tell you actually how much is used? You can
get a nice speed up if you just unmap 64 bytes for a TCP ACK, rather
than the full 9K.

     Andrew

  reply	other threads:[~2020-12-08 22:52 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-06  3:44 [PATCH net v1 1/2] lan743x: improve performance: fix rx_napi_poll/interrupt ping-pong Sven Van Asbroeck
2020-12-06  3:44 ` [PATCH net v1 2/2] lan743x: boost performance: limit PCIe bandwidth requirement Sven Van Asbroeck
2020-12-08 19:43   ` Jakub Kicinski
2020-12-08 21:54     ` Sven Van Asbroeck
2020-12-08 22:51       ` Andrew Lunn [this message]
2020-12-08 23:02         ` Sven Van Asbroeck
2020-12-08 23:07           ` Jakub Kicinski
2020-12-08 23:36           ` Florian Fainelli
2020-12-09  1:22             ` Andrew Lunn
2020-12-09  3:49             ` Sven Van Asbroeck
2020-12-09 14:09               ` Andrew Lunn
2020-12-17  0:57                 ` Sven Van Asbroeck
2020-12-17  1:01                   ` Florian Fainelli
2020-12-17  3:18                     ` Sven Van Asbroeck
2020-12-08 23:13       ` Jakub Kicinski
2020-12-08 19:50 ` [PATCH net v1 1/2] lan743x: improve performance: fix rx_napi_poll/interrupt ping-pong Jakub Kicinski
2020-12-08 22:23   ` Sven Van Asbroeck
2020-12-08 23:29     ` Jakub Kicinski
2020-12-08 23:50       ` Eric Dumazet
2020-12-09  0:17         ` Sven Van Asbroeck

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=20201208225125.GA2602479@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=bryan.whitehead@microchip.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=thesven73@gmail.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).