[WSD] Add support for controlling SA timeout/retry settings, as well as
authorftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Wed, 3 May 2006 18:51:24 +0000 (18:51 +0000)
committerftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Wed, 3 May 2006 18:51:24 +0000 (18:51 +0000)
connection establishment behavior when the SA queries timeout from default
of falling back on IPoIB to a hard failure.

git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@333 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

ulp/wsd/user/ibsp_ip.c
ulp/wsd/user/ibspdll.c
ulp/wsd/user/ibspdll.h

index 532fd34..0d6d8ef 100644 (file)
@@ -311,8 +311,8 @@ query_guid_address(
        query_req.query_type = IB_QUERY_USER_DEFINED;\r
        query_req.p_query_input = &user_query;\r
        query_req.port_guid = port->guid;\r
-       query_req.timeout_ms = 500;\r
-       query_req.retry_cnt = 4;\r
+       query_req.timeout_ms = g_sa_timeout;\r
+       query_req.retry_cnt = g_sa_retries;\r
        query_req.flags = IB_FLAGS_SYNC;\r
        query_req.query_context = &query_context;\r
        query_req.pfn_query_cb = query_guid_callback;\r
@@ -432,8 +432,8 @@ query_pr(
        query_req.query_type = IB_QUERY_PATH_REC_BY_GIDS;\r
        query_req.p_query_input = &user_query;\r
        query_req.port_guid = port->guid;\r
-       query_req.timeout_ms = 500;\r
-       query_req.retry_cnt = 4;\r
+       query_req.timeout_ms = g_sa_timeout;\r
+       query_req.retry_cnt = g_sa_retries;\r
        query_req.flags = IB_FLAGS_SYNC;\r
        query_req.query_context = &query_context;\r
        query_req.pfn_query_cb = query_pr_callback;\r
index aa0f389..f8a5daf 100644 (file)
@@ -52,6 +52,9 @@ static const GUID provider_guid = {
 static DWORD   no_read = 0;\r
 uint32_t               g_max_inline = 0xFFFFFFFF;\r
 uint32_t               g_max_poll = 500;\r
+uint32_t               g_sa_timeout = 500;\r
+uint32_t               g_sa_retries = 4;\r
+int                            g_connect_err = WSAEADDRNOTAVAIL;\r
 \r
 \r
 /*\r
@@ -120,6 +123,18 @@ _DllMain(
                if( i && i <= 16 )\r
                        g_max_poll = _tcstoul( env_var, NULL, 10 );\r
 \r
+               i = GetEnvironmentVariable( "IBWSD_SA_RETRY", env_var, sizeof(env_var) );\r
+               if( i && i <= 16 )\r
+                       g_sa_retries = _tcstoul( env_var, NULL, 10 );\r
+\r
+               i = GetEnvironmentVariable( "IBWSD_SA_TIMEOUT", env_var, sizeof(env_var) );\r
+               if( i && i <= 16 )\r
+                       g_sa_timeout = _tcstoul( env_var, NULL, 10 );\r
+\r
+               i = GetEnvironmentVariable( "IBWSD_NO_IPOIB", env_var, sizeof(env_var) );\r
+               if( i )\r
+                       g_connect_err = WSAENETDOWN;\r
+\r
                if( init_globals() )\r
                        return FALSE;\r
 \r
@@ -755,7 +770,7 @@ IBSPConnect(
                IBSP_ERROR_EXIT(\r
                        ("query_guid_address failed for IP %08x\n",\r
                        addr->sin_addr.s_addr) );\r
-               *lpErrno = WSAEADDRNOTAVAIL;\r
+               *lpErrno = g_connect_err;\r
                return SOCKET_ERROR;\r
        }\r
 \r
@@ -775,7 +790,7 @@ IBSPConnect(
        {\r
                IBSP_ERROR_EXIT(\r
                        ("query_pr failed for IP %08x\n", addr->sin_addr.s_addr) );\r
-               *lpErrno = WSAEADDRNOTAVAIL;\r
+               *lpErrno = g_connect_err;\r
                return SOCKET_ERROR;\r
        }\r
 \r
index 75e2eea..ffb699f 100644 (file)
@@ -59,5 +59,9 @@ extern struct ibspdll_globals g_ibsp;
 \r
 extern uint32_t                g_max_inline;\r
 extern uint32_t                g_max_poll;\r
+extern uint32_t                g_sa_timeout;\r
+extern uint32_t                g_sa_retries;\r
+/* Allow users to control SA timeouts behavior - fall back on IPoIB or fail. */\r
+extern int                     g_connect_err;\r
 \r
 #endif /* IBSPDLL_H */\r