diff options
author | Jason Wang <jasowang@redhat.com> | 2021-09-03 17:10:15 +0800 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2021-09-04 17:34:05 -0400 |
commit | 6a756d1495fc0a852b119f7ecbb7a20131f0aba7 (patch) | |
tree | 30b8653a6b4b81d6091c4b14c88055878346d72b /hw/net | |
parent | 5fc13603a6bec4451cf1062ae6bdb6a2ab81a69c (diff) |
vhost_net: do not assume nvqs is always 2
This patch switches to initialize dev.nvqs from the VhostNetOptions
instead of assuming it was 2. This is useful for implementing control
virtqueue support which will be a single vhost_net structure with a
single cvq.
Note that nvqs is still set to 2 for all users and this patch does not
change functionality.
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Eli Cohen <elic@nvidia.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Message-Id: <20210903091031.47303-6-jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/net')
-rw-r--r-- | hw/net/vhost_net.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c index 6ed0c39836..386ec2eaa2 100644 --- a/hw/net/vhost_net.c +++ b/hw/net/vhost_net.c @@ -165,9 +165,9 @@ struct vhost_net *vhost_net_init(VhostNetOptions *options) goto fail; } net->nc = options->net_backend; + net->dev.nvqs = options->nvqs; net->dev.max_queues = 1; - net->dev.nvqs = 2; net->dev.vqs = net->vqs; if (backend_kernel) { |