All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] NTB: Add more than just the first NTB to debugfs
@ 2016-01-13 12:55 Allen Hubbe
  2016-01-18  3:20 ` Jon Mason
  0 siblings, 1 reply; 2+ messages in thread
From: Allen Hubbe @ 2016-01-13 12:55 UTC (permalink / raw)
  To: Dave Jiang; +Cc: linux-ntb, Allen Hubbe

Due to perf_debugfs_setup called only if the top level perf_debugfs_dir
was not created, only the first NTB would be added to debugfs.

Instead, call perf_debugfs_setup for every NTB.  Check that
perf_debugfs_dir exists in perf_debugfs_setup, and if necessary, create
it there.

Signed-off-by: Allen Hubbe <Allen.Hubbe@emc.com>
---

Dave, if you like, you can just fix up your patch with this.

 drivers/ntb/test/ntb_perf.c | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/drivers/ntb/test/ntb_perf.c b/drivers/ntb/test/ntb_perf.c
index dcf903584c43..5d60d59bd2d6 100644
--- a/drivers/ntb/test/ntb_perf.c
+++ b/drivers/ntb/test/ntb_perf.c
@@ -636,9 +636,16 @@ static int perf_debugfs_setup(struct perf_ctx *perf)
 {
 	struct pci_dev *pdev = perf->ntb->pdev;
 
-	if (!perf_debugfs_dir)
+	if (!debugfs_initialized())
 		return -ENODEV;
 
+	if (!perf_debugfs_dir) {
+		perf_debugfs_dir = debugfs_create_dir(KBUILD_MODNAME, NULL);
+
+		if (!perf_debugfs_dir)
+			return -ENODEV;
+	}
+
 	perf->debugfs_node_dir = debugfs_create_dir(pci_name(pdev),
 						    perf_debugfs_dir);
 	if (!perf->debugfs_node_dir)
@@ -691,15 +698,9 @@ static int perf_probe(struct ntb_client *client, struct ntb_dev *ntb)
 	ntb_link_enable(ntb, NTB_SPEED_AUTO, NTB_WIDTH_AUTO);
 	ntb_link_event(ntb);
 
-	if (debugfs_initialized() && !perf_debugfs_dir) {
-		perf_debugfs_dir = debugfs_create_dir(KBUILD_MODNAME, NULL);
-		if (!perf_debugfs_dir)
-			goto err_ctx;
-
-		rc = perf_debugfs_setup(perf);
-		if (rc)
-			goto err_ctx;
-	}
+	rc = perf_debugfs_setup(perf);
+	if (rc)
+		goto err_ctx;
 
 	return 0;
 
-- 
2.5.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] NTB: Add more than just the first NTB to debugfs
  2016-01-13 12:55 [PATCH] NTB: Add more than just the first NTB to debugfs Allen Hubbe
@ 2016-01-18  3:20 ` Jon Mason
  0 siblings, 0 replies; 2+ messages in thread
From: Jon Mason @ 2016-01-18  3:20 UTC (permalink / raw)
  To: Allen Hubbe; +Cc: Dave Jiang, linux-ntb

On Wed, Jan 13, 2016 at 07:55:30AM -0500, Allen Hubbe wrote:
> Due to perf_debugfs_setup called only if the top level perf_debugfs_dir
> was not created, only the first NTB would be added to debugfs.
> 
> Instead, call perf_debugfs_setup for every NTB.  Check that
> perf_debugfs_dir exists in perf_debugfs_setup, and if necessary, create
> it there.
> 
> Signed-off-by: Allen Hubbe <Allen.Hubbe@emc.com>

This was pulled into Dave's patch.  So, nothing to do here :)

Thanks,
Jon

> ---
> 
> Dave, if you like, you can just fix up your patch with this.
> 
>  drivers/ntb/test/ntb_perf.c | 21 +++++++++++----------
>  1 file changed, 11 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/ntb/test/ntb_perf.c b/drivers/ntb/test/ntb_perf.c
> index dcf903584c43..5d60d59bd2d6 100644
> --- a/drivers/ntb/test/ntb_perf.c
> +++ b/drivers/ntb/test/ntb_perf.c
> @@ -636,9 +636,16 @@ static int perf_debugfs_setup(struct perf_ctx *perf)
>  {
>  	struct pci_dev *pdev = perf->ntb->pdev;
>  
> -	if (!perf_debugfs_dir)
> +	if (!debugfs_initialized())
>  		return -ENODEV;
>  
> +	if (!perf_debugfs_dir) {
> +		perf_debugfs_dir = debugfs_create_dir(KBUILD_MODNAME, NULL);
> +
> +		if (!perf_debugfs_dir)
> +			return -ENODEV;
> +	}
> +
>  	perf->debugfs_node_dir = debugfs_create_dir(pci_name(pdev),
>  						    perf_debugfs_dir);
>  	if (!perf->debugfs_node_dir)
> @@ -691,15 +698,9 @@ static int perf_probe(struct ntb_client *client, struct ntb_dev *ntb)
>  	ntb_link_enable(ntb, NTB_SPEED_AUTO, NTB_WIDTH_AUTO);
>  	ntb_link_event(ntb);
>  
> -	if (debugfs_initialized() && !perf_debugfs_dir) {
> -		perf_debugfs_dir = debugfs_create_dir(KBUILD_MODNAME, NULL);
> -		if (!perf_debugfs_dir)
> -			goto err_ctx;
> -
> -		rc = perf_debugfs_setup(perf);
> -		if (rc)
> -			goto err_ctx;
> -	}
> +	rc = perf_debugfs_setup(perf);
> +	if (rc)
> +		goto err_ctx;
>  
>  	return 0;
>  
> -- 
> 2.5.3
> 
> -- 
> You received this message because you are subscribed to the Google Groups "linux-ntb" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to linux-ntb+unsubscribe@googlegroups.com.
> To post to this group, send email to linux-ntb@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/linux-ntb/2d02b2a1ea097008718489de404dfd939b560979.1452689594.git.Allen.Hubbe%40emc.com.
> For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-01-18  3:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-13 12:55 [PATCH] NTB: Add more than just the first NTB to debugfs Allen Hubbe
2016-01-18  3:20 ` Jon Mason

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.