virtio-net: Unlimit tx queue size if peer is vdpa
RFC PATCH 1/1 virtio-net: Unlimit tx queue size if peer is vdpa
The code used to limit the maximum size of tx queue for others backends than vhost_user since the introduction of configurable tx queue size in 9b02e1618cf2 ("virtio-net: enable configurable tx queue size").
As vhost_user, vhost_vdpa devices should deal with memory region crosses already, so let's use the full tx size.
Signed-off-by Eugenio Pérez <[email protected]>
--- hw/net/virtio-net.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
hw/net/virtio-net.c +8 -5
@@ -629,17 +629,20 @@ static int virtio_net_max_tx_queue_size(VirtIONet *n)NetClientState *peer = n->nic_conf.peers.ncs[0 ];/* -* Backends other than vhost-user don't support max queue size. +* Backends other than vhost-user or vhost-vdpa don't support max queue +* size. */ if (!peer) {return VIRTIO_NET_TX_QUEUE_DEFAULT_SIZE ; } -if (peer->info->type !=NET_CLIENT_DRIVER_VHOST_USER ) { +switch (peer->info->type) { +case NET_CLIENT_DRIVER_VHOST_USER : +case NET_CLIENT_DRIVER_VHOST_VDPA : +return VIRTQUEUE_MAX_SIZE ; +default :return VIRTIO_NET_TX_QUEUE_DEFAULT_SIZE ; - } - -return VIRTQUEUE_MAX_SIZE ; + }; }static int peer_attach (VirtIONet *n,int index)
Signature · 1 line
2.27.0
Quoted 8 lines · Eugenio Pérez
The code used to limit the maximum size of tx queue for others backends than
vhost_usersince the introduction of configurable tx queue size in9b02e1618cf2("virtio-net: enable configurable tx queue size").As
vhost_user,vhost_vdpadevices should deal with memory region crosses already, so let's use the full tx size.Signed-off-by Eugenio Pérez <[email protected]>
Acked-by Jason Wang <[email protected]>
Quoted 34 lines
--- hw/net/virtio-net.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)hw/net/virtio-net.c +8
-5@@ -629,17 +629,20 @@ static int virtio_net_max_tx_queue_size(VirtIONet *n)NetClientState *peer = n->nic_conf.peers.ncs[0 ];/* -* Backends other than vhost-user don't support max queue size. +* Backends other than vhost-user or vhost-vdpa don't support max queue +* size. */ if (!peer) {return VIRTIO_NET_TX_QUEUE_DEFAULT_SIZE ; } -if (peer->info->type !=NET_CLIENT_DRIVER_VHOST_USER ) { +switch (peer->info->type) { +case NET_CLIENT_DRIVER_VHOST_USER : +case NET_CLIENT_DRIVER_VHOST_VDPA : +return VIRTQUEUE_MAX_SIZE ; +default :return VIRTIO_NET_TX_QUEUE_DEFAULT_SIZE ; - } - -return VIRTQUEUE_MAX_SIZE ; + }; }static int peer_attach (VirtIONet *n,int index)