net: lan966x: Don't read RX timestamp if not needed
authorHoratiu Vultur <horatiu.vultur@microchip.com>
Fri, 17 Mar 2023 15:27:12 +0000 (16:27 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sun, 19 Mar 2023 15:21:48 +0000 (15:21 +0000)
commitff89ac704e2c92edfdb636070a7e0b91c1e4ec2d
treea9d91553aff8db444df06183d13b813401b0a140
parent105a201ebf3312990b96c4fbaade22e31402f8cc
net: lan966x: Don't read RX timestamp if not needed

Whenever a frame was received to the CPU, the HW is timestamping the
frame. In the IFH(Inter Frame Header) it is found the nanosecond part
of the timestamps the SW is required to read from HW the second part.
But reading the second part it seems to be a expensive operations, so
so change this such to read the second part only when rx filter is
enabled.
Doing this change gives the RX a performance boost of ~70mbit.

before:
[  5]   0.00-10.01  sec   546 MBytes   457 Mbits/sec    0 sender

now:
[  5]   0.00-10.01  sec   652 MBytes   530 Mbits/sec    0 sender

Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c
drivers/net/ethernet/microchip/lan966x/lan966x_main.c
drivers/net/ethernet/microchip/lan966x/lan966x_main.h
drivers/net/ethernet/microchip/lan966x/lan966x_ptp.c