[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20221207145428.31544-12-gautam.dawar@amd.com>
Date: Wed, 7 Dec 2022 20:24:27 +0530
From: Gautam Dawar <gautam.dawar@....com>
To: <linux-net-drivers@....com>, <netdev@...r.kernel.org>,
<jasowang@...hat.com>, <eperezma@...hat.com>
CC: <tanuj.kamde@....com>, <Koushik.Dutta@....com>,
<harpreet.anand@....com>, Gautam Dawar <gautam.dawar@....com>,
Edward Cree <ecree.xilinx@...il.com>,
Martin Habets <habetsm.xilinx@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, <linux-kernel@...r.kernel.org>
Subject: [PATCH net-next 11/11] sfc: register the vDPA device
Register the vDPA device which results in adding the device
to the vDPA bus which will be probed by either of the vDPA
bus drivers: virtio_vdpa or vhost_vdpa.
Signed-off-by: Gautam Dawar <gautam.dawar@....com>
---
drivers/net/ethernet/sfc/ef100_vdpa.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/sfc/ef100_vdpa.c b/drivers/net/ethernet/sfc/ef100_vdpa.c
index 16681d164fd1..ed59974c9633 100644
--- a/drivers/net/ethernet/sfc/ef100_vdpa.c
+++ b/drivers/net/ethernet/sfc/ef100_vdpa.c
@@ -231,9 +231,7 @@ static void ef100_vdpa_delete(struct efx_nic *efx)
if (efx->vdpa_nic) {
vdpa_dev = &efx->vdpa_nic->vdpa_dev;
ef100_vdpa_reset(vdpa_dev);
-
- /* replace with _vdpa_unregister_device later */
- put_device(&vdpa_dev->dev);
+ _vdpa_unregister_device(&efx->vdpa_nic->vdpa_dev);
efx->vdpa_nic = NULL;
}
efx_mcdi_free_vis(efx);
@@ -535,7 +533,14 @@ static struct ef100_vdpa_nic *ef100_vdpa_create(struct efx_nic *efx,
if (rc)
goto err_put_device;
- /* _vdpa_register_device when its ready */
+ rc = _vdpa_register_device(&vdpa_nic->vdpa_dev,
+ (allocated_vis - 1) * 2);
+ if (rc) {
+ pci_err(efx->pci_dev,
+ "vDPA device registration failed, vf: %u, rc: %d\n",
+ nic_data->vf_index, rc);
+ goto err_put_device;
+ }
return vdpa_nic;
--
2.30.1
Powered by blists - more mailing lists