[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <237ad66815a7988eaf9b0ed2132772c58e868cd8.camel@redhat.com>
Date: Thu, 12 Oct 2023 10:31:33 +0200
From: Paolo Abeni <pabeni@...hat.com>
To: Shinas Rasheed <srasheed@...vell.com>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, hgani@...vell.com
Cc: vimleshk@...vell.com, egallen@...hat.com, mschmidt@...hat.com,
Veerasenareddy Burru <vburru@...vell.com>, Sathesh Edara
<sedara@...vell.com>, "David S. Miller" <davem@...emloft.net>, Eric Dumazet
<edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Satananda Burla
<sburla@...vell.com>, Abhijit Ayarekar <aayarekar@...vell.com>
Subject: Re: [net PATCH] octeon_ep: update BQL sent bytes before ringing
doorbell
On Tue, 2023-10-10 at 04:50 -0700, Shinas Rasheed wrote:
> Sometimes Tx is completed immediately after doorbell is updated, which
> causes Tx completion routing to update completion bytes before the
> same packet bytes are updated in sent bytes in transmit function, hence
> hitting BUG_ON() in dql_completed(). To avoid this, update BQL
> sent bytes before ringing doorbell.
>
> Fixes: 37d79d059606 ("octeon_ep: add Tx/Rx processing and interrupt support")
> Signed-off-by: Shinas Rasheed <srasheed@...vell.com>
> ---
> drivers/net/ethernet/marvell/octeon_ep/octep_main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/marvell/octeon_ep/octep_main.c b/drivers/net/ethernet/marvell/octeon_ep/octep_main.c
> index dbc518ff8276..314f9c661f93 100644
> --- a/drivers/net/ethernet/marvell/octeon_ep/octep_main.c
> +++ b/drivers/net/ethernet/marvell/octeon_ep/octep_main.c
> @@ -718,6 +718,7 @@ static netdev_tx_t octep_start_xmit(struct sk_buff *skb,
> /* Flush the hw descriptor before writing to doorbell */
> wmb();
>
> + netdev_tx_sent_queue(iq->netdev_q, skb->len);
If tx completion and start_xmit happen on 2 different CPUs, how do you
ensure that xmit_completion will observe the values written here?
Specifically, don't you need to move netdev_tx_sent_queue() before the
above memory barrier?
Thanks,
Paolo
Powered by blists - more mailing lists