]> git.baikalelectronics.ru Git - kernel.git/commit
ptp: Speed up vclock lookup
authorGerhard Engleder <gerhard@engleder-embedded.com>
Fri, 6 May 2022 20:01:41 +0000 (22:01 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 10 May 2022 07:48:09 +0000 (09:48 +0200)
commitbe7bbcdf08c509c38e5f4942a9b9c08096b32ddb
tree951ac90c002ecfca1fe24c103724808712cdaec0
parentce91496d889b33a2d0e3bf3014532ee4038df2a2
ptp: Speed up vclock lookup

ptp_convert_timestamp() is called in the RX path of network messages.
The current implementation takes ~5000ns on 1.2GHz A53. This is too much
for the hot path of packet processing.

Introduce hash table for fast vclock lookup in ptp_convert_timestamp().
The execution time of ptp_convert_timestamp() is reduced to ~700ns on
1.2GHz A53.

Signed-off-by: Gerhard Engleder <gerhard@engleder-embedded.com>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/ptp/ptp_private.h
drivers/ptp/ptp_vclock.c