[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACKFLinJE-QfyUSDpYYfKtKEypMKZX_y_rAm_nQCQz_cDh8YjQ@mail.gmail.com>
Date: Mon, 14 Oct 2024 23:20:36 -0700
From: Michael Chan <michael.chan@...adcom.com>
To: Vadim Fedorenko <vadfed@...a.com>
Cc: Vadim Fedorenko <vadim.fedorenko@...ux.dev>, Jakub Kicinski <kuba@...nel.org>,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Paolo Abeni <pabeni@...hat.com>, netdev@...r.kernel.org
Subject: Re: [PATCH net-next] bnxt_en: replace PTP spinlock with seqlock
On Mon, Oct 14, 2024 at 4:29 PM Vadim Fedorenko <vadfed@...a.com> wrote:
>
> We can see high contention on ptp_lock while doing RX timestamping
> on high packet rates over several queues. Spinlock is not effecient
> to protect timecounter for RX timestamps when reads are the most
> usual operations and writes are only occasional. It's better to use
> seqlock in such cases.
>
> Signed-off-by: Vadim Fedorenko <vadfed@...a.com>
> -/* Caller holds ptp_lock */
> static int bnxt_refclk_read(struct bnxt *bp, struct ptp_system_timestamp *sts,
> u64 *ns)
> {
> struct bnxt_ptp_cfg *ptp = bp->ptp_cfg;
> u32 high_before, high_now, low;
>
> + /* Make sure the RESET bit is set */
> + smp_mb__before_atomic();
This may not be sufficient. MMIO read of any register (clock register
in this case) can hang the chip if it is undergoing reset.
> if (test_bit(BNXT_STATE_IN_FW_RESET, &bp->state))
> return -EIO;
We could have missed the flag and got here while the chip is about to be reset.
I will review the patch in more detail tomorrow. Thanks.
Download attachment "smime.p7s" of type "application/pkcs7-signature" (4209 bytes)
Powered by blists - more mailing lists