public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Oltean <vladimir.oltean@nxp.com>
To: Wei Fang <wei.fang@nxp.com>
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, claudiu.manoil@nxp.com, ast@kernel.org,
	daniel@iogearbox.net, hawk@kernel.org, john.fastabend@gmail.com,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	bpf@vger.kernel.org, stable@vger.kernel.org, imx@lists.linux.dev,
	rkannoth@marvell.com, maciej.fijalkowski@intel.com,
	sbhatta@marvell.com
Subject: Re: [PATCH v4 net 3/4] net: enetc: disable Tx BD rings after they are empty
Date: Fri, 11 Oct 2024 17:40:09 +0300	[thread overview]
Message-ID: <20241011144009.ydoyf5vlxqrdj2pu@skbuf> (raw)
In-Reply-To: <20241010092056.298128-4-wei.fang@nxp.com>

On Thu, Oct 10, 2024 at 05:20:55PM +0800, Wei Fang wrote:
> The Tx BD rings are disabled first in enetc_stop() and the driver
> waits for them to become empty. This operation is not safe while
> the ring is actively transmitting frames, and will cause the ring
> to not be empty and hardware exception. As described in the NETC
> block guide, software should only disable an active Tx ring after
> all pending ring entries have been consumed (i.e. when PI = CI).
> Disabling a transmit ring that is actively processing BDs risks
> a HW-SW race hazard whereby a hardware resource becomes assigned
> to work on one or more ring entries only to have those entries be
> removed due to the ring becoming disabled.
> 
> When testing XDP_REDIRECT feautre, although all frames were blocked
> from being put into Tx rings during ring reconfiguration, the similar
> warning log was still encountered:
> 
> fsl_enetc 0000:00:00.2 eno2: timeout for tx ring #6 clear
> fsl_enetc 0000:00:00.2 eno2: timeout for tx ring #7 clear
> 
> The reason is that when there are still unsent frames in the Tx ring,
> disabling the Tx ring causes the remaining frames to be unable to be
> sent out. And the Tx ring cannot be restored, which means that even
> if the xdp program is uninstalled, the Tx frames cannot be sent out
> anymore. Therefore, correct the operation order in enect_start() and
> enect_stop().

Typos, no need to resend for this: enect -> enetc.

> 
> Fixes: ff58fda09096 ("net: enetc: prioritize ability to go down over packet processing")
> Cc: stable@vger.kernel.org
> Signed-off-by: Wei Fang <wei.fang@nxp.com>
> ---

Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>

  reply	other threads:[~2024-10-11 14:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-10  9:20 [PATCH v4 net 0/4] net: enetc: fix some issues of XDP Wei Fang
2024-10-10  9:20 ` [PATCH v4 net 1/4] net: enetc: remove xdp_drops statistic from enetc_xdp_drop() Wei Fang
2024-10-10  9:20 ` [PATCH v4 net 2/4] net: enetc: block concurrent XDP transmissions during ring reconfiguration Wei Fang
2024-10-11 14:38   ` Vladimir Oltean
2024-10-10  9:20 ` [PATCH v4 net 3/4] net: enetc: disable Tx BD rings after they are empty Wei Fang
2024-10-11 14:40   ` Vladimir Oltean [this message]
2024-10-10  9:20 ` [PATCH v4 net 4/4] net: enetc: disable NAPI after all rings are disabled Wei Fang
2024-10-11 14:42   ` Vladimir Oltean
2024-10-11 23:10 ` [PATCH v4 net 0/4] net: enetc: fix some issues of XDP patchwork-bot+netdevbpf

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=20241011144009.ydoyf5vlxqrdj2pu@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