🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
5 messages
5 total messages Started by Lorenzo Bianconi Tue, 17 Nov 2026 15:51
[PATCH net] net: stmmac: fix num tx queues in stmmac_xdp_get_tx_queue()
#17951
Author: Lorenzo Bianconi
Date: Tue, 17 Nov 2026 15:51
47 lines
16448 bytes
The TX queue returned by stmmac_xdp_get_tx_queue() is passed to
netdev_get_tx_queue(), so it must be lower than dev->real_num_tx_queues.
Since mqprio offload can reduce real_num_tx_queues below
plat->tx_queues_to_use, wrapping the CPU index by plat->tx_queues_to_use
can select a TX queue that is not part of the real queue set when the
offload is active.

Use priv->xmit_qdisc.num_tx_queues instead, which is the value
stmmac_hw_setup() installs as real_num_tx_queues and is guaranteed to
never exceed plat->tx_queues_to_use.

Fixes: 195e4f409a40 ("net: stmmac: support fp parameter of tc-mqprio")
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 25894771e9e9..cf87afd27343 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -5408,13 +5408,14 @@ static int stmmac_xdp_xmit_xdpf(struct stmmac_priv *priv, int queue,
 static int stmmac_xdp_get_tx_queue(struct stmmac_priv *priv,
 				   int cpu)
 {
+	unsigned int num_tx_queues = priv->xmit_qdisc.num_tx_queues;
 	int index = cpu;
 
 	if (unlikely(index < 0))
 		index = 0;
 
-	while (index >= priv->plat->tx_queues_to_use)
-		index -= priv->plat->tx_queues_to_use;
+	while (index >= num_tx_queues)
+		index -= num_tx_queues;
 
 	return index;
 }

---
base-commit: 5e9b2ad9b8384cd3c417cd5e2c3bc7eee4a72791
change-id: 20261117-stmmac-fix-xdp_get_tx_queue-0eda31da641f

Best regards,
-- 
Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
Re: [PATCH net] net: stmmac: fix num tx queues in stmmac_xdp_get_tx_queue()
#17963
Author: netdev-bot+sinfo
Date: Tue, 17 Nov 2026 15:57
27 lines
9356 bytes
Hi!

This is an automated message. This series looks like a fix, but its
commit messages seem to be missing some information:

 - How the issue was discovered, e.g. hit in production, hit during
   development, syzbot report, manual code inspection, LLM or static
   analysis tool scan.

 - Whether the issue was actually triggered, or is only theoretical
   (e.g. found by LLM and not proven at runtime). If it was triggered
   please include the symptoms, like the stack trace or kernel messages.

 - What hardware the change was tested on. For driver fixes please
   mention the device (and if relevant firmware version) used for
   testing, or say that the change was not tested on real hardware.

Please do not repost the series just to address the above. Instead,
reply to this email with the missing information, so that reviewers
can take it into account.

*IMPORTANT*: If you do repost (for other reasons) - please include
the relevant info in the cover letter or commit messages.
-- 
The evaluation is done by an LLM so it may be wrong, if you think
that is the case please reply and explain.
Re: [PATCH net] net: stmmac: fix num tx queues in stmmac_xdp_get_tx_queue()
#18097
Author: Lorenzo Bianconi
Date: Tue, 17 Nov 2026 20:30
57 lines
17331 bytes
--yWCWm74GHDxD+Shx
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

> Hi!
>=20
> This is an automated message. This series looks like a fix, but its
> commit messages seem to be missing some information:
>=20
>  - How the issue was discovered, e.g. hit in production, hit during
>    development, syzbot report, manual code inspection, LLM or static
>    analysis tool scan.

I spotted the issue during code development

>=20
>  - Whether the issue was actually triggered, or is only theoretical
>    (e.g. found by LLM and not proven at runtime). If it was triggered
>    please include the symptoms, like the stack trace or kernel messages.

This is a theoretical issue found during code inspection

>=20
>  - What hardware the change was tested on. For driver fixes please
>    mention the device (and if relevant firmware version) used for
>    testing, or say that the change was not tested on real hardware.

I tested it on a Qualcomm rb3-gen2 board.

Regards,
Lorenzo

>=20
> Please do not repost the series just to address the above. Instead,
> reply to this email with the missing information, so that reviewers
> can take it into account.
>=20
> *IMPORTANT*: If you do repost (for other reasons) - please include
> the relevant info in the cover letter or commit messages.
> --=20
> The evaluation is done by an LLM so it may be wrong, if you think
> that is the case please reply and explain.

--yWCWm74GHDxD+Shx
Content-Type: application/pgp-signature; name=signature.asc

-----BEGIN PGP SIGNATURE-----

iHUEABYKAB0WIQTquNwa3Txd3rGGn7Y6cBh0uS2trAUCavy5ZAAKCRA6cBh0uS2t
rNETAQCGRKCmAlCPuoAkpL6wjQtgkOfJzgxEyivCOFRwznyeRgEAzxJ/oRmVS7b7
WgSqNYbiG98w/qgPodTtfuyjaYDQTws=
=BxgR
-----END PGP SIGNATURE-----

--yWCWm74GHDxD+Shx--
Re: [PATCH net] net: stmmac: fix num tx queues in stmmac_xdp_get_tx_queue()
#19654
Author: netdev-bot+sashiko
Date: Fri, 20 Nov 2026 06:54
209 lines
16308 bytes
Thank you for your contribution! Sashiko AI review found 5 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · Low: 4

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] The commit message says a TX queue passed to
  netdev_get_tx_queue() must be below dev->real_num_tx_queues while…
- [Low] The commit message's reason for the change is technically wrong.
- [Low] stmmac_xdp_get_tx_queue() now bounds the queue index by
  priv->xmit_qdisc.num_tx_queues and assumes it equals…
- [Low] stmmac_xdp_get_tx_queue() (stmmac_main.c:5411) reads
  priv->xmit_qdisc.num_tx_queues with a plain load from NAPI softirq and…
- [Low] For XDP_TX, the TX queue is computed twice per RX NAPI poll: -
  stmmac_xdp_xmit_back() (stmmac_main.c:5436) calls…

--

net: stmmac: fix num tx queues in stmmac_xdp_get_tx_queue()

This commit makes stmmac_xdp_get_tx_queue() wrap the CPU index by
priv->xmit_qdisc.num_tx_queues instead of plat->tx_queues_to_use. The goal
is to keep XDP TX inside the real TX queue set when mqprio offload has
reduced real_num_tx_queues.

> The TX queue returned by stmmac_xdp_get_tx_queue() is passed to
> netdev_get_tx_queue(), so it must be lower than dev->real_num_tx_queues.

[Severity: Low]
Is this reasoning accurate? netdev_get_tx_queue() only requires the index
to be below num_tx_queues, not real_num_tx_queues:

include/linux/netdevice.h:netdev_get_tx_queue() {
	DEBUG_NET_WARN_ON_ONCE(index >= dev->num_tx_queues);
	return &dev->_tx[index];
}

The old index always had a DMA ring behind it as well, because
tc_setup_dwmac510_mqprio() caps the mqprio queue range at
tx_queues_to_use:

	if (qopt->offset[i] + qopt->count[i] >
	    priv->plat->tx_queues_to_use) {

As far as I can tell, what users see with the old code is XDP frames
bypassing the mqprio/FPE TC-to-queue mapping. In channel mode they can land
on unmapped queues, which tc_mqprio_config_queue_prio() sets to prio 0
under strict priority.

Could the commit message describe that impact instead, so stable
backporters can judge it?

> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index 25894771e9e9f..cf87afd273439 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -5408,13 +5408,14 @@ static int stmmac_xdp_xmit_xdpf(struct stmmac_priv *priv, int queue,
>  static int stmmac_xdp_get_tx_queue(struct stmmac_priv *priv,
>  				   int cpu)
>  {
> +	unsigned int num_tx_queues = priv->xmit_qdisc.num_tx_queues;

[Severity: Low]
Can this value get out of sync with dev->real_num_tx_queues while the tc
mqprio configuration is being changed?

In tc_setup_dwmac510_mqprio(), real_num_tx_queues is lowered (with
synchronize_net()) before the shadow copy is updated:

	err = netif_set_real_num_tx_queues(ndev, num_tx_queues);
	...
		tc_mqprio_config_queue_prio(priv, qopt);

	priv->xmit_qdisc.num_tx_queues = num_tx_queues;

No grace period follows the store. XDP_TX in NAPI and stmmac_xdp_xmit()
can therefore still pick a queue that was just removed from the real set,
and call netdev_get_tx_queue()/__netif_tx_lock() on it.

stmmac_reset_tc_mqprio() does the updates in the opposite order, and it
ignores the return value of the grow:

	priv->xmit_qdisc.num_tx_queues = priv->plat->tx_queues_to_use;
	priv->xmit_qdisc.enabled = false;

	netdev_reset_tc(ndev);
	netif_set_real_num_tx_queues(ndev, priv->plat->tx_queues_to_use);

If netif_set_real_num_tx_queues() fails here, the shadow stays above
real_num_tx_queues until the next stmmac_hw_setup(). That is the mismatch
this patch is trying to avoid.

Would it be simpler to read READ_ONCE(priv->dev->real_num_tx_queues)
directly, since that follows the core's publish-then-synchronize_net()
ordering?

[Severity: Low]
This is a plain load from NAPI softirq and ndo_xdp_xmit context.
tc_setup_dwmac510_mqprio() and stmmac_reset_tc_mqprio() write the field
with plain stores under RTNL while the device is up. Will KCSAN report
this as a data race?

This path already uses READ_ONCE() for other values that can be tuned at
runtime, for example in stmmac_xdp_xmit_xdpf():

	tx_coal = READ_ONCE(priv->tx_coal_frames[queue]);

Without an annotation, the compiler may re-load the field inside the loop
below. Suppose a re-load during stmmac_reset_tc_mqprio() returns a larger
value than the one used in the loop test. Then index goes negative, and
the mixed int/unsigned comparison treats it as a very large value.

I have no evidence that any compiler actually does this here. Would it
still be worth adding READ_ONCE() here and WRITE_ONCE() at both writers?

Before this patch the divisor was plat->tx_queues_to_use. That value only
changes in stmmac_reinit_queues(), while the device is released and NAPI
is deleted.

>  	int index = cpu;
>  
>  	if (unlikely(index < 0))
>  		index = 0;
>  
> -	while (index >= priv->plat->tx_queues_to_use)
> -		index -= priv->plat->tx_queues_to_use;
> +	while (index >= num_tx_queues)
> +		index -= num_tx_queues;
>  
>  	return index;
>  }

[Severity: Low]
The divisor can now change at runtime. Can the two calls to this helper
in one RX NAPI poll then return different queues for XDP_TX?

stmmac_xdp_xmit_back() picks the queue for each frame, posts descriptors
and flushes the tail pointer. It does not arm the coalescing timer:

	queue = stmmac_xdp_get_tx_queue(priv, cpu);
	nq = netdev_get_tx_queue(priv->dev, queue);
	...
		stmmac_flush_tx_descriptors(priv, queue);

stmmac_finalize_xdp_rx() then computes the queue again at the end of
stmmac_rx()/stmmac_rx_zc(), and arms the timer on that result:

	queue = stmmac_xdp_get_tx_queue(priv, cpu);

	if (xdp_status & STMMAC_XDP_TX)
		stmmac_tx_timer_arm(priv, queue);

If tc_setup_dwmac510_mqprio() changes xmit_qdisc.num_tx_queues between the
two calls, the frames sit on ring A while the timer is armed on ring B.

stmmac_xdp_xmit_xdpf() only sets IC periodically:

	if (tx_coal && (tx_q->tx_count_frames % tx_coal) < num_frames) {

So up to tx_coal - 1 descriptors on ring A may get neither a completion
interrupt nor a timer to schedule stmmac_tx_clean().

After a shrink, ring A can be outside the new real set and may not be used
again. In that case the page_pool pages and DMA buffers stay held until
ifdown, or until the queue is used again.

stmmac_xdp_xmit() arms the timer on the same queue it flushes, so only
the split XDP_TX path appears to be affected.

[Severity: Medium]
The commit message says the TX queue must be lower than
real_num_tx_queues. Does the AF_XDP zero-copy TX path still violate that?

stmmac_tx_clean() calls stmmac_xdp_xmit_zc() for any queue whose
tx_q->xsk_pool is set, and stmmac_xdp_xmit_zc() uses the queue id
directly:

	struct netdev_queue *nq = netdev_get_tx_queue(priv->dev, queue);
	struct stmmac_tx_queue *tx_q = &priv->dma_conf.tx_queue[queue];

The queue id is only checked against plat->tx_queues_to_use, in both
stmmac_xdp_enable_pool() and stmmac_xsk_wakeup():

	if (queue >= priv->plat->rx_queues_to_use ||
	    queue >= priv->plat->tx_queues_to_use)
		return -EINVAL;

The core's xsk_reg_pool_at_qid() accepts any queue_id below
max(real_num_rx_queues, real_num_tx_queues). stmmac_hw_setup() keeps
real_num_rx_queues at rx_queues_to_use.

For example, take tx = rx = 4 and mqprio with 2 TCs on queues 0 and 1.
real_num_tx_queues is then 2. An AF_XDP zero-copy socket bound to queue 3
still transmits on TX queue 3, outside the mqprio TC set.

tc_setup_dwmac510_mqprio() does not check af_xdp_zc_qps either, so
shrinking the queue set after the bind gives the same result.

Should stmmac_xdp_enable_pool(), stmmac_xsk_wakeup() and the mqprio setup
also check against xmit_qdisc.num_tx_queues?

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261117-stmmac-fix-xdp_get_tx_queue-v1-1-4cd74ee7a76c%40oss.qualcomm.com
Re: [PATCH net] net: stmmac: fix num tx queues in stmmac_xdp_get_tx_queue()
#20164
Author: Lorenzo Bianconi
Date: Sat, 21 Nov 2026 17:22
240 lines
24727 bytes
--CU6NLkee2yyowqkr
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

> Thank you for your contribution! Sashiko AI review found 5 potential
> issue(s) to consider.
>=20
> Critical: 0 =C2=B7 High: 0 =C2=B7 Medium: 1 =C2=B7 Low: 4
>=20
> If you believe none of the issues are legitimate, please reply to each
> issue of Medium severity or higher and explain why the AI is wrong.
> If any of them are legitimate and you plan to respin, please let patchwork
> know by including "pw-bot: cr" as a separate line at the end of your reply
> (one such reply per series is enough).
>=20
> - [Medium] The commit message says a TX queue passed to
>   netdev_get_tx_queue() must be below dev->real_num_tx_queues while=E2=80=
=A6
> - [Low] The commit message's reason for the change is technically wrong.
> - [Low] stmmac_xdp_get_tx_queue() now bounds the queue index by
>   priv->xmit_qdisc.num_tx_queues and assumes it equals=E2=80=A6
> - [Low] stmmac_xdp_get_tx_queue() (stmmac_main.c:5411) reads
>   priv->xmit_qdisc.num_tx_queues with a plain load from NAPI softirq and=
=E2=80=A6
> - [Low] For XDP_TX, the TX queue is computed twice per RX NAPI poll: -
>   stmmac_xdp_xmit_back() (stmmac_main.c:5436) calls=E2=80=A6

I will take care of them in v2.

Regards,
Lorenzo

>=20
> --
>=20
> net: stmmac: fix num tx queues in stmmac_xdp_get_tx_queue()
>=20
> This commit makes stmmac_xdp_get_tx_queue() wrap the CPU index by
> priv->xmit_qdisc.num_tx_queues instead of plat->tx_queues_to_use. The goal
> is to keep XDP TX inside the real TX queue set when mqprio offload has
> reduced real_num_tx_queues.
>=20
> > The TX queue returned by stmmac_xdp_get_tx_queue() is passed to
> > netdev_get_tx_queue(), so it must be lower than dev->real_num_tx_queues.
>=20
> [Severity: Low]
> Is this reasoning accurate? netdev_get_tx_queue() only requires the index
> to be below num_tx_queues, not real_num_tx_queues:
>=20
> include/linux/netdevice.h:netdev_get_tx_queue() {
> 	DEBUG_NET_WARN_ON_ONCE(index >=3D dev->num_tx_queues);
> 	return &dev->_tx[index];
> }
>=20
> The old index always had a DMA ring behind it as well, because
> tc_setup_dwmac510_mqprio() caps the mqprio queue range at
> tx_queues_to_use:
>=20
> 	if (qopt->offset[i] + qopt->count[i] >
> 	    priv->plat->tx_queues_to_use) {
>=20
> As far as I can tell, what users see with the old code is XDP frames
> bypassing the mqprio/FPE TC-to-queue mapping. In channel mode they can la=
nd
> on unmapped queues, which tc_mqprio_config_queue_prio() sets to prio 0
> under strict priority.
>=20
> Could the commit message describe that impact instead, so stable
> backporters can judge it?
>=20
> > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/driver=
s/net/ethernet/stmicro/stmmac/stmmac_main.c
> > index 25894771e9e9f..cf87afd273439 100644
> > --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> > +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> > @@ -5408,13 +5408,14 @@ static int stmmac_xdp_xmit_xdpf(struct stmmac_p=
riv *priv, int queue,
> >  static int stmmac_xdp_get_tx_queue(struct stmmac_priv *priv,
> >  				   int cpu)
> >  {
> > +	unsigned int num_tx_queues =3D priv->xmit_qdisc.num_tx_queues;
>=20
> [Severity: Low]
> Can this value get out of sync with dev->real_num_tx_queues while the tc
> mqprio configuration is being changed?
>=20
> In tc_setup_dwmac510_mqprio(), real_num_tx_queues is lowered (with
> synchronize_net()) before the shadow copy is updated:
>=20
> 	err =3D netif_set_real_num_tx_queues(ndev, num_tx_queues);
> 	...
> 		tc_mqprio_config_queue_prio(priv, qopt);
>=20
> 	priv->xmit_qdisc.num_tx_queues =3D num_tx_queues;
>=20
> No grace period follows the store. XDP_TX in NAPI and stmmac_xdp_xmit()
> can therefore still pick a queue that was just removed from the real set,
> and call netdev_get_tx_queue()/__netif_tx_lock() on it.
>=20
> stmmac_reset_tc_mqprio() does the updates in the opposite order, and it
> ignores the return value of the grow:
>=20
> 	priv->xmit_qdisc.num_tx_queues =3D priv->plat->tx_queues_to_use;
> 	priv->xmit_qdisc.enabled =3D false;
>=20
> 	netdev_reset_tc(ndev);
> 	netif_set_real_num_tx_queues(ndev, priv->plat->tx_queues_to_use);
>=20
> If netif_set_real_num_tx_queues() fails here, the shadow stays above
> real_num_tx_queues until the next stmmac_hw_setup(). That is the mismatch
> this patch is trying to avoid.
>=20
> Would it be simpler to read READ_ONCE(priv->dev->real_num_tx_queues)
> directly, since that follows the core's publish-then-synchronize_net()
> ordering?
>=20
> [Severity: Low]
> This is a plain load from NAPI softirq and ndo_xdp_xmit context.
> tc_setup_dwmac510_mqprio() and stmmac_reset_tc_mqprio() write the field
> with plain stores under RTNL while the device is up. Will KCSAN report
> this as a data race?
>=20
> This path already uses READ_ONCE() for other values that can be tuned at
> runtime, for example in stmmac_xdp_xmit_xdpf():
>=20
> 	tx_coal =3D READ_ONCE(priv->tx_coal_frames[queue]);
>=20
> Without an annotation, the compiler may re-load the field inside the loop
> below. Suppose a re-load during stmmac_reset_tc_mqprio() returns a larger
> value than the one used in the loop test. Then index goes negative, and
> the mixed int/unsigned comparison treats it as a very large value.
>=20
> I have no evidence that any compiler actually does this here. Would it
> still be worth adding READ_ONCE() here and WRITE_ONCE() at both writers?
>=20
> Before this patch the divisor was plat->tx_queues_to_use. That value only
> changes in stmmac_reinit_queues(), while the device is released and NAPI
> is deleted.
>=20
> >  	int index =3D cpu;
> > =20
> >  	if (unlikely(index < 0))
> >  		index =3D 0;
> > =20
> > -	while (index >=3D priv->plat->tx_queues_to_use)
> > -		index -=3D priv->plat->tx_queues_to_use;
> > +	while (index >=3D num_tx_queues)
> > +		index -=3D num_tx_queues;
> > =20
> >  	return index;
> >  }
>=20
> [Severity: Low]
> The divisor can now change at runtime. Can the two calls to this helper
> in one RX NAPI poll then return different queues for XDP_TX?
>=20
> stmmac_xdp_xmit_back() picks the queue for each frame, posts descriptors
> and flushes the tail pointer. It does not arm the coalescing timer:
>=20
> 	queue =3D stmmac_xdp_get_tx_queue(priv, cpu);
> 	nq =3D netdev_get_tx_queue(priv->dev, queue);
> 	...
> 		stmmac_flush_tx_descriptors(priv, queue);
>=20
> stmmac_finalize_xdp_rx() then computes the queue again at the end of
> stmmac_rx()/stmmac_rx_zc(), and arms the timer on that result:
>=20
> 	queue =3D stmmac_xdp_get_tx_queue(priv, cpu);
>=20
> 	if (xdp_status & STMMAC_XDP_TX)
> 		stmmac_tx_timer_arm(priv, queue);
>=20
> If tc_setup_dwmac510_mqprio() changes xmit_qdisc.num_tx_queues between the
> two calls, the frames sit on ring A while the timer is armed on ring B.
>=20
> stmmac_xdp_xmit_xdpf() only sets IC periodically:
>=20
> 	if (tx_coal && (tx_q->tx_count_frames % tx_coal) < num_frames) {
>=20
> So up to tx_coal - 1 descriptors on ring A may get neither a completion
> interrupt nor a timer to schedule stmmac_tx_clean().
>=20
> After a shrink, ring A can be outside the new real set and may not be used
> again. In that case the page_pool pages and DMA buffers stay held until
> ifdown, or until the queue is used again.
>=20
> stmmac_xdp_xmit() arms the timer on the same queue it flushes, so only
> the split XDP_TX path appears to be affected.
>=20
> [Severity: Medium]
> The commit message says the TX queue must be lower than
> real_num_tx_queues. Does the AF_XDP zero-copy TX path still violate that?
>=20
> stmmac_tx_clean() calls stmmac_xdp_xmit_zc() for any queue whose
> tx_q->xsk_pool is set, and stmmac_xdp_xmit_zc() uses the queue id
> directly:
>=20
> 	struct netdev_queue *nq =3D netdev_get_tx_queue(priv->dev, queue);
> 	struct stmmac_tx_queue *tx_q =3D &priv->dma_conf.tx_queue[queue];
>=20
> The queue id is only checked against plat->tx_queues_to_use, in both
> stmmac_xdp_enable_pool() and stmmac_xsk_wakeup():
>=20
> 	if (queue >=3D priv->plat->rx_queues_to_use ||
> 	    queue >=3D priv->plat->tx_queues_to_use)
> 		return -EINVAL;
>=20
> The core's xsk_reg_pool_at_qid() accepts any queue_id below
> max(real_num_rx_queues, real_num_tx_queues). stmmac_hw_setup() keeps
> real_num_rx_queues at rx_queues_to_use.
>=20
> For example, take tx =3D rx =3D 4 and mqprio with 2 TCs on queues 0 and 1.
> real_num_tx_queues is then 2. An AF_XDP zero-copy socket bound to queue 3
> still transmits on TX queue 3, outside the mqprio TC set.
>=20
> tc_setup_dwmac510_mqprio() does not check af_xdp_zc_qps either, so
> shrinking the queue set after the bind gives the same result.
>=20
> Should stmmac_xdp_enable_pool(), stmmac_xsk_wakeup() and the mqprio setup
> also check against xmit_qdisc.num_tx_queues?
>=20
> --=20
> Sashiko AI review =C2=B7 https://netdev-ai.bots.linux.dev/sashiko/#/patch=
set/20261117-stmmac-fix-xdp_get_tx_queue-v1-1-4cd74ee7a76c%40oss.qualcomm.c=
om

--CU6NLkee2yyowqkr
Content-Type: application/pgp-signature; name=signature.asc

-----BEGIN PGP SIGNATURE-----

iHUEABYKAB0WIQTquNwa3Txd3rGGn7Y6cBh0uS2trAUCawHTQAAKCRA6cBh0uS2t
rBNaAQCPlYqlb94GFsQf69dhz86QUg4S4DutkXf0pQWz191uzwEAt7ZM2NzgGmyh
tgeB7XSXca41MPJFRsaDOIr/0+yuagA=
=e3PY
-----END PGP SIGNATURE-----

--CU6NLkee2yyowqkr--
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads