Whamcloud - gitweb
LU-12824 o2ib: Record rc in debug log on startup failure 47/36547/2
authorChris Horn <hornc@cray.com>
Mon, 30 Sep 2019 15:03:06 +0000 (10:03 -0500)
committerOleg Drokin <green@whamcloud.com>
Thu, 21 Nov 2019 07:34:26 +0000 (07:34 +0000)
Since kiblnd_startup() return -ENETDOWN on failure, let's record the
rc value for the failure case in the debug log.

Lustre-change: https://review.whamcloud.com/36325
Lustre-commit: 99f85541a685df82265f18167e91c161c523ce50

Cray-bug-id: LUS-7935
Test-Parameters: trivial
Signed-off-by: Chris Horn <hornc@cray.com>
Change-Id: Ied934642bc567b8d3f51293d7dd095d47ff134df
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Minh Diep <mdiep@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/36547
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lnet/klnds/o2iblnd/o2iblnd.c

index 469fe60..cdfcf80 100644 (file)
@@ -3226,10 +3226,10 @@ kiblnd_dev_search(char *ifname)
 static int
 kiblnd_startup(struct lnet_ni *ni)
 {
-       char *ifname;
+       char *ifname = NULL;
        struct lnet_inetdev *ifaces = NULL;
        struct kib_dev *ibdev = NULL;
-       struct kib_net *net;
+       struct kib_net *net = NULL;
        unsigned long flags;
        int rc;
        int i;
@@ -3245,8 +3245,10 @@ kiblnd_startup(struct lnet_ni *ni)
 
        LIBCFS_ALLOC(net, sizeof(*net));
        ni->ni_data = net;
-       if (net == NULL)
+       if (net == NULL) {
+               rc = -ENOMEM;
                goto failed;
+       }
 
        net->ibn_incarnation = ktime_get_real_ns() / NSEC_PER_USEC;
 
@@ -3261,6 +3263,7 @@ kiblnd_startup(struct lnet_ni *ni)
                /* Use the IPoIB interface specified in 'networks=' */
                if (ni->ni_interfaces[1] != NULL) {
                        CERROR("ko2iblnd: Multiple interfaces not supported\n");
+                       rc = -EINVAL;
                        goto failed;
                }
 
@@ -3271,6 +3274,7 @@ kiblnd_startup(struct lnet_ni *ni)
 
        if (strlen(ifname) >= sizeof(ibdev->ibd_ifname)) {
                CERROR("IPoIB interface name too long: %s\n", ifname);
+               rc = -E2BIG;
                goto failed;
        }
 
@@ -3349,7 +3353,9 @@ failed:
        kfree(ifaces);
        kiblnd_shutdown(ni);
 
-       CDEBUG(D_NET, "kiblnd_startup failed\n");
+       CDEBUG(D_NET, "Configuration of device %s failed: rc = %d\n",
+              ifname ? ifname : "", rc);
+
        return -ENETDOWN;
 }