]> git.droids-corp.org - dpdk.git/commitdiff
vdpa/sfc: get max supported queue count
authorVijay Kumar Srivastava <vsrivast@xilinx.com>
Wed, 3 Nov 2021 13:57:48 +0000 (19:27 +0530)
committerMaxime Coquelin <maxime.coquelin@redhat.com>
Thu, 4 Nov 2021 12:59:56 +0000 (13:59 +0100)
Implement vDPA ops get_queue_num to get the maximum number
of queues supported by the device.

Signed-off-by: Vijay Kumar Srivastava <vsrivast@xilinx.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
drivers/vdpa/sfc/sfc_vdpa_ops.c

index 16afa5a06d45db0d5c05246308695203f2cf1143..63192cf45223d16656ca02d6715b4b34632bd422 100644 (file)
 static int
 sfc_vdpa_get_queue_num(struct rte_vdpa_device *vdpa_dev, uint32_t *queue_num)
 {
-       RTE_SET_USED(vdpa_dev);
-       RTE_SET_USED(queue_num);
+       struct sfc_vdpa_ops_data *ops_data;
+       void *dev;
 
-       return -1;
+       ops_data = sfc_vdpa_get_data_by_dev(vdpa_dev);
+       if (ops_data == NULL)
+               return -1;
+
+       dev = ops_data->dev_handle;
+       *queue_num = sfc_vdpa_adapter_by_dev_handle(dev)->max_queue_count;
+
+       sfc_vdpa_info(dev, "vDPA ops get_queue_num :: supported queue num : %u",
+                     *queue_num);
+
+       return 0;
 }
 
 static int