All of lore.kernel.org
 help / color / mirror / Atom feed
From: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Jeff Squyres <jsquyres-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v3] libibverbs init.c: conditionally emit warning if no userspace driver found
Date: Thu, 30 Jul 2015 12:47:18 -0400	[thread overview]
Message-ID: <55BA5516.7040206@redhat.com> (raw)
In-Reply-To: <1431440068-19037-1-git-send-email-jsquyres-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 2224 bytes --]

On 05/12/2015 10:14 AM, Jeff Squyres wrote:
> It's not a warning or an error if libibverbs cannot find a userspace
> driver for kernel devices.  Indeed, returning a num_devices of is
> sufficient -- the middleware shouldn't be unconditionally printing out
> stderr message; let the upper layer application do that (if it wants
> to).
> 
> For debugging purposes, if the environment variable IBV_SHOW_WARNINGS
> is set (to any value), warnings will be emitted to stderr if a
> corresponding userspace driver cannot be found for a kernel device.
> 
> Signed-off-by: Jeff Squyres <jsquyres-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
> ---
>  man/ibv_get_device_list.3 | 6 ++++++
>  src/init.c                | 2 +-
>  2 files changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/man/ibv_get_device_list.3 b/man/ibv_get_device_list.3
> index 16cc1a0..96de554 100644
> --- a/man/ibv_get_device_list.3
> +++ b/man/ibv_get_device_list.3
> @@ -50,6 +50,12 @@ Client code should open all the devices it intends to use with
>  Once it frees the array with
>  .B ibv_free_device_list()\fR,
>  it will be able to use only the open devices; pointers to unopened devices will no longer be valid.
> +.P
> +Setting the environment variable
> +.BR IBV_SHOW_WARNINGS
> +will cause warnings to be emitted to stderr if a kernel verbs device
> +is discovered, but no corresponding userspace driver can be found for
> +it.
>  .SH "SEE ALSO"
>  .BR ibv_fork_init (3),
>  .BR ibv_get_device_name (3),
> diff --git a/src/init.c b/src/init.c
> index d0e4b1c..dbdd795 100644
> --- a/src/init.c
> +++ b/src/init.c
> @@ -561,7 +561,7 @@ out:
>  		     next_dev = sysfs_dev ? sysfs_dev->next : NULL;
>  	     sysfs_dev;
>  	     sysfs_dev = next_dev, next_dev = sysfs_dev ? sysfs_dev->next : NULL) {
> -		if (!sysfs_dev->have_driver) {
> +		if (!sysfs_dev->have_driver && getenv("IBV_SHOW_WARNINGS")) {
>  			fprintf(stderr, PFX "Warning: no userspace device-specific "
>  				"driver found for %s\n", sysfs_dev->sysfs_path);
>  			if (statically_linked)
> 

This has been applied, thanks.

-- 
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
              GPG KeyID: 0E572FDD



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]

      parent reply	other threads:[~2015-07-30 16:47 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-12 14:14 [PATCH v3] libibverbs init.c: conditionally emit warning if no userspace driver found Jeff Squyres
     [not found] ` <1431440068-19037-1-git-send-email-jsquyres-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2015-05-19 14:11   ` Jeff Squyres (jsquyres)
     [not found]     ` <BED0001D-0051-4ACD-8506-8FA07E625694-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2015-05-19 14:14       ` Yann Droneaud
     [not found]         ` <1432044878.5304.1.camel-RlY5vtjFyJ3QT0dZR+AlfA@public.gmane.org>
2015-05-19 15:36           ` Doug Ledford
     [not found]             ` <1432049804.3114.41.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-05-20 14:48               ` Yann Droneaud
     [not found]                 ` <1432133301.5304.10.camel-RlY5vtjFyJ3QT0dZR+AlfA@public.gmane.org>
2015-05-20 16:27                   ` Doug Ledford
     [not found]                     ` <1432139226.3114.83.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-05-20 16:39                       ` Hefty, Sean
     [not found]                         ` <1828884A29C6694DAF28B7E6B8A82373A8FDD9BC-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-05-20 17:11                           ` Doug Ledford
     [not found]                             ` <1432141870.3114.89.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-05-22 13:58                               ` Jeff Squyres (jsquyres)
     [not found]                                 ` <B397943B-9919-47CC-94E9-98A2A0BEFE8F-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2015-05-22 14:44                                   ` Doug Ledford
     [not found]                                     ` <1432305861.28905.83.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-06-01 22:02                                       ` Jeff Squyres (jsquyres)
     [not found]                                         ` <22F52D8B-92CB-47B2-8A9A-DD20B36C3305-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2015-06-03 16:50                                           ` Doug Ledford
     [not found]                                             ` <1433350209.40123.55.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-06-16 14:25                                               ` Jeff Squyres (jsquyres)
     [not found]                                                 ` <0FB46382-3793-4056-BB40-8FFBA67ACF85-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2015-06-17 14:25                                                   ` Doug Ledford
     [not found]                                                     ` <CA0ED4EA-C64E-47F2-9B6B-5B995BECA77D-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-07-06 13:35                                                       ` Jeff Squyres (jsquyres)
     [not found]                                                         ` <F9B48EF8-8760-45A0-8322-CE4FC859D5B6-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2015-07-06 16:51                                                           ` Doug Ledford
2015-07-30 16:47   ` Doug Ledford [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55BA5516.7040206@redhat.com \
    --to=dledford-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=jsquyres-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.