From 99f85541a685df82265f18167e91c161c523ce50 Mon Sep 17 00:00:00 2001 From: Chris Horn Date: Mon, 30 Sep 2019 10:03:06 -0500 Subject: [PATCH] LU-12824 o2ib: Record rc in debug log on startup failure Since kiblnd_startup() return -ENETDOWN on failure, let's record the rc value for the failure case in the debug log. Cray-bug-id: LUS-7935 Test-Parameters: trivial Signed-off-by: Chris Horn Change-Id: Ied934642bc567b8d3f51293d7dd095d47ff134df Reviewed-on: https://review.whamcloud.com/36325 Tested-by: jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: Oleg Drokin --- lnet/klnds/o2iblnd/o2iblnd.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lnet/klnds/o2iblnd/o2iblnd.c b/lnet/klnds/o2iblnd/o2iblnd.c index 11a39f5..432c450 100644 --- a/lnet/klnds/o2iblnd/o2iblnd.c +++ b/lnet/klnds/o2iblnd/o2iblnd.c @@ -3192,10 +3192,10 @@ static int kiblnd_dev_start_threads(struct kib_dev *dev, u32 *cpts, int ncpts) 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; @@ -3210,8 +3210,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; @@ -3226,6 +3228,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; } @@ -3236,6 +3239,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; } @@ -3309,7 +3313,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; } -- 1.8.3.1