Jason Wang
2017-Sep-22 06:38 UTC
[PATCH net-next] virtio-net: correctly set xdp_xmit for mergeable buffer
We should set xdp_xmit only when xdp_do_redirect() succeed. Cc: John Fastabend <john.fastabend at gmail.com> Signed-off-by: Jason Wang <jasowang at redhat.com> --- drivers/net/virtio_net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index f6c1f13..dd14a45 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -721,7 +721,7 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, goto xdp_xmit; case XDP_REDIRECT: err = xdp_do_redirect(dev, &xdp, xdp_prog); - if (err) + if (!err) *xdp_xmit = true; rcu_read_unlock(); goto xdp_xmit; -- 2.7.4
David Miller
2017-Sep-23 01:16 UTC
[PATCH net-next] virtio-net: correctly set xdp_xmit for mergeable buffer
From: Jason Wang <jasowang at redhat.com> Date: Fri, 22 Sep 2017 14:38:58 +0800> We should set xdp_xmit only when xdp_do_redirect() succeed. > > Cc: John Fastabend <john.fastabend at gmail.com> > Signed-off-by: Jason Wang <jasowang at redhat.com>Applied, thanks Jason.
Seemingly Similar Threads
- [PATCH net-next] virtio-net: correctly set xdp_xmit for mergeable buffer
- [PATCH net-next 3/3] virtio-net: support XDP_REDIRECT
- [PATCH net-next 3/3] virtio-net: support XDP_REDIRECT
- [PATCH net-next 3/3] virtio-net: support XDP_REDIRECT
- [PATCH net-next 1/3] virtio-net: remove unnecessary parameter of virtnet_xdp_xmit()