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: <20241030121258.GB17187@unreal>
Date: Wed, 30 Oct 2024 14:12:58 +0200
From: Leon Romanovsky <leon@...nel.org>
To: Junxian Huang <huangjunxian6@...ilicon.com>
Cc: jgg@...pe.ca, linux-rdma@...r.kernel.org, linuxarm@...wei.com,
	linux-kernel@...r.kernel.org, tangchengchang@...wei.com
Subject: Re: [PATCH v2 for-rc 3/5] RDMA/hns: Modify debugfs name

On Thu, Oct 24, 2024 at 08:39:58PM +0800, Junxian Huang wrote:
> From: Yuyu Li <liyuyu6@...wei.com>
> 
> The sub-directory of hns_roce debugfs is named after the device's
> kernel name currently, but it will be inconvenient to use when
> the device is renamed.
> 
> Modify the name to pci name as users can always easily find the
> correspondence between an RDMA device and its pci name.
> 
> Fixes: eb7854d63db5 ("RDMA/hns: Support SW stats with debugfs")
> Signed-off-by: Yuyu Li <liyuyu6@...wei.com>
> Signed-off-by: Junxian Huang <huangjunxian6@...ilicon.com>
> ---
>  drivers/infiniband/hw/hns/hns_roce_debugfs.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/infiniband/hw/hns/hns_roce_debugfs.c b/drivers/infiniband/hw/hns/hns_roce_debugfs.c
> index e8febb40f645..b869cdc54118 100644
> --- a/drivers/infiniband/hw/hns/hns_roce_debugfs.c
> +++ b/drivers/infiniband/hw/hns/hns_roce_debugfs.c
> @@ -5,6 +5,7 @@
>  
>  #include <linux/debugfs.h>
>  #include <linux/device.h>
> +#include <linux/pci.h>
>  
>  #include "hns_roce_device.h"
>  
> @@ -86,7 +87,7 @@ void hns_roce_register_debugfs(struct hns_roce_dev *hr_dev)
>  {
>  	struct hns_roce_dev_debugfs *dbgfs = &hr_dev->dbgfs;
>  
> -	dbgfs->root = debugfs_create_dir(dev_name(&hr_dev->ib_dev.dev),
> +	dbgfs->root = debugfs_create_dir(pci_name(hr_dev->pci_dev),
>  					 hns_roce_dbgfs_root);

Let's take this change, but the more correct way is to add .rename()
callback to ib_device ops in similar way to what we do in ib_client
and call to debugfs_rename() from there.

See ib_device_rename() implementation for "lient->rename(ibdev, client_data);" call.

Thanks

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ