[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210528183908.3c84bff4@kicinski-fedora-PC1C0HJN.hsd1.ca.comcast.net>
Date: Fri, 28 May 2021 18:39:08 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Michael Chan <michael.chan@...adcom.com>
Cc: davem@...emloft.net, netdev@...r.kernel.org, gospo@...adcom.com,
richardcochran@...il.com, pavan.chebbi@...adcom.com,
edwin.peer@...adcom.com
Subject: Re: [PATCH net-next 5/7] bnxt_en: Get the RX packet timestamp.
On Fri, 28 May 2021 20:53:19 -0400 Michael Chan wrote:
> + struct bnxt_ptp_cfg *ptp = bp->ptp_cfg;
> + u64 time;
> +
> + if (!ptp)
> + return -ENODEV;
> +
> + time = READ_ONCE(ptp->old_time);
READ_ONCE() on a u64? That's not gonna prevent tearing the read on 32
bit architectures, right?
> + *ts = (time & BNXT_HI_TIMER_MASK) | pkt_ts;
> + if (pkt_ts < (time & BNXT_LO_TIMER_MASK))
> + *ts += BNXT_LO_TIMER_MASK + 1;
The stamp is from the MAC, I hope, or otherwise packet which could have
been sitting on the ring for some approximation of eternity. You can
easily see a packet stamp older than the value stashed in ptp->old_time
if you run soon after the refresh.
Powered by blists - more mailing lists