]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
bnxt_en: Fix HWTSTAMP_FILTER_ALL packet timestamp logic
authorMichael Chan <michael.chan@broadcom.com>
Fri, 8 Dec 2023 00:16:58 +0000 (16:16 -0800)
committerJakub Kicinski <kuba@kernel.org>
Sat, 9 Dec 2023 01:20:26 +0000 (17:20 -0800)
commitc13e268c0768659cdaae4bfe2fb24860bcc8ddb4
tree130b5afbf9bddd0e7b9b8009f8e3fc32adb25c8f
parentbd6781c18cb5b5e5d8c5873fa9a51668e89ec76e
bnxt_en: Fix HWTSTAMP_FILTER_ALL packet timestamp logic

When the chip is configured to timestamp all receive packets, the
timestamp in the RX completion is only valid if the metadata
present flag is not set for packets received on the wire.  In
addition, internal loopback packets will never have a valid timestamp
and the timestamp field will always be zero.  We must exclude
any 0 value in the timestamp field because there is no way to
determine if it is a loopback packet or not.

Add a new function bnxt_rx_ts_valid() to check for all timestamp
valid conditions.

Fixes: 66ed81dcedc6 ("bnxt_en: Enable packet timestamping for all RX packets")
Reviewed-by: Andy Gospodarek <andrew.gospodarek@broadcom.com>
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Link: https://lore.kernel.org/r/20231208001658.14230-5-michael.chan@broadcom.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/broadcom/bnxt/bnxt.c
drivers/net/ethernet/broadcom/bnxt/bnxt.h