From: Vladimir Oltean <vladimir.oltean@nxp.com>
To: Wei Fang <wei.fang@nxp.com>
Cc: "davem@davemloft.net" <davem@davemloft.net>,
"edumazet@google.com" <edumazet@google.com>,
"kuba@kernel.org" <kuba@kernel.org>,
"pabeni@redhat.com" <pabeni@redhat.com>,
Claudiu Manoil <claudiu.manoil@nxp.com>,
"ast@kernel.org" <ast@kernel.org>,
"daniel@iogearbox.net" <daniel@iogearbox.net>,
"hawk@kernel.org" <hawk@kernel.org>,
"john.fastabend@gmail.com" <john.fastabend@gmail.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"bpf@vger.kernel.org" <bpf@vger.kernel.org>,
"stable@vger.kernel.org" <stable@vger.kernel.org>,
"imx@lists.linux.dev" <imx@lists.linux.dev>,
"rkannoth@marvell.com" <rkannoth@marvell.com>,
"maciej.fijalkowski@intel.com" <maciej.fijalkowski@intel.com>,
"sbhatta@marvell.com" <sbhatta@marvell.com>
Subject: Re: [PATCH v2 net 3/3] net: enetc: disable IRQ after Rx and Tx BD rings are disabled
Date: Wed, 9 Oct 2024 01:48:06 +0300 [thread overview]
Message-ID: <20241008224806.2onzkt3gbslw5jxb@skbuf> (raw)
In-Reply-To: <PAXPR04MB85101B7AC1C1F46E8DD59958887E2@PAXPR04MB8510.eurprd04.prod.outlook.com>
On Tue, Oct 08, 2024 at 06:30:49AM +0300, Wei Fang wrote:
> I think the reason is that Rx BDRs are disabled when enetc_stop() is called,
> but there are still many unprocessed frames on Rx BDR. These frames will
> be processed by XDP program and put into Tx BDR. So enetc_wait_txbdr()
> will timeout and cause xdp_tx_in_flight will not be cleared.
>
> So based on this patch, we should add a separate patch, similar to the patch
> 2 ("net: enetc: fix the issues of XDP_REDIRECT feature "), which prevents the
> XDP_TX frames from being put into Tx BDRs when the ENETC_TX_DOWN flag
> is set. The new patch is shown below. After adding this new patch, I followed
> your test steps and tested for more than 30 minutes, and the issue cannot be
> reproduced anymore (without this patch, this problem would be reproduced
> within seconds).
>
> --- a/drivers/net/ethernet/freescale/enetc/enetc.c
> +++ b/drivers/net/ethernet/freescale/enetc/enetc.c
> @@ -1606,6 +1606,12 @@ static int enetc_clean_rx_ring_xdp(struct enetc_bdr *rx_ring,
> break;
> case XDP_TX:
> tx_ring = priv->xdp_tx_ring[rx_ring->index];
> + if (unlikely(test_bit(ENETC_TX_DOWN, &priv->flags))) {
> + enetc_xdp_drop(rx_ring, orig_i, i);
> + tx_ring->stats.xdp_tx_drops++;
> + break;
> + }
> +
> xdp_tx_bd_cnt = enetc_rx_swbd_to_xdp_tx_swbd(xdp_tx_arr,
> rx_ring,
> orig_i, i);
Yeah, it works on my side as well. Thanks for following up.
I would argue that the above snippet should be a fixup for the
"net: enetc: fix the issues of XDP_REDIRECT feature" change, and a
rewrite of the commit message is in order. Currently, as a reader, I get
the impression that only XDP_REDIRECT needs to check the ENETC_TX_DOWN
flag, only for the next patch to come and say "remember what was said
about the TX ring not being allowed to actively transmit frames while
disabling it? well, that patch wasn't sufficient to ensure this condition,
because XDP_TX needs to respect that flag as well!"
next prev parent reply other threads:[~2024-10-08 22:48 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-29 2:45 [PATCH v2 net 0/3] net: enetc: fix some issues of XDP Wei Fang
2024-09-29 2:45 ` [PATCH v2 net 1/3] net: enetc: remove xdp_drops statistic from enetc_xdp_drop() Wei Fang
2024-09-29 2:45 ` [PATCH v2 net 2/3] net: enetc: fix the issues of XDP_REDIRECT feature Wei Fang
2024-09-29 2:45 ` [PATCH v2 net 3/3] net: enetc: disable IRQ after Rx and Tx BD rings are disabled Wei Fang
2024-09-30 22:02 ` Vladimir Oltean
2024-10-01 13:39 ` Wei Fang
2024-10-08 3:30 ` Wei Fang
2024-10-08 22:48 ` Vladimir Oltean [this message]
2024-10-09 1:31 ` Wei Fang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241008224806.2onzkt3gbslw5jxb@skbuf \
--to=vladimir.oltean@nxp.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=claudiu.manoil@nxp.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hawk@kernel.org \
--cc=imx@lists.linux.dev \
--cc=john.fastabend@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maciej.fijalkowski@intel.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rkannoth@marvell.com \
--cc=sbhatta@marvell.com \
--cc=stable@vger.kernel.org \
--cc=wei.fang@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox