[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1506062338-3617-1-git-send-email-jasowang@redhat.com>
Date: Fri, 22 Sep 2017 14:38:58 +0800
From: Jason Wang <jasowang@...hat.com>
To: mst@...hat.com, jasowang@...hat.com,
virtualization@...ts.linux-foundation.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: John Fastabend <john.fastabend@...il.com>
Subject: [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@...il.com>
Signed-off-by: Jason Wang <jasowang@...hat.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
Powered by blists - more mailing lists