Thread (42 messages) flat view 42 messages, 6 authors, 2020-05-21

Re: [PATCH V6 00/20] net: ks8851: Unify KS8851 SPI and MLL drivers

From: Marek Vasut <marex@denx.de>
Date: 2020-05-17 02:28:14

On 5/17/20 4:02 AM, David Miller wrote:
From: Marek Vasut <marex@denx.de>
Date: Sun, 17 May 2020 02:33:34 +0200
quoted
The KS8851SNL/SNLI and KS8851-16MLL/MLLI/MLLU are very much the same pieces
of silicon, except the former has an SPI interface, while the later has a
parallel bus interface. Thus far, Linux has two separate drivers for each
and they are diverging considerably.

This series unifies them into a single driver with small SPI and parallel
bus specific parts. The approach here is to first separate out the SPI
specific parts into a separate file, then add parallel bus accessors in
another separate file and then finally remove the old parallel bus driver.
The reason for replacing the old parallel bus driver is because the SPI
bus driver is much higher quality.
What strikes me in these changes is all of the new indirect jumps in
the fast paths of TX and RX packet processing.  It's just too much for
my eyes. :-)

Especially in the presence of Spectre mitigations, these costs are
quite non-trivial.

Seriously, I would recommend that instead of having these small
indirect helpers, just inline the differences into two instances of
the RX interrupt and the TX handler.
So I was already led into reworking the entire series to do this
inlining once, after V1. It then turned out it's a horrible mess to get
everything to compile as modules and built-in and then also only the
parallel/SPI as a module and then the other way around.

Since Lukas was very adamant about the performance impact of these
indirect calls, I did measurements and it turned out the impact is
basically nonexistent. And that's pretty much to be expected, since this
is a 100 Mbit ethernet on SPI bus limited to 40 MHz (so effectively a 40
Mbit ethernet tops) or on parallel bus. The parallel bus option is the
"more performant" one and even that one shows no difference with and
without this series in iperf, either in throughput or latency.

So I spent more time and undid those changes again. And here is the V6
of the series.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help