[v3,02/25] raw/ioat: fix missing close function

Message ID 20200925110910.284098-3-bruce.richardson@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series raw/ioat: enhancements and new hardware support |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Bruce Richardson Sept. 25, 2020, 11:08 a.m. UTC
  From: Kevin Laatz <kevin.laatz@intel.com>

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>
---
 drivers/raw/ioat/ioat_rawdev.c | 7 +++++++
 1 file changed, 7 insertions(+)
  

Comments

Bruce Richardson Sept. 25, 2020, 11:12 a.m. UTC | #1
On Fri, Sep 25, 2020 at 12:08:47PM +0100, Bruce Richardson wrote:
> From: Kevin Laatz <kevin.laatz@intel.com>
> 
> 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>
> ---
Forgot to add my own reviewed-by to this:

Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
  
Sunil Pai G Sept. 25, 2020, 11:12 a.m. UTC | #2
> -----Original Message-----
> From: Richardson, Bruce <bruce.richardson@intel.com>
> Sent: Friday, September 25, 2020 4:39 PM
> To: dev@dpdk.org
> Cc: Fu, Patrick <patrick.fu@intel.com>; Laatz, Kevin <kevin.laatz@intel.com>;
> stable@dpdk.org; Pai G, Sunil <sunil.pai.g@intel.com>
> Subject: [PATCH v3 02/25] raw/ioat: fix missing close function
> 
> From: Kevin Laatz <kevin.laatz@intel.com>
> 
> 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>
> ---
>  drivers/raw/ioat/ioat_rawdev.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/raw/ioat/ioat_rawdev.c b/drivers/raw/ioat/ioat_rawdev.c
> index 7f1a15436..0732b059f 100644
> --- a/drivers/raw/ioat/ioat_rawdev.c
> +++ b/drivers/raw/ioat/ioat_rawdev.c
> @@ -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,
> --
> 2.25.1
Acked-by: Sunil Pai G <sunil.pai.g@intel.com>
  

Patch

diff --git a/drivers/raw/ioat/ioat_rawdev.c b/drivers/raw/ioat/ioat_rawdev.c
index 7f1a15436..0732b059f 100644
--- a/drivers/raw/ioat/ioat_rawdev.c
+++ b/drivers/raw/ioat/ioat_rawdev.c
@@ -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,