[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231023181918.GJ691768@ziepe.ca>
Date: Mon, 23 Oct 2023 15:19:18 -0300
From: Jason Gunthorpe <jgg@...pe.ca>
To: sharmaajay@...uxonhyperv.com
Cc: Long Li <longli@...rosoft.com>, Leon Romanovsky <leon@...nel.org>,
Dexuan Cui <decui@...rosoft.com>, Wei Liu <wei.liu@...nel.org>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, linux-rdma@...r.kernel.org,
linux-hyperv@...r.kernel.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org,
Ajay Sharma <sharmaajay@...rosoft.com>
Subject: Re: [Patch v7 2/5] RDMA/mana_ib: Register Mana IB device with
Management SW
On Mon, Oct 16, 2023 at 03:11:59PM -0700, sharmaajay@...uxonhyperv.com wrote:
> diff --git a/drivers/infiniband/hw/mana/device.c b/drivers/infiniband/hw/mana/device.c
> index 083f27246ba8..ea4c8c8fc10d 100644
> --- a/drivers/infiniband/hw/mana/device.c
> +++ b/drivers/infiniband/hw/mana/device.c
> @@ -78,22 +78,34 @@ static int mana_ib_probe(struct auxiliary_device *adev,
> mib_dev->ib_dev.num_comp_vectors = 1;
> mib_dev->ib_dev.dev.parent = mdev->gdma_context->dev;
>
> - ret = ib_register_device(&mib_dev->ib_dev, "mana_%d",
> - mdev->gdma_context->dev);
> + ret = mana_gd_register_device(&mib_dev->gc->mana_ib);
> if (ret) {
> - ib_dealloc_device(&mib_dev->ib_dev);
> - return ret;
> + ibdev_err(&mib_dev->ib_dev, "Failed to register device, ret %d",
> + ret);
> + goto free_ib_device;
> }
>
> + ret = ib_register_device(&mib_dev->ib_dev, "mana_%d",
> + mdev->gdma_context->dev);
> + if (ret)
> + goto deregister_device;
> +
> dev_set_drvdata(&adev->dev, mib_dev);
>
> return 0;
> +
> +deregister_device:
> + mana_gd_deregister_device(&mib_dev->gc->mana_ib);
> +free_ib_device:
> + ib_dealloc_device(&mib_dev->ib_dev);
> + return ret;
> }
>
> static void mana_ib_remove(struct auxiliary_device *adev)
> {
> struct mana_ib_dev *mib_dev = dev_get_drvdata(&adev->dev);
>
> + mana_gd_deregister_device(&mib_dev->gc->mana_ib);
> ib_unregister_device(&mib_dev->ib_dev);
> ib_dealloc_device(&mib_dev->ib_dev);
> }
That's definitely in the wrong order
Are you shure these things should just be part of
ops->enable_driver/dealloc_driver?
> diff --git a/drivers/infiniband/hw/mana/main.c b/drivers/infiniband/hw/mana/main.c
> index 189e774cdab6..2c4e3c496644 100644
> --- a/drivers/infiniband/hw/mana/main.c
> +++ b/drivers/infiniband/hw/mana/main.c
> @@ -8,7 +8,7 @@
> void mana_ib_uncfg_vport(struct mana_ib_dev *mib_dev, struct mana_ib_pd *pd,
> u32 port)
> {
> - struct gdma_dev *gd = mib_dev->gdma_dev;
> + struct gdma_dev *gd = &mib_dev->gc->mana;
What is this stuff doing in this patch? Make another patch if you want
to remove gdma_dev
Jason
Powered by blists - more mailing lists