[LIBRDMACM] retry IBAT call on E_PENDING return. Signed off by Sean.Hefty@intel.com...
authorstansmith <stansmith@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 17 Aug 2009 23:06:55 +0000 (23:06 +0000)
committerstansmith <stansmith@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 17 Aug 2009 23:06:55 +0000 (23:06 +0000)
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@2362 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

ulp/librdmacm/src/cma.cpp

index 72411bd..e732234 100644 (file)
@@ -497,7 +497,16 @@ int rdma_resolve_route(struct rdma_cm_id *id, int timeout_ms)
        IBAT_PATH_BLOB path;\r
        HRESULT hr;\r
 \r
-       hr = IBAT::Resolve(&id->route.addr.src_addr, &id->route.addr.dst_addr, &path);\r
+       do {\r
+               hr = IBAT::Resolve(&id->route.addr.src_addr, &id->route.addr.dst_addr, &path);\r
+               if (hr != E_PENDING) {\r
+                       break;\r
+               }\r
+               timeout_ms -= 10;\r
+               if (timeout_ms > 0)\r
+                       Sleep(10);\r
+       } while (timeout_ms > 0);\r
+\r
        if (FAILED(hr)) {\r
                return hr;\r
        }\r