virtio_net: add checking sq is full inside xdp xmit
authorXuan Zhuo <xuanzhuo@linux.alibaba.com>
Wed, 8 Mar 2023 02:49:35 +0000 (10:49 +0800)
committerJakub Kicinski <kuba@kernel.org>
Sat, 11 Mar 2023 00:46:00 +0000 (16:46 -0800)
commitcd1c604aa1d8c641f5edcb58b76352d4eba06ec1
tree7288fb6d9584cff253016ec6dc44cfc04048e0a0
parentb8ef4809bc7faa22e63de921ef56de21ed191af0
virtio_net: add checking sq is full inside xdp xmit

If the queue of xdp xmit is not an independent queue, then when the xdp
xmit used all the desc, the xmit from the __dev_queue_xmit() may encounter
the following error.

net ens4: Unexpected TXQ (0) queue failure: -28

This patch adds a check whether sq is full in xdp xmit.

Fixes: 56434a01b12e ("virtio_net: add XDP_TX support")
Reported-by: Yichun Zhang <yichun@openresty.com>
Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Reviewed-by: Alexander Duyck <alexanderduyck@fb.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/virtio_net.c