virtio_net: set the default max ring size by find_vqs()
authorXuan Zhuo <xuanzhuo@linux.alibaba.com>
Mon, 1 Aug 2022 06:38:57 +0000 (14:38 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 11 Aug 2022 08:06:41 +0000 (04:06 -0400)
commit762faee5a2678559d3dc09d95f8f2c54cd0466a7
tree12ebcbc60dac1024a247552d6fd11fa1aaf933a7
parentfe3dc04e31aa51f91dc7f741a5f76cc4817eb5b4
virtio_net: set the default max ring size by find_vqs()

Use virtio_find_vqs_ctx_size() to specify the maximum ring size of tx,
rx at the same time.

                         | rx/tx ring size
-------------------------------------------
speed == UNKNOWN or < 10G| 1024
speed < 40G              | 4096
speed >= 40G             | 8192

Call virtnet_update_settings() once before calling init_vqs() to update
speed.

Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Message-Id: <20220801063902.129329-38-xuanzhuo@linux.alibaba.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/net/virtio_net.c