lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <MN0PR21MB3264DD5A4F35B5A579D43966CEDCA@MN0PR21MB3264.namprd21.prod.outlook.com>
Date:   Fri, 27 Oct 2023 21:59:42 +0000
From:   Long Li <longli@...rosoft.com>
To:     Jason Gunthorpe <jgg@...pe.ca>,
        "sharmaajay@...uxonhyperv.com" <sharmaajay@...uxonhyperv.com>
CC:     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-rdma@...r.kernel.org>,
        "linux-hyperv@...r.kernel.org" <linux-hyperv@...r.kernel.org>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "linux-kernel@...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

> 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?

I think we want to register with the management interface before calling ib_register_device(). Because we need to communicate with PF to respond to query_device().

But the order in mana_ib_remove() is wrong, the call to mana_gd_deregister_device() should be moved after calling ib_unregister_device().

Thanks,

Long

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ