linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] libibverbs init.c: conditionally emit warning if no userspace driver found
@ 2015-05-12 14:14 Jeff Squyres
       [not found] ` <1431440068-19037-1-git-send-email-jsquyres-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 17+ messages in thread
From: Jeff Squyres @ 2015-05-12 14:14 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: Jeff Squyres

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)
-- 
2.2.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2015-07-30 16:47 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).