Re: [PATCH rdma-next] RDMA/hfi1: Use PCI-ID as an identification in debugfs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Dec 13, 2018 at 09:54:34AM +0000, Ruhl, Michael J wrote:
> >From: linux-rdma-owner@xxxxxxxxxxxxxxx [mailto:linux-rdma-
> >owner@xxxxxxxxxxxxxxx] On Behalf Of Jason Gunthorpe
> >Sent: Wednesday, December 12, 2018 10:35 PM
> >To: Dalessandro, Dennis <dennis.dalessandro@xxxxxxxxx>
> >Cc: Leon Romanovsky <leon@xxxxxxxxxx>; Yuval Shaia
> ><yuval.shaia@xxxxxxxxxx>; Doug Ledford <dledford@xxxxxxxxxx>;
> >Marciniszyn, Mike <mike.marciniszyn@xxxxxxxxx>; RDMA mailing list <linux-
> >rdma@xxxxxxxxxxxxxxx>
> >Subject: Re: [PATCH rdma-next] RDMA/hfi1: Use PCI-ID as an identification in
> >debugfs
> >
> >On Wed, Dec 12, 2018 at 03:05:59PM -0500, Dennis Dalessandro wrote:
> >
> >> > Because it is not related to verbs at all, but general core
> >> > infrastructure change needed for all devices in RDMA subsystem,
> >> > which are using struct ib_device to hold data.
> >>
> >> Core, verbs, whatever. Point is that debugfs is still something different
> >> and doesn't have to be subject to the same naming scheme.
> >
> >You can use whatever names you like in debugfs, so long as they are
> >guaranteed to be globally unique.
> 
> I am not really sure what this means. 

It means the names of debugfs files hvae to be derived so they are
globally unique. A driver can't create a debugfs file name used by
another driver.

> How do I guarantee global uniqueness?

Use the PCI ID is what other drivers do.
 
> >Since rename, using the IB device name is no longer globally unique so
> >it cannot be used as the name in debugfs. You have to fix this..
> 
> Why and how does the name of the IB device name have any impact on a
> filename I have defined in debugfs?

hfi1 is passing the IB device name in as the directory name for
debugfs. IB devices names are not globally unique, so they cannot be
used in this way.

> If create new driver for card x and create a debugfs file my_file,
> and then someone renames an IB device to my_file, did I do something
> wrong?

It has nothing to do with IB. You did something wrong by having the
driver using a non-unique name 'my_file'. Two instances of this driver
will create 'my_file' and one will fail.

Jason




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux