|
@@ -1898,8 +1898,12 @@ static void free_receive_page_frags(struct virtnet_info *vi)
|
|
|
put_page(vi->rq[i].alloc_frag.page);
|
|
|
}
|
|
|
|
|
|
-static bool is_xdp_queue(struct virtnet_info *vi, int q)
|
|
|
+static bool is_xdp_raw_buffer_queue(struct virtnet_info *vi, int q)
|
|
|
{
|
|
|
+ /* For small receive mode always use kfree_skb variants */
|
|
|
+ if (!vi->mergeable_rx_bufs)
|
|
|
+ return false;
|
|
|
+
|
|
|
if (q < (vi->curr_queue_pairs - vi->xdp_queue_pairs))
|
|
|
return false;
|
|
|
else if (q < vi->curr_queue_pairs)
|
|
@@ -1916,7 +1920,7 @@ static void free_unused_bufs(struct virtnet_info *vi)
|
|
|
for (i = 0; i < vi->max_queue_pairs; i++) {
|
|
|
struct virtqueue *vq = vi->sq[i].vq;
|
|
|
while ((buf = virtqueue_detach_unused_buf(vq)) != NULL) {
|
|
|
- if (!is_xdp_queue(vi, i))
|
|
|
+ if (!is_xdp_raw_buffer_queue(vi, i))
|
|
|
dev_kfree_skb(buf);
|
|
|
else
|
|
|
put_page(virt_to_head_page(buf));
|