diff options
author | Gerhard Engleder <gerhard@engleder-embedded.com> | 2022-05-06 23:01:41 +0300 |
---|---|---|
committer | Paolo Abeni <pabeni@redhat.com> | 2022-05-10 10:48:09 +0300 |
commit | fcf308e50928a9c9eca90c56f9fc6885005dafd1 (patch) | |
tree | 951ac90c002ecfca1fe24c103724808712cdaec0 /drivers/ptp/ptp_private.h | |
parent | 97dc7cd92ac67f6e05df418df1772ba4a7fbf693 (diff) | |
download | linux-fcf308e50928a9c9eca90c56f9fc6885005dafd1.tar.xz |
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>
Diffstat (limited to 'drivers/ptp/ptp_private.h')
-rw-r--r-- | drivers/ptp/ptp_private.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/ptp/ptp_private.h b/drivers/ptp/ptp_private.h index ab47c10b3874..77918a2c6701 100644 --- a/drivers/ptp/ptp_private.h +++ b/drivers/ptp/ptp_private.h @@ -63,6 +63,7 @@ struct ptp_vclock { struct ptp_clock *pclock; struct ptp_clock_info info; struct ptp_clock *clock; + struct hlist_node vclock_hash_node; struct cyclecounter cc; struct timecounter tc; spinlock_t lock; /* protects tc/cc */ |