linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sven Van Asbroeck <thesven73@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Florian Fainelli <f.fainelli@gmail.com>,
	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 19:57:28 -0500	[thread overview]
Message-ID: <CAGngYiV=bzc72dpA6TJ7Bo2wcTihmB83HCU63pK4Z_jZ2frKww@mail.gmail.com> (raw)
In-Reply-To: <20201209140956.GC2611606@lunn.ch>

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.

  reply	other threads:[~2020-12-17  0:58 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 [this message]
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='CAGngYiV=bzc72dpA6TJ7Bo2wcTihmB83HCU63pK4Z_jZ2frKww@mail.gmail.com' \
    --to=thesven73@gmail.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=bryan.whitehead@microchip.com \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /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).