mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Sven Van Asbroeck <thesven73@gmail.com>, Andrew Lunn <andrew@lunn.ch>
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: Wed, 16 Dec 2020 17:01:33 -0800	[thread overview]
Message-ID: <b0779675-2bbd-d7c1-6e63-070a98dd5d41@gmail.com> (raw)
In-Reply-To: <CAGngYiV=bzc72dpA6TJ7Bo2wcTihmB83HCU63pK4Z_jZ2frKww@mail.gmail.com>

On 12/16/20 4:57 PM, Sven Van Asbroeck wrote:
> Hi Andrew,
> 
> On Wed, Dec 9, 2020 at 9:10 AM Andrew Lunn <andrew@lunn.ch> wrote:
>>
>> 9K is not a nice number, since for each allocation it probably has to
>> find 4 contiguous pages. See what the performance difference is with
>> 2K, 4K and 8K. If there is a big difference, you might want to special
>> case when the MTU is set for jumbo packets, or check if the hardware
>> can do scatter/gather.
>>
>> You also need to be careful with caches and speculation. As you have
>> seen, bad things can happen. And it can be a lot more subtle. If some
>> code is accessing the page before the buffer and gets towards the end
>> of the page, the CPU might speculatively bring in the next page, i.e
>> the start of the buffer. If that happens before the DMA operation, and
>> you don't invalidate the cache correctly, you get hard to find
>> corruption.
> 
> Thank you for the guidance. When I keep the 9K buffers, and sync
> only the buffer space that is being used (mtu when mapping, received
> packet size when unmapping), then there is no more corruption, and
> performance improves. But setting the buffer size to the mtu size
> still provides much better performance. I do not understand why
> (yet).
> 
> It seems that caching and dma behaviour/performance on arm32
> (armv7) is very different compared to x86.

x86 is a fully cache and device coherent memory architecture and there
are smarts like DDIO to bring freshly DMA'd data into the L3 cache
directly. For ARMv7, it depends on the hardware you have, most ARMv7
SoCs do not have hardware maintained coherency at all, this means that
doing the cache maintenance operations is costly. This is even true on
platforms that use an external cache controller (PL310).
-- 
Florian

  reply	other threads:[~2020-12-17  1:02 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
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 [this message]
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=b0779675-2bbd-d7c1-6e63-070a98dd5d41@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=andrew@lunn.ch \
    --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

Powered by JetHome