On 11/3/2023 4:50 PM, Shubham Rohila wrote:
From: Nikhil Agarwal <nikhil.agar...@amd.com>

Update the cleanup routine for cdx device to support
device without MSI. Also, set vfio_dev_fd for such devices
This fd can be used for BME reload operations.

Signed-off-by: Nikhil Agarwal <nikhil.agar...@amd.com>
Signed-off-by: Shubham Rohila <shubham.roh...@amd.com>
---
  v2
  - New patch in the series
  drivers/bus/cdx/cdx.c      |  2 +-
  drivers/bus/cdx/cdx_vfio.c | 19 +++++++++----------
  2 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/drivers/bus/cdx/cdx.c b/drivers/bus/cdx/cdx.c
index 541aae76c3..62b108e082 100644
--- a/drivers/bus/cdx/cdx.c
+++ b/drivers/bus/cdx/cdx.c
@@ -405,9 +405,9 @@ cdx_probe_one_driver(struct rte_cdx_driver *dr,
        return ret;
error_probe:
+       cdx_vfio_unmap_resource(dev);
        rte_intr_instance_free(dev->intr_handle);
        dev->intr_handle = NULL;
-       cdx_vfio_unmap_resource(dev);
  error_map_device:
        return ret;
  }
diff --git a/drivers/bus/cdx/cdx_vfio.c b/drivers/bus/cdx/cdx_vfio.c
index 8a3ac0b995..8cac79782e 100644
--- a/drivers/bus/cdx/cdx_vfio.c
+++ b/drivers/bus/cdx/cdx_vfio.c
@@ -101,13 +101,12 @@ cdx_vfio_unmap_resource_primary(struct rte_cdx_device 
*dev)
        struct mapped_cdx_res_list *vfio_res_list;
        int ret, vfio_dev_fd;
- if (rte_intr_fd_get(dev->intr_handle) < 0)
-               return -1;

Why is this check removed? If VFIO fd is not there we may not proceed with other VFIO cleanup?

Reply via email to