Print this page
4965 nlm null rpc returns RPC_TIMEDOUT with shorter timeout value

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/klm/nlm_impl.c
          +++ new/usr/src/uts/common/klm/nlm_impl.c
↓ open down ↓ 116 lines elided ↑ open up ↑
 117  117  #define NLM_KNCS        ARRSIZE(nlm_netconfigs)
 118  118  
 119  119  krwlock_t lm_lck;
 120  120  
 121  121  /*
 122  122   * Zero timeout for asynchronous NLM RPC operations
 123  123   */
 124  124  static const struct timeval nlm_rpctv_zero = { 0,  0 };
 125  125  
 126  126  /*
      127 + * Initial timeout for NLM NULL RPC
      128 + */
      129 +static volatile struct timeval nlm_nullrpc_wait = { 0, 200000 };
      130 +
      131 +/*
 127  132   * List of all Zone globals nlm_globals instences
 128  133   * linked together.
 129  134   */
 130  135  static struct nlm_globals_list nlm_zones_list; /* (g) */
 131  136  
 132  137  /*
 133  138   * NLM kmem caches
 134  139   */
 135  140  static struct kmem_cache *nlm_hosts_cache = NULL;
 136  141  static struct kmem_cache *nlm_vhold_cache = NULL;
↓ open down ↓ 383 lines elided ↑ open up ↑
 520  525           * Client doesn't send a reply to RES procedures, so
 521  526           * we don't need to wait anything.
 522  527           *
 523  528           * NOTE: we ignore NLM4_*_RES procnums because they are
 524  529           * equal to NLM_*_RES numbers.
 525  530           */
 526  531          if (procnum >= NLM_TEST_RES && procnum <= NLM_GRANTED_RES)
 527  532                  wait = nlm_rpctv_zero;
 528  533  
 529  534          /*
      535 +         * Default timeout value of 25 seconds can take
      536 +         * nlm_null_rpc() 150 seconds to return RPC_TIMEDOUT 
      537 +         * if it uses UDP and the destination port is 
      538 +         * unreachable.
      539 +         *
      540 +         * A shorter timeout value, e.g. 200 milliseconds,
      541 +         * will cause nlm_null_rpc() to time out after
      542 +         * 200 * (1 + 2 + 4 + 8 + 16 + 32) = 12.6 seconds
      543 +         * (with retries set to 5)
      544 +         */
      545 +        if (procnum == NLM_NULL)
      546 +                wait = nlm_nullrpc_wait;
      547 +
      548 +        /*
 530  549           * We need to block signals in case of NLM_CANCEL RPC
 531  550           * in order to prevent interruption of network RPC
 532  551           * calls.
 533  552           */
 534  553          if (procnum == NLM_CANCEL) {
 535  554                  k_sigset_t newmask;
 536  555  
 537  556                  sigfillset(&newmask);
 538  557                  sigreplace(&newmask, &oldmask);
 539  558                  sig_blocked = TRUE;
↓ open down ↓ 2208 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX