[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b2c333ce0d3d32719f1813dee11b243654b5a2f8.camel@redhat.com>
Date: Fri, 16 Apr 2021 19:52:58 +0200
From: Paolo Abeni <pabeni@...hat.com>
To: Toke Høiland-Jørgensen <toke@...hat.com>,
"David S. Miller" <davem@...emloft.net>
Cc: Jakub Kicinski <kuba@...nel.org>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Jesper Dangaard Brouer <hawk@...nel.org>,
John Fastabend <john.fastabend@...il.com>,
netdev@...r.kernel.org, bpf@...r.kernel.org
Subject: Re: [PATCH net-next] veth: check for NAPI instead of xdp_prog
before xmit of XDP frame
On Fri, 2021-04-16 at 17:47 +0200, Toke Høiland-Jørgensen wrote:
> The recent patch that tied enabling of veth NAPI to the GRO flag also has
> the nice side effect that a veth device can be the target of an
> XDP_REDIRECT without an XDP program needing to be loaded on the peer
> device. However, the patch adding this extra NAPI mode didn't actually
> change the check in veth_xdp_xmit() to also look at the new NAPI pointer,
> so let's fix that.
>
> Fixes: 6788fa154546 ("veth: allow enabling NAPI even without XDP")
> Signed-off-by: Toke Høiland-Jørgensen <toke@...hat.com>
> ---
> drivers/net/veth.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/veth.c b/drivers/net/veth.c
> index 15b2e3923c47..bdb7ce3cb054 100644
> --- a/drivers/net/veth.c
> +++ b/drivers/net/veth.c
> @@ -486,11 +486,10 @@ static int veth_xdp_xmit(struct net_device *dev, int n,
>
> rcv_priv = netdev_priv(rcv);
> rq = &rcv_priv->rq[veth_select_rxq(rcv)];
> - /* Non-NULL xdp_prog ensures that xdp_ring is initialized on receive
> - * side. This means an XDP program is loaded on the peer and the peer
> - * device is up.
> + /* The napi pointer is set if NAPI is enabled, which ensures that
> + * xdp_ring is initialized on receive side and the peer device is up.
> */
> - if (!rcu_access_pointer(rq->xdp_prog))
> + if (!rcu_access_pointer(rq->napi))
> goto out;
>
> max_len = rcv->mtu + rcv->hard_header_len + VLAN_HLEN;
Acked-by: Paolo Abeni <pabeni@...hat.com>
Thanks for the quick turn-around!
Powered by blists - more mailing lists