net/ice/base: introduce and use for each bit iterator
[dpdk.git] / drivers / raw / octeontx2_dma / otx2_dpi_rawdev.c
index 6ce218e..5b49644 100644 (file)
@@ -294,7 +294,8 @@ otx2_dpi_rawdev_reset(struct rte_rawdev *dev)
 }
 
 static int
-otx2_dpi_rawdev_configure(const struct rte_rawdev *dev, rte_rawdev_obj_t config)
+otx2_dpi_rawdev_configure(const struct rte_rawdev *dev, rte_rawdev_obj_t config,
+               size_t config_size)
 {
        struct dpi_rawdev_conf_s *conf = config;
        struct dpi_vf_s *dpivf = NULL;
@@ -302,8 +303,8 @@ otx2_dpi_rawdev_configure(const struct rte_rawdev *dev, rte_rawdev_obj_t config)
        uintptr_t pool;
        uint32_t gaura;
 
-       if (conf == NULL) {
-               otx2_dpi_dbg("NULL configuration");
+       if (conf == NULL || config_size != sizeof(*conf)) {
+               otx2_dpi_dbg("NULL or invalid configuration");
                return -EINVAL;
        }
        dpivf = (struct dpi_vf_s *)dev->dev_private;
@@ -338,6 +339,7 @@ static const struct rte_rawdev_ops dpi_rawdev_ops = {
        .dev_reset = otx2_dpi_rawdev_reset,
        .enqueue_bufs = otx2_dpi_rawdev_enqueue_bufs,
        .dequeue_bufs = otx2_dpi_rawdev_dequeue_bufs,
+       .dev_selftest = test_otx2_dma_rawdev,
 };
 
 static int
@@ -426,7 +428,7 @@ otx2_dpi_rawdev_remove(struct rte_pci_device *pci_dev)
 
 static struct rte_pci_driver rte_dpi_rawdev_pmd = {
        .id_table  = pci_dma_map,
-       .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_IOVA_AS_VA,
+       .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_NEED_IOVA_AS_VA,
        .probe     = otx2_dpi_rawdev_probe,
        .remove    = otx2_dpi_rawdev_remove,
 };