can: mcp25xxfd: add prediction of CanFD frames sizes based on history
Allow prediction of can frame sizes based on the last 32 Can Frames
received.
Naive histogram approach hast been taken for now.
Some simple stats based on 1000 frames received with DLC=6:
==> /sys/kernel/debug/mcp25xxfd-spi0.0/can/stats/rx_reads_prefetched_too_few
16
==> /sys/kernel/debug/mcp25xxfd-spi0.0/can/stats/rx_reads_prefetched_too_few_bytes
96
==> /sys/kernel/debug/mcp25xxfd-spi0.0/can/stats/rx_reads_prefetched_too_many
0
==> /sys/kernel/debug/mcp25xxfd-spi0.0/can/stats/rx_reads_prefetched_too_many_bytes
0
==> /sys/kernel/debug/mcp25xxfd-spi0.0/can/stats/rx_reads_prefetch_predicted
6
The first 16 frames are predicted as 0, but after that the prediction is 6.
It should be possible to take this prediction to use bulk reads for CanFD
as well when we have a prediction of length of 48 or 64.
Signed-off-by:
Martin Sperl <kernel@martin.sperl.org>
Loading