summaryrefslogtreecommitdiff
path: root/drivers/net/virtio_net.c
diff options
context:
space:
mode:
authorJason Wang <jasowang@redhat.com>2017-09-22 14:38:58 +0800
committerDavid S. Miller <davem@davemloft.net>2017-09-22 18:15:33 -0700
commitdd5437974964c759570d68e50ce13c313808f79a (patch)
treec8acaa29cbf8d90aac5eecc28e20f87a32a15b94 /drivers/net/virtio_net.c
parent411d788a23f7e20b8fc51b548c7204fdecc9d22e (diff)
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@gmail.com> Signed-off-by: Jason Wang <jasowang@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/virtio_net.c')
-rw-r--r--drivers/net/virtio_net.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index f6c1f135a024..dd14a4547932 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;