vdpa: conditionally fill max max queue pair for stats
authorJason Wang <jasowang@redhat.com>
Wed, 7 Sep 2022 06:01:10 +0000 (14:01 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 28 Dec 2022 10:28:11 +0000 (05:28 -0500)
commit1c96d5457f7251d1c62aacc04921557d56fc049a
treed96ffe56433ba7d219be12f83914a35dc0099686
parented843d6ed7310a27cf7c8ee0a82a482eed0cb4a6
vdpa: conditionally fill max max queue pair for stats

For the device without multiqueue feature, we will read 0 as
max_virtqueue_pairs from the config. So if we fill
VDPA_ATTR_DEV_NET_CFG_MAX_VQP with the value we read from the config
we will confuse the user.

Fixing this by only filling the value when multiqueue is offered by
the device so userspace can assume 1 when the attr is not provided.

Fixes: 13b00b135665c("vdpa: Add support for querying vendor statistics")
Cc: Eli Cohen <elic@nvidia.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Message-Id: <20220907060110.4511-1-jasowang@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Eli Cohen <elic@nvidia.com>
drivers/vdpa/vdpa.c