virtnet_sq_free_unused_buf() check xsk buffer. Signed-off-by: Xuan Zhuo <xuanzhuo@xxxxxxxxxxxxxxxxx> Acked-by: Jason Wang <jasowang@xxxxxxxxxx> --- drivers/net/virtio/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/virtio/main.c b/drivers/net/virtio/main.c index 6a5e74c482f3..6210a6e37396 100644 --- a/drivers/net/virtio/main.c +++ b/drivers/net/virtio/main.c @@ -3919,16 +3919,18 @@ void virtnet_sq_free_unused_buf(struct virtqueue *vq, void *buf) sq = &vi->sq[i]; - if (!virtnet_is_xdp_frame(buf)) { + if (virtnet_is_skb_ptr(buf)) { if (sq->do_dma) buf = virtnet_sq_unmap(sq, buf); dev_kfree_skb(buf); - } else { + } else if (virtnet_is_xdp_frame(buf)) { if (sq->do_dma) buf = virtnet_sq_unmap(sq, buf); xdp_return_frame(virtnet_ptr_to_xdp(buf)); + } else { + xsk_tx_completed(sq->xsk.pool, 1); } } -- 2.32.0.3.g01195cf9f _______________________________________________ Virtualization mailing list Virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx https://lists.linuxfoundation.org/mailman/listinfo/virtualization