raw/ioat: add info query for idxd device
authorBruce Richardson <bruce.richardson@intel.com>
Thu, 8 Oct 2020 09:51:28 +0000 (10:51 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 8 Oct 2020 12:33:20 +0000 (14:33 +0200)
Add the info get function for DSA devices, returning just the ring size
info about the device, same as is returned for existing IOAT/CBDMA devices.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
drivers/raw/ioat/idxd_pci.c
drivers/raw/ioat/idxd_vdev.c
drivers/raw/ioat/ioat_common.c
drivers/raw/ioat/ioat_private.h

index 6b5c473..bf5edcf 100644 (file)
@@ -106,6 +106,7 @@ static const struct rte_rawdev_ops idxd_pci_ops = {
                .dev_configure = idxd_dev_configure,
                .dev_start = idxd_pci_dev_start,
                .dev_stop = idxd_pci_dev_stop,
+               .dev_info_get = idxd_dev_info_get,
 };
 
 /* each portal uses 4 x 4k pages */
index 3dad147..c75ac43 100644 (file)
@@ -35,6 +35,7 @@ static const struct rte_rawdev_ops idxd_vdev_ops = {
                .dev_selftest = idxd_rawdev_test,
                .dump = idxd_dev_dump,
                .dev_configure = idxd_dev_configure,
+               .dev_info_get = idxd_dev_info_get,
 };
 
 static void *
index 6a4e297..b5cea2f 100644 (file)
@@ -44,6 +44,24 @@ idxd_dev_dump(struct rte_rawdev *dev, FILE *f)
        return 0;
 }
 
+int
+idxd_dev_info_get(struct rte_rawdev *dev, rte_rawdev_obj_t dev_info,
+               size_t info_size)
+{
+       struct rte_ioat_rawdev_config *cfg = dev_info;
+       struct idxd_rawdev *idxd = dev->dev_private;
+       struct rte_idxd_rawdev *rte_idxd = &idxd->public;
+
+       if (info_size != sizeof(*cfg))
+               return -EINVAL;
+
+       if (cfg != NULL) {
+               cfg->ring_size = rte_idxd->hdl_ring_sz;
+               cfg->hdls_disable = rte_idxd->hdls_disable;
+       }
+       return 0;
+}
+
 int
 idxd_dev_configure(const struct rte_rawdev *dev,
                rte_rawdev_obj_t config, size_t config_size)
index aba70d8..0f80d60 100644 (file)
@@ -62,6 +62,9 @@ extern int idxd_rawdev_close(struct rte_rawdev *dev);
 extern int idxd_dev_configure(const struct rte_rawdev *dev,
                rte_rawdev_obj_t config, size_t config_size);
 
+extern int idxd_dev_info_get(struct rte_rawdev *dev, rte_rawdev_obj_t dev_info,
+               size_t info_size);
+
 extern int idxd_rawdev_test(uint16_t dev_id);
 
 extern int idxd_dev_dump(struct rte_rawdev *dev, FILE *f);