Skip to contentSkip to conversation

cmpost.c: Handle ibv_get_device_list returning no IB devices in init()

PATCH In review Hal Rosenstock 3 participants 4 messages Nov 1, 2015 – Dec 10, 2015 2 messages not in the archive InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cmpost.c: Handle ibv_get_device_list returning no IB devices in init()

Also, print message when init fails

---

examples/cmpost.c +5 -1
index 1b0edf8..f7833f5 100644
@@ -447,6 +447,8 @@ static int init(void)
 	test.disconnects_left = connections;
 
 	dev_list = ibv_get_device_list(NULL);
+	if (!dev_list)
+		return -1;
 	test.device = dev_list[0];
 	if (!test.device)
 		return -1;
@@ -756,8 +758,10 @@ int main(int argc, char **argv)
 	}
 
 	is_server = (argc == 1);
-	if (init())
+	if (init()) {
+		printf("init failed\n");
 		exit(1);
+	}
 
 	if (is_server)
 		run_server();

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 56369FEE.7060100-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org

#2 lore raw

TWVyZ2VkIC0gdGhhbmtzLg0KDQpUaGlzIGlzIHRoZSBmaXJzdCBwYXRjaCBhZ2FpbnN0IHRoZSBs aWJpYmNtIGluIG92ZXIgNCB5ZWFycy4gIElzIHRoZXJlIGEgcmVhc29uIHdoeSB0aGlzIGlzIGJl aW5nIHVzZWQgaW5zdGVhZCBvZiB0aGUgbGlicmRtYWNtPyAgSSBhc2sgYmVjYXVzZSBJIGFzc3Vt ZWQgdGhhdCB0aGUgbGliaWJjbSB3YXMgYmFzaWNhbGx5IGRlcHJlY2F0ZWQuICBUaGUgbGFzdCBy ZWxlYXNlIHdhcyBvdmVyIDYgeWVhcnMgYWdvLg0KDQotIFNlYW4NCg==
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 1828884A29C6694DAF28B7E6B8A82373A9BA5132-8oqHQFITsIHTXloPLtfHfbfspsVTdybXVpNB7YpNyf8@public.gmane.org

#4 lore raw
Quoted 3 lines · Sean

Merged - thanks.

This is the first patch against the libibcm in over 4 years. Is there a reason why this is being used instead of the librdmacm? I ask because I assumed that the libibcm was basically deprecated. The last release was over 6 years ago.

I started trying to use this test program to try to reproduce a CM bug. More to follow after some additional verification.

-- Hal

Quoted 2 lines

- Sean

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#5 lore raw
In reply to a message not in the archive
Quoted 3 lines · Sean

Merged - thanks.

This is the first patch against the libibcm in over 4 years. Is there a reason why this is being used instead of the librdmacm? I ask because I assumed that the libibcm was basically deprecated. The last release was over 6 years ago.

Not to mention the fact that libibcm is completely lacking all documentation if I recall correctly. No man pages or anything like that. We've considered it deprecated for quite some time.

Signature · 2 lines
Doug Ledford <[email protected]>
              GPG KeyID: 0E572FDD