On 11/18/2018 11:13 PM, Parav Pandit wrote:
Hi Dennis,
-----Original Message-----
From: linux-rdma-owner@xxxxxxxxxxxxxxx <linux-rdma-
owner@xxxxxxxxxxxxxxx> On Behalf Of Dennis Dalessandro
Sent: Sunday, November 18, 2018 9:56 PM
To: Leon Romanovsky <leon@xxxxxxxxxx>; Jason Gunthorpe
<jgg@xxxxxxxxxxxx>; Doug Ledford <dledford@xxxxxxxxxx>; Mike
Marciniszyn <mike.marciniszyn@xxxxxxxxx>; Selvin Xavier
<selvin.xavier@xxxxxxxxxxxx>; Devesh Sharma
<devesh.sharma@xxxxxxxxxxxx>
Cc: RDMA mailing list <linux-rdma@xxxxxxxxxxxxxxx>
Subject: Re: Rename of debugfs entries
On 11/18/2018 9:29 AM, Leon Romanovsky wrote:
Hi,
I want to clarify why IB device rename functionality didn't change
debugfs and would like to ask what to do next.
In drivers/infiniband/hw/*, we have 6 devices which are calling to
debugfs_create_dir() in order to create debugfs root.
The output is located in /sys/kernel/debug/.
Such folders are created during driver module load and some of the
drivers creates subfolders for every device initialized, during device probe.
1. PCI-based connection
MLX5 and cxgb4 drivers separate the different device by their PCIs.
[leonro@server ~]$ sudo ls /sys/kernel/debug/mlx5/
0000:00:0c.0
2. Based on IB device name
HFI1, ocrdma and qib create subfolders with device index embedded in
it, like hfi1_0,...,hfi1_N
3. No-separation between devices
USNIC like this.
So device rename works seamlessly for type #1 and #3. Wile for type
#2, the debugfs entries don't change.
Right now, I see three options:
1. Do nothing.
2. Convert type #2 drivers to be type #1.
3. Add callback/extra implementation in IB/core to support one live
driver (hfi1) and two frozen ones.
It's certainly not accurate to call qib frozen. We may not plan on any new
features but we do intend to keep it live and provide fixes should the need
arise.
I think the type #2 is much more user friendly than putting in the PCI-ID so
why not convert type #1 to be type #2?
Now that being said I would imagine we could go with either approach and
leave it up to the administrator to create a udev rule or something and make
symlinks to keep existing tools compatible. So I don't think we need to
support both. The question is which is better #1 or #2?
I think #1 is better because
(a) pci naming doesn't change with device renaming.
(b) In case of mlx5, debugfs is shared between NIC mlx5_core and mlx5_ib driver.
So doing #2 continue to suffer with nic device naming.
Also when debugfs is created in mlx5_core netdev is not even registered I think. So stable name doesn't exist for EQs, CQs etc debugfs entry.
This is the sort of explanation I was looking for, and should make it's
way into the commit message for such a change. The fact that debugfs is
created (or could be created) orthogonal to netdev registration means we
shouldn't tie them together.
I'm convinced this is the right thing to do. Let's go with the PCI-ID.
-Denny