search for: check_sq_full_and_disable

Displaying 6 results from an estimated 6 matches for "check_sq_full_and_disable".

2023 Mar 08
3
[PATCH net, stable v1 0/3] add checking sq is full inside xdp xmit
...e 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. Thanks. v1: 1. rename to check_sq_full_and_disable 2. reorder some funcs to avoid declaration Xuan Zhuo (3): virtio_net: reorder some funcs virtio_net: separate the logic of checking whether sq is full virtio_net: add checking sq is full inside xdp xmit drivers/net/virtio_net.c | 155 +++++++++++++++++++++------------------ 1 file chan...
2023 Mar 08
0
[PATCH net, stable v1 3/3] virtio_net: add checking sq is full inside xdp xmit
...; >>> +++ b/drivers/net/virtio_net.c > >>> @@ -767,6 +767,9 @@ static int virtnet_xdp_xmit(struct net_device *dev, > >>> } > >>> ret = nxmit; > >>> > >>> + if (!is_xdp_raw_buffer_queue(vi, sq - vi->sq)) > >>> + check_sq_full_and_disable(vi, dev, sq); > >>> + > >> > >> Sorry if I missed something obvious here. > >> > >> As the comment in start_xmit(), the current skb is added to the sq->vq, so > >> NETDEV_TX_BUSY can not be returned. > >> > >> /* If runn...
2023 Apr 30
1
[RFC PATCH net 2/3] virtio-net: allow usage of vrings smaller than MAX_SKB_FRAGS + 2
...(unlikely(len > MAX_SKB_FRAGS * PAGE_SIZE)) { + if (unlikely(vi->svring)) + max_frags = 1; + + if (unlikely(len > max_frags * PAGE_SIZE)) { net_dbg_ratelimited("%s: too much data\n", skb->dev->name); dev_kfree_skb(skb); return NULL; @@ -612,7 +624,7 @@ static void check_sq_full_and_disable(struct virtnet_info *vi, * Since most packets only take 1 or 2 ring slots, stopping the queue * early means 16 slots are typically wasted. */ - if (sq->vq->num_free < 2+MAX_SKB_FRAGS) { + if (sq->vq->num_free < vi->single_pkt_max_descs) { netif_stop_subqueue(dev, qn...
2023 Apr 30
1
[RFC PATCH net 2/3] virtio-net: allow usage of vrings smaller than MAX_SKB_FRAGS + 2
...SIZE)) { > + if (unlikely(vi->svring)) > + max_frags = 1; > + > + if (unlikely(len > max_frags * PAGE_SIZE)) { > net_dbg_ratelimited("%s: too much data\n", skb->dev->name); > dev_kfree_skb(skb); > return NULL; > @@ -612,7 +624,7 @@ static void check_sq_full_and_disable(struct virtnet_info *vi, > * Since most packets only take 1 or 2 ring slots, stopping the queue > * early means 16 slots are typically wasted. > */ > - if (sq->vq->num_free < 2+MAX_SKB_FRAGS) { > + if (sq->vq->num_free < vi->single_pkt_max_descs) { >...
2023 Mar 07
2
[PATCH net 0/2] add checking sq is full inside xdp xmit
Hi, On Tue, 2023-03-07 at 09:49 +0800, Xuan Zhuo wrote: > On Mon, 6 Mar 2023 12:58:22 -0500, "Michael S. Tsirkin" <mst at redhat.com> wrote: > > On Mon, Mar 06, 2023 at 12:15:33PM +0800, Xuan Zhuo wrote: > > > 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
2023 Apr 30
5
[RFC PATCH net 0/3] virtio-net: allow usage of small vrings
At the moment, if a virtio network device uses vrings with less than MAX_SKB_FRAGS + 2 entries, the device won't be functional. The following condition vq->num_free >= 2 + MAX_SKB_FRAGS will always evaluate to false, leading to TX timeouts. This patchset attempts this fix this bug, and to allow small rings down to 4 entries. The first patch introduces a new mechanism in virtio core -