Print this page
OS-7184 prototype

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/inet/ip/ip_if.c
          +++ new/usr/src/uts/common/inet/ip/ip_if.c
↓ open down ↓ 1386 lines elided ↑ open up ↑
1387 1387           * I'm in this ill's squeue, aka a writer.  The ILL_CONDEMNED flag can
1388 1388           * only be set by someone who is the writer.  Since we
1389 1389           * drop-and-reacquire the squeue in this loop, we need to check for
1390 1390           * ILL_CONDEMNED, which if set means nothing can signal our capability
1391 1391           * condition variable.
1392 1392           */
1393 1393          ASSERT(IAM_WRITER_ILL(ill));
1394 1394  
1395 1395          while (ill->ill_capab_pending_cnt != 0 &&
1396 1396              (ill->ill_state_flags & ILL_CONDEMNED) == 0) {
1397      -                mutex_enter(&ill->ill_dlpi_capab_lock);
     1397 +                /* This may enable blocked callers of ill_capability_done(). */
1398 1398                  ipsq_exit(ill->ill_phyint->phyint_ipsq);
1399      -                cv_wait(&ill->ill_dlpi_capab_cv, &ill->ill_dlpi_capab_lock);
1400      -                mutex_exit(&ill->ill_dlpi_capab_lock);
     1399 +                /* Pause a bit (1msec) before we re-enter the squeue. */
     1400 +                delay(drv_usectohz(1000000));
     1401 +
1401 1402                  /*
1402 1403                   * If ipsq_enter() fails, someone set ILL_CONDEMNED
1403 1404                   * while we dropped the squeue. Indicate such to the caller.
1404 1405                   */
1405 1406                  if (!ipsq_enter(ill, B_FALSE, CUR_OP))
1406 1407                          return (B_FALSE);
1407 1408          }
1408 1409  
1409 1410          return ((ill->ill_state_flags & ILL_CONDEMNED) == 0);
1410 1411  }
↓ open down ↓ 2095 lines elided ↑ open up ↑
3506 3507           * opened as an IPv4 module.  Instead tracking down the cases where
3507 3508           * it switches to do ipv6, we'll just initialize the IPv6 configuration
3508 3509           * here for convenience, this has no effect until the ill is set to do
3509 3510           * IPv6.
3510 3511           */
3511 3512          ill->ill_reachable_time = ND_REACHABLE_TIME;
3512 3513          ill->ill_xmit_count = ND_MAX_MULTICAST_SOLICIT;
3513 3514          ill->ill_max_buf = ND_MAX_Q;
3514 3515          ill->ill_refcnt = 0;
3515 3516  
3516      -        cv_init(&ill->ill_dlpi_capab_cv, NULL, CV_DEFAULT, NULL);
3517      -        mutex_init(&ill->ill_dlpi_capab_lock, NULL, MUTEX_DEFAULT, NULL);
3518      -
3519 3517          return (0);
3520 3518  }
3521 3519  
3522 3520  /*
3523 3521   * ill_init is called by ip_open when a device control stream is opened.
3524 3522   * It does a few initializations, and shoots a DL_INFO_REQ message down
3525 3523   * to the driver.  The response is later picked up in ip_rput_dlpi and
3526 3524   * used to set up default mechanisms for talking to the driver.  (Always
3527 3525   * called as writer.)
3528 3526   *
↓ open down ↓ 9399 lines elided ↑ open up ↑
12928 12926  ill_capability_send(ill_t *ill, mblk_t *mp)
12929 12927  {
12930 12928          ill->ill_capab_pending_cnt++;
12931 12929          ill_dlpi_send(ill, mp);
12932 12930  }
12933 12931  
12934 12932  void
12935 12933  ill_capability_done(ill_t *ill)
12936 12934  {
12937 12935          ASSERT(ill->ill_capab_pending_cnt != 0);
     12936 +        ASSERT(IAM_WRITER_ILL(ill));
12938 12937  
12939 12938          ill_dlpi_done(ill, DL_CAPABILITY_REQ);
12940 12939  
12941 12940          ill->ill_capab_pending_cnt--;
12942 12941          if (ill->ill_capab_pending_cnt == 0 &&
12943 12942              ill->ill_dlpi_capab_state == IDCS_OK)
12944 12943                  ill_capability_reset_alloc(ill);
12945      -
12946      -        mutex_enter(&ill->ill_dlpi_capab_lock);
12947      -        cv_broadcast(&ill->ill_dlpi_capab_cv);
12948      -        mutex_exit(&ill->ill_dlpi_capab_lock);
12949 12944  }
12950 12945  
12951 12946  /*
12952 12947   * Send all deferred DLPI messages without waiting for their ACKs.
12953 12948   */
12954 12949  void
12955 12950  ill_dlpi_send_deferred(ill_t *ill)
12956 12951  {
12957 12952          mblk_t *mp, *nextmp;
12958 12953  
↓ open down ↓ 6270 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX