Skip to content

Commit

Permalink
virtio-net: correctly set xdp_xmit for mergeable buffer
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jason Wang authored and David S. Miller committed Sep 23, 2017
1 parent 411d788 commit dd54379
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/virtio_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit dd54379

Please sign in to comment.