raw/ioat: fix missing close function
authorKevin Laatz <kevin.laatz@intel.com>
Thu, 8 Oct 2020 09:51:10 +0000 (10:51 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 8 Oct 2020 12:33:20 +0000 (14:33 +0200)
When rte_rawdev_pmd_release() is called, rte_rawdev_close() looks for a
dev_close function for the device causing a segmentation fault when no
close() function is implemented for a driver.

This patch resolves the issue by adding a stub function ioat_dev_close().

Fixes: f687e842e328 ("raw/ioat: introduce IOAT driver")
Cc: stable@dpdk.org
Reported-by: Sunil Pai G <sunil.pai.g@intel.com>
Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Sunil Pai G <sunil.pai.g@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
drivers/raw/ioat/ioat_rawdev.c

index 7f1a154..0732b05 100644 (file)
@@ -203,6 +203,12 @@ ioat_xstats_reset(struct rte_rawdev *dev, const uint32_t *ids, uint32_t nb_ids)
        return 0;
 }
 
+static int
+ioat_dev_close(struct rte_rawdev *dev __rte_unused)
+{
+       return 0;
+}
+
 extern int ioat_rawdev_test(uint16_t dev_id);
 
 static int
@@ -212,6 +218,7 @@ ioat_rawdev_create(const char *name, struct rte_pci_device *dev)
                        .dev_configure = ioat_dev_configure,
                        .dev_start = ioat_dev_start,
                        .dev_stop = ioat_dev_stop,
+                       .dev_close = ioat_dev_close,
                        .dev_info_get = ioat_dev_info_get,
                        .xstats_get = ioat_xstats_get,
                        .xstats_get_names = ioat_xstats_get_names,