net/enetc: improve prefetch in Rx ring clean
authorAlex Marginean <alexandru.marginean@nxp.com>
Mon, 2 Mar 2020 14:32:08 +0000 (20:02 +0530)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 18 Mar 2020 09:21:41 +0000 (10:21 +0100)
commit515e4eab2bfea860ed0176a35f8dfa9f14a6ef0c
tree55aae447582a9c794e6bfda52c260f653d06debc
parent4df8bf017160187ad18cd486ce8c2d7297632e19
net/enetc: improve prefetch in Rx ring clean

LS1028A does not have platform cache so any reads following a hardware
write will go directly to DDR.  Latency of such a read is in excess of
100 core cycles, so try to prefetch more in advance to mitigate this.
How much is worth prefetching really depends on traffic conditions.
With congested Rx this could go up to 4 cache lines or so.  But if
software keeps up with hardware and follows behind Rx PI by a cache line
then it's harmful in terms of performance to cache more.  We would only
prefetch data that's yet to be written by ENETC, which will be evicted
again anyway.

Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
Acked-by: Gagandeep Singh <g.singh@nxp.com>
drivers/net/enetc/enetc_rxtx.c