]> www.infradead.org Git - users/dwmw2/linux.git/commit
bnxt_en: cache only 24 bits of hw counter
authorVadim Fedorenko <vadfed@meta.com>
Sun, 3 Nov 2024 21:51:07 +0000 (13:51 -0800)
committerJakub Kicinski <kuba@kernel.org>
Wed, 6 Nov 2024 01:33:26 +0000 (17:33 -0800)
commitbb2ef9b92bdf7e2e3b5df9747e6f7dcf51587450
tree26e0ac48e371ca1e434308d98a959912a6235332
parentf72aa1b276281b4e4f75261af8425bc99d903f3e
bnxt_en: cache only 24 bits of hw counter

This hardware can provide only 48 bits of cycle counter. We can leave
only 24 bits in the cache to extend RX timestamps from 32 bits to 48
bits. Lower 8 bits of the cached value will be used to check for
roll-over while extending to full 48 bits.
This change makes cache writes atomic even on 32 bit platforms and we
can simply use READ_ONCE()/WRITE_ONCE() pair and remove spinlock. The
configuration structure will be also reduced by 4 bytes.

Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Vadim Fedorenko <vadfed@meta.com>
Link: https://patch.msgid.link/20241103215108.557531-1-vadfed@meta.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c
drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h