vDPA/ifcvf: get_max_vq_size to return max size
authorZhu Lingshan <lingshan.zhu@intel.com>
Fri, 2 Feb 2024 16:39:04 +0000 (00:39 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 19 Mar 2024 06:45:50 +0000 (02:45 -0400)
Since we already implemented vdpa_config_ops.get_vq_size,
so get_max_vq_size can return the acutal max size of the
virtqueues other than the max allowed safe size.

Signed-off-by: Zhu Lingshan <lingshan.zhu@intel.com>
Message-Id: <20240202163905.8834-10-lingshan.zhu@intel.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/vdpa/ifcvf/ifcvf_base.c

index d78621fdd6210da115aaf8dfc9df1fad9905e032..472daa588a9d214aa1518530255afdc9a1919e1f 100644 (file)
@@ -82,10 +82,6 @@ u16 ifcvf_get_vq_size(struct ifcvf_hw *hw, u16 qid)
        return queue_size;
 }
 
-/* This function returns the max allowed safe size for
- * all virtqueues. It is the minimal size that can be
- * suppprted by all virtqueues.
- */
 u16 ifcvf_get_max_vq_size(struct ifcvf_hw *hw)
 {
        u16 queue_size, max_size, qid;
@@ -97,7 +93,7 @@ u16 ifcvf_get_max_vq_size(struct ifcvf_hw *hw)
                if (!queue_size)
                        continue;
 
-               max_size = min(queue_size, max_size);
+               max_size = max(queue_size, max_size);
        }
 
        return max_size;