🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
2 messages
2 total messages Started by Lorenzo Bianconi Sun, 18 Oct 2026 09:08
Re: [PATCH net 1/2] veth: schedule the peer's NAPI after XDP_TX when only GRO is enabled
#4512
Author: Lorenzo Bianconi
Date: Sun, 18 Oct 2026 09:08
61 lines
7817 bytes
--threxb6QVOCWS9wz
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

> veth_xdp_xmit() queues XDP_TX frames on the peer's ring if the peer has
> NAPI. A peer with GRO enabled and no XDP program also has NAPI.
>=20
> veth_xdp_flush() then schedules the peer's NAPI, but only if the peer's
> xdp_prog is set, so for such a peer the frames are never processed.
> Nothing else schedules that NAPI by default.
>=20
> Once the ring is full, every XDP_TX frame is dropped, and so are the
> skbs that veth_xmit() queues on the same ring.
>=20
> Commit 0e672f306a28 ("veth: check for NAPI instead of xdp_prog before
> xmit of XDP frame") changed the check in veth_xdp_xmit() but not the one
> in veth_xdp_flush(). Make veth_xdp_flush() check the napi pointer
> instead of xdp_prog, as veth_xdp_xmit() does.
>=20
> Fixes: 0e672f306a28 ("veth: check for NAPI instead of xdp_prog before xmi=
t of XDP frame")
> Signed-off-by: Tianyi Gao <tianyi@cloudflare.com>

Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>

> ---
>  drivers/net/veth.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>=20
> diff --git a/drivers/net/veth.c b/drivers/net/veth.c
> index 643b97dc5245..9405ffac598a 100644
> --- a/drivers/net/veth.c
> +++ b/drivers/net/veth.c
> @@ -612,7 +612,7 @@ static void veth_xdp_flush(struct veth_rq *rq, struct=
 veth_xdp_tx_bq *bq)
>  	rcv_priv =3D netdev_priv(rcv);
>  	rcv_rq =3D &rcv_priv->rq[veth_select_rxq(rcv)];
>  	/* xdp_ring is initialized on receive side? */
> -	if (unlikely(!rcu_access_pointer(rcv_rq->xdp_prog)))
> +	if (unlikely(!rcu_access_pointer(rcv_rq->napi)))
>  		goto out;
> =20
>  	__veth_xdp_flush(rcv_rq);
> --=20
> 2.55.0
>=20

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

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

iHUEABYKAB0WIQTquNwa3Txd3rGGn7Y6cBh0uS2trAUCatSMqQAKCRA6cBh0uS2t
rPSYAQD5RUAZm2NgGMSYCi+SCQmjyV/IRzA/JOrJhI5wDZP82wEA9uqCGuB5bi8b
UqEIm6MiOPFm2R47mSuUhs2EnMwVxgk=
=d12M
-----END PGP SIGNATURE-----

--threxb6QVOCWS9wz--
Re: [PATCH net 1/2] veth: schedule the peer's NAPI after XDP_TX when only GRO is enabled
#4819
Author: Jesper Dangaard Brouer
Date: Mon, 19 Oct 2026 09:58
50 lines
7459 bytes

On 10/18/26 11:08, Lorenzo Bianconi wrote:
>> veth_xdp_xmit() queues XDP_TX frames on the peer's ring if the peer has
>> NAPI. A peer with GRO enabled and no XDP program also has NAPI.
>>
>> veth_xdp_flush() then schedules the peer's NAPI, but only if the peer's
>> xdp_prog is set, so for such a peer the frames are never processed.
>> Nothing else schedules that NAPI by default.
>>
>> Once the ring is full, every XDP_TX frame is dropped, and so are the
>> skbs that veth_xmit() queues on the same ring.
>>
>> Commit 0e672f306a28 ("veth: check for NAPI instead of xdp_prog before
>> xmit of XDP frame") changed the check in veth_xdp_xmit() but not the one
>> in veth_xdp_flush(). Make veth_xdp_flush() check the napi pointer
>> instead of xdp_prog, as veth_xdp_xmit() does.
>>
>> Fixes: 0e672f306a28 ("veth: check for NAPI instead of xdp_prog before xmit of XDP frame")
>> Signed-off-by: Tianyi Gao <tianyi@cloudflare.com>
> 
> Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>


LGTM

Acked-by: Jesper Dangaard Brouer <hawk@kernel.org>


>> ---
>>   drivers/net/veth.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/veth.c b/drivers/net/veth.c
>> index 643b97dc5245..9405ffac598a 100644
>> --- a/drivers/net/veth.c
>> +++ b/drivers/net/veth.c
>> @@ -612,7 +612,7 @@ static void veth_xdp_flush(struct veth_rq *rq, struct veth_xdp_tx_bq *bq)
>>   	rcv_priv = netdev_priv(rcv);
>>   	rcv_rq = &rcv_priv->rq[veth_select_rxq(rcv)];
>>   	/* xdp_ring is initialized on receive side? */
>> -	if (unlikely(!rcu_access_pointer(rcv_rq->xdp_prog)))
>> +	if (unlikely(!rcu_access_pointer(rcv_rq->napi)))
>>   		goto out;
>>   
>>   	__veth_xdp_flush(rcv_rq);
>> -- 
>> 2.55.0
>>
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