diff options
| author | Konstantin Taranov <[email protected]> | 2024-04-10 08:42:27 +0000 |
|---|---|---|
| committer | Leon Romanovsky <[email protected]> | 2024-04-16 11:28:26 +0000 |
| commit | 1a79c2b9d4a08788cf1554981f10d23fbad77d11 (patch) | |
| tree | dba29a2fffe2c6da1858d9fcb00e3156dfff9b4e /drivers/infiniband/hw/mana/device.c | |
| parent | RDMA/mana_ib: Add EQ creation for rnic adapter (diff) | |
| download | kernel-1a79c2b9d4a08788cf1554981f10d23fbad77d11.tar.gz kernel-1a79c2b9d4a08788cf1554981f10d23fbad77d11.zip | |
RDMA/mana_ib: Create and destroy rnic adapter
Add functions for RNIC creation and destruction.
If creation fails, the ib_probe fails as well.
Signed-off-by: Konstantin Taranov <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Leon Romanovsky <[email protected]>
Diffstat (limited to 'drivers/infiniband/hw/mana/device.c')
| -rw-r--r-- | drivers/infiniband/hw/mana/device.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/mana/device.c b/drivers/infiniband/hw/mana/device.c index 08fdd917d075..721e2ab8388f 100644 --- a/drivers/infiniband/hw/mana/device.c +++ b/drivers/infiniband/hw/mana/device.c @@ -98,15 +98,21 @@ static int mana_ib_probe(struct auxiliary_device *adev, goto deregister_device; } + ret = mana_ib_gd_create_rnic_adapter(dev); + if (ret) + goto destroy_eqs; + ret = ib_register_device(&dev->ib_dev, "mana_%d", mdev->gdma_context->dev); if (ret) - goto destroy_eqs; + goto destroy_rnic; dev_set_drvdata(&adev->dev, dev); return 0; +destroy_rnic: + mana_ib_gd_destroy_rnic_adapter(dev); destroy_eqs: mana_ib_destroy_eqs(dev); deregister_device: @@ -121,6 +127,7 @@ static void mana_ib_remove(struct auxiliary_device *adev) struct mana_ib_dev *dev = dev_get_drvdata(&adev->dev); ib_unregister_device(&dev->ib_dev); + mana_ib_gd_destroy_rnic_adapter(dev); mana_ib_destroy_eqs(dev); mana_gd_deregister_device(dev->gdma_dev); ib_dealloc_device(&dev->ib_dev); |
