Subject: [PATCH 29/30] virtio_net: Use xdp_return_frame to free xdp_frames on destroying vqs

From: Toshiaki Makita <[email-masked]>
Date: Tue, 29 Jan 2019 09:45:58 +0900

[ Upstream commit 07b344f494ddda9f061b396407c96df8c46c82b5 ]

put_page() can work as a fallback for freeing xdp_frames, but the
appropriate way is to use xdp_return_frame().

Fixes: cac320c850ef ("virtio_net: convert to use generic xdp_frame and xdp_return_frame API")
Signed-off-by: Toshiaki Makita <[email-masked]>
Acked-by: Jason Wang <[email-masked]>
Acked-by: Jesper Dangaard Brouer <[email-masked]>
Acked-by: Michael S. Tsirkin <[email-masked]>
Signed-off-by: David S. Miller <[email-masked]>
---
 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 188041447d19..7f97b24baaee 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -2593,7 +2593,7 @@ static void free_unused_bufs(struct virtnet_info *vi)
 			if (!is_xdp_raw_buffer_queue(vi, i))
 				dev_kfree_skb(buf);
 			else
-				put_page(virt_to_head_page(buf));
+				xdp_return_frame(buf);
 		}
 	}
 
-- 
2.20.1