Print this page
8368 remove warlock leftovers from usr/src/uts

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/ib/mgt/ibcm/ibcm_sm.c
          +++ new/usr/src/uts/common/io/ib/mgt/ibcm/ibcm_sm.c
↓ open down ↓ 476 lines elided ↑ open up ↑
 477  477  clock_t ibcm_mra_service_timeout_max = 0;
 478  478  
 479  479  #ifdef  DEBUG
 480  480  
 481  481  static void                     print_modify_qp(char *prefix,
 482  482                                      ibt_qp_hdl_t ibt_qp,
 483  483                                      ibt_cep_modify_flags_t flags,
 484  484                                      ibt_qp_info_t *qp_attr);
 485  485  #endif
 486  486  
 487      -/*      Warlock annotations */
 488      -
 489      -_NOTE(READ_ONLY_DATA(ibt_arej_info_u))
 490      -
 491  487  /*
 492  488   * ibcm_process_incoming_mad:
 493  489   *      The CM callback that is invoked by IBMF, when a valid CM MAD arrives
 494  490   *      on any of the registered ibmf handles by CM.
 495  491   *
 496  492   *      It is assumed that the incoming MAD (except for incoming REQ) belongs
 497  493   *      to a connection on the HCA, on which the MAD is received.
 498  494   *      The IBMF callback arg specifies ibcm_hca_info_t
 499  495   *
 500  496   * NOTE: IBMF always invokes ibcm_recv_cb() in a taskq. CM does some memory
↓ open down ↓ 58 lines elided ↑ open up ↑
 559  555                  IBTF_DPRINTF_L2(cmlog, "ibcm_process_incoming_mad: "
 560  556                      "hca not in attach state");
 561  557                  /* IBMF allocates Input MAD, and ibcm free's it */
 562  558                  if ((ibmf_status = ibmf_free_msg(ibmf_handle, &msgp)) !=
 563  559                      IBMF_SUCCESS)
 564  560                          IBTF_DPRINTF_L2(cmlog, "ibcm_process_incoming_mad: "
 565  561                              "ibmf_free_msg failed %d", ibmf_status);
 566  562                  return;
 567  563          }
 568  564  
 569      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*cm_mad_addr))
 570      -
 571  565          /* allocate memory for internal MAD address buffer */
 572  566          cm_mad_addr = &loc_mad_addr;
 573  567          bzero(cm_mad_addr, sizeof (ibcm_mad_addr_t));
 574  568  
 575  569          cm_mad_addr->port_num = portp->port_num;
 576  570  
 577  571          /* initialize cm_mad_addr field(s) */
 578  572          in_mad_hdr = msgp->im_msgbufs_recv.im_bufs_mad_hdr;
 579  573  
 580  574          if (in_mad_hdr->MgmtClass != MAD_MGMT_CLASS_COMM_MGT) {
↓ open down ↓ 58 lines elided ↑ open up ↑
 639  633                  return;
 640  634          }
 641  635  
 642  636          IBTF_DPRINTF_L4(cmlog, "ibcm_process_incoming_mad: "
 643  637              "Transaction Id 0x%llX", b2h64(in_mad_hdr->TransactionID));
 644  638  
 645  639  #ifdef  DEBUG
 646  640          ibcm_decode_tranid(b2h64(in_mad_hdr->TransactionID), NULL);
 647  641  #endif
 648  642  
 649      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*cm_mad_addr))
 650      -
 651  643          /*
 652  644           * The following are valid combination of Method type
 653  645           * and attribute id in the received MAD :-
 654  646           *      o ClassPortInfo with Get method
 655  647           *      o CM messages with Send method
 656  648           */
 657  649          if ((attr_id == MAD_ATTR_ID_CLASSPORTINFO) &&
 658  650              ((method == MAD_METHOD_GET) ||
 659  651              (method == MAD_METHOD_GET_RESPONSE))) {
 660  652                  if (method == MAD_METHOD_GET)
↓ open down ↓ 42 lines elided ↑ open up ↑
 703  695          ibmf_msg_t      *tq_ibmf_msgp;
 704  696          void            *tq_args;
 705  697  } ibcm_taskq_args_t;
 706  698  
 707  699  #define IBCM_RECV_MAX   128
 708  700  ibcm_taskq_args_t ibcm_recv_array[IBCM_RECV_MAX + 1];
 709  701  int ibcm_get, ibcm_put;
 710  702  int ibcm_recv_total;
 711  703  int ibcm_recv_queued;
 712  704  
 713      -_NOTE(READ_ONLY_DATA(ibcm_taskq_args_t))
 714      -
 715  705  static int
 716  706  ibcm_recv_dequeue(ibmf_handle_t *ibmf_handlep, ibmf_msg_t **msgpp, void **argsp)
 717  707  {
 718  708          ibcm_taskq_args_t *tq;
 719  709  
 720  710          if (ibcm_put == ibcm_get)
 721  711                  return (0);
 722  712  
 723  713          if (++ibcm_get >= IBCM_RECV_MAX)
 724  714                  ibcm_get = 0;
↓ open down ↓ 11 lines elided ↑ open up ↑
 736  726          ibcm_taskq_args_t *tq;
 737  727  
 738  728          ASSERT(MUTEX_HELD(&ibcm_recv_mutex));
 739  729          next = ibcm_put + 1;
 740  730          if (next >= IBCM_RECV_MAX)
 741  731                  next = 0;
 742  732          if (next != ibcm_get) {
 743  733                  ibcm_recv_queued++;
 744  734                  ibcm_put = next;
 745  735                  tq = ibcm_recv_array + next;
 746      -                _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*tq))
 747  736                  tq->tq_ibmf_handle = ibmf_handle;
 748  737                  tq->tq_ibmf_msgp = msgp;
 749  738                  tq->tq_args = args;
 750      -                _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*tq))
 751  739                  return (1);
 752  740          } else {
 753  741                  return (0);
 754  742          }
 755  743  }
 756  744  
 757  745  void
 758  746  ibcm_drop_msg(ibmf_handle_t ibmf_handle, ibmf_msg_t *msgp)
 759  747  {
 760  748          int ibmf_status;
↓ open down ↓ 99 lines elided ↑ open up ↑
 860  848                  tq = kmem_alloc(sizeof (*tq), KM_NOSLEEP);
 861  849                  if (tq == NULL) {
 862  850                          mutex_enter(&ibcm_recv_mutex);
 863  851                          if (--ibcm_recv_tasks > 0)
 864  852                                  rv = ibcm_recv_enqueue(ibmf_handle, msgp, args);
 865  853                          else    /* don't enqueue if no threads are running */
 866  854                                  rv = 0;
 867  855                          mutex_exit(&ibcm_recv_mutex);
 868  856                          return (rv);
 869  857                  }
 870      -                _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*tq))
 871  858                  tq->tq_ibmf_handle = ibmf_handle;
 872  859                  tq->tq_ibmf_msgp = msgp;
 873  860                  tq->tq_args = args;
 874      -                _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*tq))
 875  861                  if (taskq_dispatch(ibcm_taskq, ibcm_recv_task, tq,
 876  862                      TQ_NOQUEUE | TQ_NOSLEEP) == 0) {    /* dispatch failed */
 877  863                          mutex_enter(&ibcm_recv_mutex);
 878  864                          if (--ibcm_recv_tasks == 0) {
 879  865                                  /* try the dispatch again, after a tick */
 880  866                                  (void) timeout(ibcm_recv_timeout_cb, tq, 1);
 881  867                                  ibcm_recv_timeouts++;
 882  868                                  rv = 1; /* indicate success */
 883  869                          } else {
 884  870                                  rv = ibcm_recv_enqueue(ibmf_handle, msgp, args);
↓ open down ↓ 88 lines elided ↑ open up ↑
 973  959          remote_comid = b2h32(req_msgp->req_local_comm_id);
 974  960  
 975  961          IBCM_DUMP_RAW_MSG((uchar_t *)input_madp);
 976  962  
 977  963          IBTF_DPRINTF_L4(cmlog, "ibcm_process_req_msg: remote_comid = %x"
 978  964              " remote_qpn = %x", remote_comid, remote_qpn);
 979  965  
 980  966          IBTF_DPRINTF_L4(cmlog, "ibcm_process_req_msg: remote_hcaguid = %llX",
 981  967              remote_hca_guid);
 982  968  
 983      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*statep))
 984      -
 985  969  new_req:
 986  970          /* allocate the local_comid before proceeding */
 987  971          if (ibcm_alloc_comid(hcap, &local_comid) != IBCM_SUCCESS) {
 988  972                  ibcm_build_n_post_rej_mad(input_madp,
 989  973                      b2h32(req_msgp->req_local_comm_id), cm_mad_addr,
 990  974                      IBT_CM_FAILURE_REQ, IBT_CM_NO_RESC);
 991  975                  return;
 992  976          }
 993  977  
 994  978          /* allocate ibcm_state_data_t before grabbing the WRITER lock */
↓ open down ↓ 11 lines elided ↑ open up ↑
1006  990  
1007  991                  mutex_enter(&statep->state_mutex);
1008  992                  /* Release the state table lock */
1009  993                  rw_exit(&hcap->hca_state_rwlock);
1010  994  
1011  995                  IBTF_DPRINTF_L4(cmlog, "ibcm_process_req_msg: New statep 0x%p"
1012  996                      " created", statep);
1013  997  
1014  998                  psn24_timeout5_retry3 = b2h32(req_msgp->req_starting_psn_plus);
1015  999  
1016      -                _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*statep))
1017      -
1018 1000                  /* if ibmf msg allocation fails, delete the statep */
1019 1001                  if (ibcm_alloc_out_msg(cm_mad_addr->ibmf_hdl,
1020 1002                      &statep->stored_msg, MAD_METHOD_SEND) != IBT_SUCCESS) {
1021 1003  
1022 1004                          IBCM_REF_CNT_DECR(statep);
1023 1005                          statep->state = IBCM_STATE_DELETE;
1024 1006                          mutex_exit(&statep->state_mutex);
1025 1007                          /* HCA res cnt decremented via ibcm_delete_state_data */
1026 1008                          ibcm_inc_hca_res_cnt(hcap);
1027 1009                          ibcm_delete_state_data(statep);
↓ open down ↓ 218 lines elided ↑ open up ↑
1246 1228                          IBTF_DPRINTF_L4(cmlog, "ibcm_process_req_msg: "
1247 1229                              "statep %0xp client returned DEFER response",
1248 1230                              statep);
1249 1231                          return;
1250 1232                  }
1251 1233  
1252 1234                  /* statep ref cnt decremented in the func below */
1253 1235                  ibcm_handle_cep_req_response(statep, response,
1254 1236                      reject_reason, arej_info_len);
1255 1237  
1256      -                _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*statep))
1257      -
1258 1238                  return;
1259 1239  
1260 1240          } else {
1261 1241                  rw_exit(&hcap->hca_state_rwlock);
1262 1242                  ibcm_free_comid(hcap, local_comid);
1263 1243          }
1264 1244  
1265 1245          if (state_lookup_status == IBCM_LOOKUP_EXISTS) {
1266 1246                  hrtime_t        cur_time;
1267 1247  
↓ open down ↓ 120 lines elided ↑ open up ↑
1388 1368  
1389 1369  /*
1390 1370   * ibcm_handle_cep_req_response:
1391 1371   *      Processes the response from ibcm_cep_state_req. Called holding a
1392 1372   *      statep ref cnt. The statep ref cnt is decremented before returning.
1393 1373   */
1394 1374  void
1395 1375  ibcm_handle_cep_req_response(ibcm_state_data_t *statep, ibcm_status_t response,
1396 1376      ibt_cm_reason_t reject_reason, uint8_t arej_info_len)
1397 1377  {
1398      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*statep))
1399      -
1400 1378          if (response == IBCM_SEND_REP)
1401 1379                  ibcm_post_rep_mad(statep);
1402 1380          else {
1403 1381                  ASSERT(response == IBCM_SEND_REJ);
1404 1382                  IBTF_DPRINTF_L4(cmlog, "ibcm_handle_cep_req_response: statep %p"
1405 1383                      " posting REJ reject_reason = %d", statep, reject_reason);
1406 1384  
1407 1385                  ibcm_post_rej_mad(statep,
1408 1386                      reject_reason, IBT_CM_FAILURE_REQ,
1409 1387                      NULL, arej_info_len);
1410 1388          }
1411 1389  
1412      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*statep))
1413      -
1414 1390          mutex_enter(&statep->state_mutex);
1415 1391          IBCM_REF_CNT_DECR(statep);
1416 1392          mutex_exit(&statep->state_mutex);
1417 1393  }
1418 1394  
1419 1395  
1420 1396  /*
1421 1397   * ibcm_process_rep_msg:
1422 1398   *      ACTIVE SIDE CM
1423 1399   *      Called from ibcm_process_incoming_mad on reception of a REP message
↓ open down ↓ 97 lines elided ↑ open up ↑
1521 1497                  /* cancel the REQ timer */
1522 1498                  if (statep->timerid != 0) {
1523 1499                          timer_val = statep->timerid;
1524 1500                          statep->timerid = 0;
1525 1501                          mutex_exit(&statep->state_mutex);
1526 1502                          (void) untimeout(timer_val);
1527 1503                  } else {
1528 1504                          mutex_exit(&statep->state_mutex);
1529 1505                  }
1530 1506  
1531      -                _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*statep))
1532      -
1533 1507                  /* Initialize the remote destination QPN for further MADs */
1534 1508                  statep->stored_reply_addr.rcvd_addr.ia_remote_qno =
1535 1509                      cm_mad_addr->rcvd_addr.ia_remote_qno;
1536 1510                  statep->remote_qpn = b2h32(rep_msgp->rep_local_qpn_plus) >> 8;
1537 1511                  statep->remote_comid = b2h32(rep_msgp->rep_local_comm_id);
1538 1512                  bcopy(rep_msgp->rep_local_ca_guid, &remote_ca_guid,
1539 1513                      sizeof (ib_guid_t));
1540 1514                  statep->remote_hca_guid = b2h64(remote_ca_guid);
1541 1515  
1542 1516                  IBTF_DPRINTF_L4(cmlog, "ibcm_process_rep_msg: statep 0x%p "
↓ open down ↓ 207 lines elided ↑ open up ↑
1750 1724  
1751 1725                  if (response == IBCM_DEFER) {
1752 1726                          IBTF_DPRINTF_L4(cmlog, "ibcm_process_rep_msg: "
1753 1727                              "statep 0x%p client returned DEFER response",
1754 1728                              statep);
1755 1729                          return;
1756 1730                  }
1757 1731                  ibcm_handle_cep_rep_response(statep, response,
1758 1732                      reject_reason, arej_info_len, rep_msgp);
1759 1733  
1760      -                _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*statep))
1761      -
1762 1734                  return;
1763 1735  
1764 1736          } else if (statep->state == IBCM_STATE_DELETE) {
1765 1737  
1766 1738                  mutex_exit(&statep->state_mutex);
1767 1739                  ibcm_build_n_post_rej_mad(input_madp,
1768 1740                      b2h32(rep_msgp->rep_local_comm_id), cm_mad_addr,
1769 1741                      IBT_CM_FAILURE_REP, IBT_CM_INVALID_CID);
1770 1742                  mutex_enter(&statep->state_mutex);
1771 1743          } else {
↓ open down ↓ 860 lines elided ↑ open up ↑
2632 2604   *      NONE
2633 2605   */
2634 2606  void
2635 2607  ibcm_post_dreq_mad(void *vstatep)
2636 2608  {
2637 2609          ibcm_state_data_t       *statep = vstatep;
2638 2610          ibcm_dreq_msg_t         *dreq_msgp;
2639 2611  
2640 2612          ASSERT(statep->dreq_msg != NULL);
2641 2613  
2642      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*dreq_msgp))
2643      -
2644 2614          /* Fill in the DREQ message */
2645 2615          dreq_msgp = (ibcm_dreq_msg_t *)IBCM_OUT_MSGP(statep->dreq_msg);
2646 2616          dreq_msgp->dreq_local_comm_id = h2b32(statep->local_comid);
2647 2617          dreq_msgp->dreq_remote_comm_id = h2b32(statep->remote_comid);
2648 2618          dreq_msgp->dreq_remote_qpn_eecn_plus = h2b32(statep->remote_qpn << 8);
2649 2619  
2650 2620          IBCM_OUT_HDRP(statep->dreq_msg)->AttributeID =
2651 2621              h2b16(IBCM_INCOMING_DREQ + IBCM_ATTR_BASE_ID);
2652 2622  
2653 2623          /* wait until client knows CONN EST event */
↓ open down ↓ 2 lines elided ↑ open up ↑
2656 2626                  cv_wait(&statep->block_mad_cv, &statep->state_mutex);
2657 2627          mutex_exit(&statep->state_mutex);
2658 2628  
2659 2629          /* Transition QP/EEC state to ERROR state */
2660 2630          (void) ibcm_cep_to_error_state(statep);
2661 2631  
2662 2632          IBCM_OUT_HDRP(statep->dreq_msg)->TransactionID =
2663 2633              h2b64(ibcm_generate_tranid(IBCM_INCOMING_DREQ, statep->local_comid,
2664 2634              0));
2665 2635  
2666      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*dreq_msgp))
2667      -
2668 2636          /* post the first DREQ via timeout callback */
2669 2637          mutex_enter(&statep->state_mutex);
2670 2638  
2671 2639          statep->state = IBCM_STATE_DREQ_SENT;
2672 2640          cv_broadcast(&statep->block_mad_cv);
2673 2641  
2674 2642          statep->timer_stored_state = statep->state;
2675 2643          /* client cannot specify more than 16 retries */
2676 2644          statep->timer_value = statep->remote_ack_delay;
2677 2645          if (statep->mode == IBCM_ACTIVE_MODE) {
↓ open down ↓ 15 lines elided ↑ open up ↑
2693 2661   * RETURN VALUE:
2694 2662   *      NONE
2695 2663   */
2696 2664  static void
2697 2665  ibcm_post_drep_mad(ibcm_state_data_t *statep)
2698 2666  {
2699 2667          ibcm_drep_msg_t *drep_msgp;
2700 2668  
2701 2669          drep_msgp = (ibcm_drep_msg_t *)IBCM_OUT_MSGP(statep->drep_msg);
2702 2670  
2703      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*drep_msgp))
2704      -
2705 2671          IBTF_DPRINTF_L4(cmlog, "ibcm_post_drep_mad:");
2706 2672  
2707 2673          /* Fill up DREP fields */
2708 2674          drep_msgp->drep_local_comm_id = h2b32(statep->local_comid);
2709 2675          drep_msgp->drep_remote_comm_id = h2b32(statep->remote_comid);
2710 2676          IBCM_OUT_HDRP(statep->drep_msg)->AttributeID =
2711 2677              h2b16(IBCM_INCOMING_DREP + IBCM_ATTR_BASE_ID);
2712 2678  
2713      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*drep_msgp))
2714      -
2715 2679          ibcm_insert_trace(statep, IBCM_TRACE_OUTGOING_DREP);
2716 2680  
2717 2681          /* Post the DREP MAD now.  */
2718 2682          ibcm_post_rc_mad(statep, statep->drep_msg, ibcm_post_drep_complete,
2719 2683              statep);
2720 2684  }
2721 2685  
2722 2686  /*
2723 2687   * ibcm_process_drep_msg:
2724 2688   *      Processes incoming DREP message on active/passive side
↓ open down ↓ 294 lines elided ↑ open up ↑
3019 2983  ibcm_post_rej_mad(ibcm_state_data_t *statep, ibt_cm_reason_t reject_reason,
3020 2984      int which_msg, void *addl_rej_info, ibt_priv_data_len_t arej_info_len)
3021 2985  {
3022 2986          ibcm_rej_msg_t  *rej_msg =
3023 2987              (ibcm_rej_msg_t *)IBCM_OUT_MSGP(statep->stored_msg);
3024 2988  
3025 2989          /* Message printed if connection gets REJed */
3026 2990          IBTF_DPRINTF_L3(cmlog, "ibcm_post_rej_mad: "
3027 2991              "statep = %p, reject_reason = %d", statep, reject_reason);
3028 2992  
3029      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*rej_msg))
3030      -
3031 2993          /* Initialize rej_msg fields */
3032 2994          rej_msg->rej_local_comm_id = h2b32(statep->local_comid);
3033 2995          rej_msg->rej_remote_comm_id = h2b32(statep->remote_comid);
3034 2996          rej_msg->rej_msg_type_plus = (which_msg & 0x3) << 6;
3035 2997          rej_msg->rej_reject_info_len_plus = arej_info_len << 1;
3036 2998          rej_msg->rej_rejection_reason = h2b16((uint16_t)reject_reason);
3037 2999  
3038 3000          if ((arej_info_len != 0) && (addl_rej_info != NULL))
3039 3001                  bcopy(addl_rej_info, rej_msg->rej_addl_rej_info, arej_info_len);
3040 3002  
3041 3003          IBCM_OUT_HDRP(statep->stored_msg)->AttributeID =
3042 3004              h2b16(IBCM_INCOMING_REJ + IBCM_ATTR_BASE_ID);
3043 3005  
3044      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*rej_msg))
3045      -
3046 3006          mutex_enter(&statep->state_mutex);
3047 3007  
3048 3008          /* signal any waiting close channels with blocking or no callbacks  */
3049 3009          statep->close_done = B_TRUE;
3050 3010          statep->close_nocb_state = IBCM_FAIL;
3051 3011  
3052 3012          cv_signal(&statep->block_client_cv);
3053 3013  
3054 3014          statep->timer_stored_state = statep->state = IBCM_STATE_REJ_SENT;
3055 3015          statep->send_mad_flags |= IBCM_REJ_POST_BUSY;
↓ open down ↓ 38 lines elided ↑ open up ↑
3094 3054          IBTF_DPRINTF_L3(cmlog, "ibcm_build_n_post_rej_mad: "
3095 3055              "remote_comid: %x reject_reason %d", remote_comid, reject_reason);
3096 3056  
3097 3057          if (ibcm_alloc_out_msg(cm_mad_addr->ibmf_hdl, &cm_rej_msg,
3098 3058              MAD_METHOD_SEND) != IBT_SUCCESS) {
3099 3059                  IBTF_DPRINTF_L2(cmlog, "ibcm_build_n_post_rej_mad: "
3100 3060                      "ibcm_alloc_out_msg failed");
3101 3061                  return;
3102 3062          }
3103 3063  
3104      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*rej_msg))
3105      -
3106 3064          IBCM_OUT_HDRP(cm_rej_msg)->TransactionID =
3107 3065              ((ib_mad_hdr_t *)(input_madp))->TransactionID;
3108 3066  
3109 3067          /* Initialize rej_msg fields */
3110 3068          rej_msg = (ibcm_rej_msg_t *)IBCM_OUT_MSGP(cm_rej_msg);
3111 3069          rej_msg->rej_local_comm_id = 0;
3112 3070          rej_msg->rej_remote_comm_id = h2b32(remote_comid);
3113 3071          rej_msg->rej_msg_type_plus = (which_msg & 0x3) << 6;
3114 3072          rej_msg->rej_reject_info_len_plus = 0;
3115 3073          rej_msg->rej_rejection_reason = h2b16(reject_reason);
3116 3074  
3117 3075          IBCM_OUT_HDRP(cm_rej_msg)->AttributeID =
3118 3076              h2b16(IBCM_INCOMING_REJ + IBCM_ATTR_BASE_ID);
3119 3077  
3120      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*rej_msg))
3121      -
3122 3078          ibcm_build_reply_mad_addr(cm_mad_addr, &rej_reply_addr);
3123 3079  
3124 3080          if (rej_reply_addr.cm_qp_entry != NULL) {
3125 3081                  (void) ibcm_post_mad(cm_rej_msg, &rej_reply_addr, NULL, NULL);
3126 3082                  ibcm_release_qp(rej_reply_addr.cm_qp_entry);
3127 3083          }
3128 3084  
3129 3085          (void) ibcm_free_out_msg(cm_mad_addr->ibmf_hdl, &cm_rej_msg);
3130 3086  }
3131 3087  
↓ open down ↓ 11 lines elided ↑ open up ↑
3143 3099          IBTF_DPRINTF_L3(cmlog, "ibcm_post_rej_ver_mismatch: remote comid %x",
3144 3100              b2h32(req_msgp->req_local_comm_id));
3145 3101  
3146 3102          if (ibcm_alloc_out_msg(cm_mad_addr->ibmf_hdl, &cm_rej_msg,
3147 3103              MAD_METHOD_SEND) != IBT_SUCCESS) {
3148 3104                  IBTF_DPRINTF_L2(cmlog, "ibcm_post_rej_ver_mismatch: "
3149 3105                      "ibcm_alloc_out_msg failed");
3150 3106                  return;
3151 3107          }
3152 3108  
3153      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*rej_msg))
3154      -
3155 3109          IBCM_OUT_HDRP(cm_rej_msg)->TransactionID =
3156 3110              ((ib_mad_hdr_t *)(input_madp))->TransactionID;
3157 3111  
3158 3112          /* Initialize rej_msg fields */
3159 3113          rej_msg = (ibcm_rej_msg_t *)IBCM_OUT_MSGP(cm_rej_msg);
3160 3114          rej_msg->rej_local_comm_id = 0;
3161 3115          rej_msg->rej_remote_comm_id = req_msgp->req_local_comm_id;
3162 3116          rej_msg->rej_msg_type_plus = IBT_CM_FAILURE_REQ << 6;
3163 3117          rej_msg->rej_rejection_reason = h2b16(IBT_CM_CLASS_NO_SUPPORT);
3164 3118          rej_msg->rej_reject_info_len_plus = 1 << 1;
3165 3119          rej_msg->rej_addl_rej_info[0] = IBCM_MAD_CLASS_VERSION;
3166 3120  
3167 3121          IBCM_OUT_HDRP(cm_rej_msg)->AttributeID =
3168 3122              h2b16(IBCM_INCOMING_REJ + IBCM_ATTR_BASE_ID);
3169 3123          IBCM_OUT_HDRP(cm_rej_msg)->Status = h2b16(MAD_STATUS_BAD_VERSION);
3170 3124  
3171      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*rej_msg))
3172      -
3173 3125          ibcm_build_reply_mad_addr(cm_mad_addr, &rej_reply_addr);
3174 3126          if (rej_reply_addr.cm_qp_entry != NULL) {
3175 3127                  (void) ibcm_post_mad(cm_rej_msg, &rej_reply_addr, NULL, NULL);
3176 3128                  ibcm_release_qp(rej_reply_addr.cm_qp_entry);
3177 3129          }
3178 3130          (void) ibcm_free_out_msg(cm_mad_addr->ibmf_hdl, &cm_rej_msg);
3179 3131  }
3180 3132  
3181 3133  
3182 3134  /*
↓ open down ↓ 9 lines elided ↑ open up ↑
3192 3144  void
3193 3145  ibcm_post_rep_mad(ibcm_state_data_t *statep)
3194 3146  {
3195 3147          ibcm_rep_msg_t  *rep_msgp =
3196 3148              (ibcm_rep_msg_t *)IBCM_OUT_MSGP(statep->stored_msg);
3197 3149          ibmf_msg_t      *mra_msg = NULL;
3198 3150          boolean_t       ret = B_FALSE;
3199 3151  
3200 3152          IBTF_DPRINTF_L4(cmlog, "ibcm_post_rep_mad: statep 0x%p", statep);
3201 3153  
3202      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*rep_msgp))
3203      -
3204 3154          /*
3205 3155           * All other REP fields, other that the 2 below, are filled in
3206 3156           * the ibcm_cep_state_req() function.
3207 3157           */
3208 3158          rep_msgp->rep_local_comm_id = h2b32(statep->local_comid);
3209 3159          rep_msgp->rep_remote_comm_id = h2b32(statep->remote_comid);
3210 3160          IBCM_OUT_HDRP(statep->stored_msg)->AttributeID =
3211 3161              h2b16(IBCM_INCOMING_REP + IBCM_ATTR_BASE_ID);
3212 3162  
3213      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*rep_msgp))
3214      -
3215 3163          /*
3216 3164           * Changing state and attempt to delete the mra msg must be done
3217 3165           * together holding the state_mutex
3218 3166           */
3219 3167          mutex_enter(&statep->state_mutex);
3220 3168  
3221 3169          /* Now, attempt to delete the mra_msg, if there is one allocated */
3222 3170          if (statep->mra_msg != NULL) {
3223 3171                  if (!(statep->send_mad_flags & IBCM_MRA_POST_BUSY)) {
3224 3172                          mra_msg = statep->mra_msg;
↓ open down ↓ 54 lines elided ↑ open up ↑
3279 3227   */
3280 3228  ibcm_status_t
3281 3229  ibcm_post_rtu_mad(ibcm_state_data_t *statep)
3282 3230  {
3283 3231          ibcm_rtu_msg_t  *rtu_msg;
3284 3232          ibmf_msg_t      *mra_msg = NULL;
3285 3233          boolean_t       ret = B_FALSE;
3286 3234  
3287 3235          IBTF_DPRINTF_L4(cmlog, "ibcm_post_rtu_mad: statep 0x%p", statep);
3288 3236  
3289      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*rtu_msg))
3290      -
3291 3237          rtu_msg = (ibcm_rtu_msg_t *)IBCM_OUT_MSGP(statep->stored_msg);
3292 3238  
3293 3239          rtu_msg->rtu_local_comm_id = h2b32(statep->local_comid);
3294 3240          rtu_msg->rtu_remote_comm_id = h2b32(statep->remote_comid);
3295 3241          IBCM_OUT_HDRP(statep->stored_msg)->AttributeID =
3296 3242              h2b16(IBCM_INCOMING_RTU + IBCM_ATTR_BASE_ID);
3297 3243  
3298      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*rtu_msg))
3299      -
3300 3244          mutex_enter(&statep->state_mutex);
3301 3245  
3302 3246          /* Now, attempt to delete the mra_msg, if there is one allocated */
3303 3247          if (statep->mra_msg != NULL) {
3304 3248                  if (!(statep->send_mad_flags & IBCM_MRA_POST_BUSY)) {
3305 3249                          mra_msg = statep->mra_msg;
3306 3250                          statep->mra_msg = NULL;
3307 3251                  } else statep->delete_mra_msg = B_TRUE;
3308 3252          }
3309 3253  
↓ open down ↓ 166 lines elided ↑ open up ↑
3476 3420                  mutex_exit(&statep->state_mutex);
3477 3421  
3478 3422                  if (statep->channel)
3479 3423                          ibtl_cm_chan_is_closed(statep->channel);
3480 3424  
3481 3425                  if (statep->recycle_arg) {
3482 3426                          struct ibcm_taskq_recycle_arg_s *recycle_arg;
3483 3427  
3484 3428                          recycle_arg = statep->recycle_arg;
3485 3429  
3486      -                        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(
3487      -                            statep->recycle_arg))
3488 3430                          statep->recycle_arg = NULL;
3489      -                        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(statep->recycle_arg))
3490 3431  
3491 3432                          /* if possible, do not slow down calling recycle func */
3492 3433                          if (taskq_dispatch(ibcm_taskq, ibcm_process_rc_recycle,
3493 3434                              recycle_arg, TQ_NOQUEUE | TQ_NOSLEEP) == 0) {
3494      -
3495      -                                _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(
3496      -                                    statep->recycle_arg))
3497 3435                                  statep->recycle_arg = recycle_arg;
3498      -                                _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(
3499      -                                    statep->recycle_arg))
3500 3436                                  ibcm_add_tlist(statep);
3501 3437                                  return;
3502 3438                          }
3503 3439                  }
3504 3440  
3505 3441                  ibcm_delete_state_data(statep);
3506 3442                  return;
3507 3443          } else if (statep->remaining_retry_cnt > 0) {
3508 3444                  ibcm_conn_state_t       stored_state;
3509 3445                  ibcm_ap_state_t         stored_ap_state;
↓ open down ↓ 744 lines elided ↑ open up ↑
4254 4190                              "ud scheduling state = %p", ud_statep);
4255 4191                          ibcm_ud_timeout_client_cb(ud_statep);
4256 4192                          mutex_enter(&ibcm_timeout_list_lock);
4257 4193                  } else {
4258 4194                          CALLB_CPR_SAFE_BEGIN(&cprinfo);
4259 4195                          cv_wait(&ibcm_timeout_list_cv, &ibcm_timeout_list_lock);
4260 4196                          CALLB_CPR_SAFE_END(&cprinfo, &ibcm_timeout_list_lock);
4261 4197                  }
4262 4198          }
4263 4199  
4264      -#ifndef __lock_lint
4265 4200          CALLB_CPR_EXIT(&cprinfo);       /* mutex_exit */
4266      -#endif
4267 4201  }
4268 4202  
4269 4203  
4270 4204  /*
4271 4205   * ibcm_timeout_client_cb:
4272 4206   *      Called from timeout thread processing
4273 4207   *      Primary purpose is to call client handler
4274 4208   *
4275 4209   * INPUTS:
4276 4210   *      arg     - ibcm_state_data_t is passed
↓ open down ↓ 3 lines elided ↑ open up ↑
4280 4214  void
4281 4215  ibcm_timeout_client_cb(ibcm_state_data_t *statep)
4282 4216  {
4283 4217          mutex_enter(&statep->state_mutex);
4284 4218  
4285 4219          if ((statep->state == IBCM_STATE_DELETE) &&
4286 4220              (statep->recycle_arg != NULL)) {
4287 4221                  struct ibcm_taskq_recycle_arg_s *recycle_arg;
4288 4222  
4289 4223                  recycle_arg = statep->recycle_arg;
4290      -                _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(statep->recycle_arg))
4291 4224                  statep->recycle_arg = NULL;
4292      -                _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(statep->recycle_arg))
4293 4225                  mutex_exit(&statep->state_mutex);
4294 4226                  (void) ibcm_process_rc_recycle(recycle_arg);
4295 4227                  ibcm_delete_state_data(statep);
4296 4228                  return;
4297 4229          }
4298 4230  
4299 4231          if ((statep->state == IBCM_STATE_DELETE) &&
4300 4232              (statep->delete_state_data == B_TRUE)) {
4301 4233                  mutex_exit(&statep->state_mutex);
4302 4234                  ibcm_dealloc_state_data(statep);
↓ open down ↓ 199 lines elided ↑ open up ↑
4502 4434          else
4503 4435                  gid.gid_prefix = gid.gid_guid = 0;
4504 4436  
4505 4437          /*
4506 4438           * Lookup for an existing state structure
4507 4439           * - if lookup fails it creates a new ud_state struct
4508 4440           * No need to hold a lock across the call to ibcm_find_sidr_entry() as
4509 4441           * the list lock is held in that function to find the matching entry.
4510 4442           */
4511 4443  
4512      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(srch_sidr))
4513      -
4514 4444          srch_sidr.srch_lid = lid;
4515 4445          srch_sidr.srch_gid = gid;
4516 4446          srch_sidr.srch_grh_exists = cm_mad_addr->grh_exists;
4517 4447          srch_sidr.srch_req_id = req_id;
4518 4448          srch_sidr.srch_mode = IBCM_PASSIVE_MODE;
4519 4449  
4520      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(srch_sidr))
4521      -
4522 4450          rw_enter(&hcap->hca_sidr_list_lock, RW_WRITER);
4523 4451          state_lookup_status = ibcm_find_sidr_entry(&srch_sidr, hcap, &ud_statep,
4524 4452              IBCM_FLAG_LOOKUP_AND_ADD);
4525 4453          rw_exit(&hcap->hca_sidr_list_lock);
4526 4454  
4527 4455          IBTF_DPRINTF_L4(cmlog, "ibcm_process_sidr_req_msg: ud_statep 0x%p "
4528 4456              "lookup status %x", ud_statep, state_lookup_status);
4529 4457  
4530 4458          if (state_lookup_status == IBCM_LOOKUP_NEW) {
4531 4459  
4532 4460                  /* Increment hca's resource count */
4533 4461                  ibcm_inc_hca_res_cnt(hcap);
4534 4462  
4535      -                _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*ud_statep))
4536      -
4537 4463                  /*
4538 4464                   * Allocate CM MAD for a response
4539 4465                   * This MAD is deallocated on state structure delete
4540 4466                   * and re-used for all outgoing MADs for this connection.
4541 4467                   * If MAD allocation fails, delete the ud statep
4542 4468                   */
4543 4469                  if (ibcm_alloc_out_msg(cm_mad_addr->ibmf_hdl,
4544 4470                      &ud_statep->ud_stored_msg, MAD_METHOD_SEND) !=
4545 4471                      IBT_SUCCESS) {
4546 4472                          mutex_enter(&ud_statep->ud_state_mutex);
↓ open down ↓ 96 lines elided ↑ open up ↑
4643 4569  
4644 4570                  if (cm_status == IBCM_DEFER) {
4645 4571                          IBTF_DPRINTF_L4(cmlog, "ibcm_process_sidr_req_msg: "
4646 4572                              "ud_statep 0x%p client returned DEFER response",
4647 4573                              ud_statep);
4648 4574                          return;
4649 4575                  }
4650 4576  
4651 4577                  ibcm_post_sidr_rep_mad(ud_statep, sidr_status);
4652 4578  
4653      -                _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*ud_statep))
4654      -
4655 4579                  mutex_enter(&ud_statep->ud_state_mutex);
4656 4580                  IBCM_UD_REF_CNT_DECR(ud_statep);
4657 4581                  mutex_exit(&ud_statep->ud_state_mutex);
4658 4582          } else {
4659 4583                  ASSERT(state_lookup_status == IBCM_LOOKUP_EXISTS);
4660 4584  
4661 4585                  mutex_enter(&ud_statep->ud_state_mutex);
4662 4586  
4663 4587                  if (ud_statep->ud_state == IBCM_STATE_SIDR_REP_SENT)
4664 4588                          ibcm_resend_srep_mad(ud_statep);
↓ open down ↓ 42 lines elided ↑ open up ↑
4707 4631  
4708 4632          /*
4709 4633           * Lookup for an existing state structure.
4710 4634           * No need to hold a lock as ibcm_find_sidr_entry() holds the
4711 4635           * list lock to find the matching entry.
4712 4636           */
4713 4637          IBTF_DPRINTF_L4(cmlog, "ibcm_process_sidr_rep: lid=%x, (%llX, %llX), "
4714 4638              "grh = %x, id = %x", lid, gid.gid_prefix, gid.gid_guid,
4715 4639              cm_mad_addr->grh_exists, sidr_repp->sidr_rep_request_id);
4716 4640  
4717      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(srch_sidr))
4718      -
4719 4641          srch_sidr.srch_lid = lid;
4720 4642          srch_sidr.srch_gid = gid;
4721 4643          srch_sidr.srch_grh_exists = cm_mad_addr->grh_exists;
4722 4644          srch_sidr.srch_req_id = b2h32(sidr_repp->sidr_rep_request_id);
4723 4645          srch_sidr.srch_mode = IBCM_ACTIVE_MODE;
4724 4646  
4725      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(srch_sidr))
4726      -
4727 4647          rw_enter(&hcap->hca_sidr_list_lock, RW_READER);
4728 4648          status = ibcm_find_sidr_entry(&srch_sidr, hcap, &ud_statep,
4729 4649              IBCM_FLAG_LOOKUP);
4730 4650          rw_exit(&hcap->hca_sidr_list_lock);
4731 4651  
4732 4652          IBTF_DPRINTF_L4(cmlog, "ibcm_process_sidr_rep_msg: ud_statep 0x%p "
4733 4653              "find sidr entry status = %x", ud_statep, status);
4734 4654  
4735 4655          if (status != IBCM_LOOKUP_EXISTS) {
4736 4656                  IBTF_DPRINTF_L2(cmlog, "ibcm_process_sidr_rep_msg: "
↓ open down ↓ 117 lines elided ↑ open up ↑
4854 4774  ibcm_post_sidr_rep_mad(ibcm_ud_state_data_t *ud_statep,
4855 4775      ibt_sidr_status_t status)
4856 4776  {
4857 4777          ib_svc_id_t             tmp_svc_id;
4858 4778          ibcm_sidr_rep_msg_t     *sidr_repp =
4859 4779              (ibcm_sidr_rep_msg_t *)IBCM_OUT_MSGP(ud_statep->ud_stored_msg);
4860 4780          clock_t                 timer_value;
4861 4781  
4862 4782          IBTF_DPRINTF_L5(cmlog, "ibcm_post_sidr_rep_mad:");
4863 4783  
4864      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*sidr_repp))
4865      -
4866 4784          IBCM_OUT_HDRP(ud_statep->ud_stored_msg)->AttributeID =
4867 4785              h2b16(IBCM_INCOMING_SIDR_REP + IBCM_ATTR_BASE_ID);
4868 4786  
4869 4787          /*
4870 4788           * Initialize SIDR REP message. (Other fields were
4871 4789           * already filled up in ibcm_sidr_req_ud_handler()
4872 4790           */
4873 4791          sidr_repp->sidr_rep_request_id = h2b32(ud_statep->ud_req_id);
4874 4792          tmp_svc_id = h2b64(ud_statep->ud_svc_id);
4875 4793          bcopy(&tmp_svc_id, sidr_repp->sidr_rep_service_id, sizeof (tmp_svc_id));
4876 4794  
4877 4795          sidr_repp->sidr_rep_rep_status = (uint8_t)status;
4878 4796  
4879      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*sidr_repp))
4880      -
4881 4797          /* post the SIDR REP MAD */
4882 4798          ibcm_post_ud_mad(ud_statep, ud_statep->ud_stored_msg, NULL, NULL);
4883 4799  
4884 4800          timer_value = ibt_ib2usec(ibcm_max_sidr_rep_store_time);
4885 4801          /*
4886 4802           * Hold the statep lock, as a SIDR REQ may come in after setting state
4887 4803           * but before timeout. This can result in a dangling timeout ie.,
4888 4804           * the incoming SIDR REQ would be unable to cancel this timeout
4889 4805           */
4890 4806          mutex_enter(&ud_statep->ud_state_mutex);
↓ open down ↓ 160 lines elided ↑ open up ↑
5051 4967   *                      The reply MAD address is derived based
5052 4968   *                      address information of incoming CM MAD
5053 4969   * RETURN VALUE: NONE
5054 4970   */
5055 4971  void
5056 4972  ibcm_build_reply_mad_addr(ibcm_mad_addr_t *inp_mad_addr,
5057 4973      ibcm_mad_addr_t *out_mad_addr)
5058 4974  {
5059 4975          IBTF_DPRINTF_L5(cmlog, "ibcm_build_reply_mad_addr:");
5060 4976  
5061      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*out_mad_addr))
5062      -
5063 4977          bcopy(inp_mad_addr, out_mad_addr, sizeof (ibcm_mad_addr_t));
5064 4978  
5065 4979          /* Swap the GIDs in the GRH */
5066 4980          if (inp_mad_addr->grh_exists == B_TRUE) {
5067 4981                  ib_gid_t sgid = inp_mad_addr->grh_hdr.ig_sender_gid;
5068 4982  
5069 4983                  /* swap the SGID and DGID */
5070 4984                  out_mad_addr->grh_hdr.ig_sender_gid =
5071 4985                      inp_mad_addr->grh_hdr.ig_recver_gid;
5072 4986                  out_mad_addr->grh_hdr.ig_recver_gid = sgid;
5073 4987          }
5074 4988  
5075 4989          /*
5076 4990           * CM posts response MAD on a new/existing internal QP on the same port
5077 4991           * and pkey
5078 4992           */
5079 4993          out_mad_addr->cm_qp_entry =
5080 4994              ibcm_find_qp(inp_mad_addr->cm_qp_entry->qp_port->port_hcap,
5081 4995              inp_mad_addr->port_num, inp_mad_addr->rcvd_addr.ia_p_key);
5082      -
5083      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*out_mad_addr))
5084 4996  }
5085 4997  
5086 4998  
5087 4999  /*
5088 5000   * ibcm_post_rc_mad
5089 5001   *      Posts a CM MAD associated with a RC statep
5090 5002   *
5091 5003   * INPUTS:
5092 5004   * statep       : RC statep associated with the post
5093 5005   * msgp         : CM MAD to be posted
↓ open down ↓ 1172 lines elided ↑ open up ↑
6266 6178  
6267 6179          mutex_enter(&ibcm_svc_info_lock);
6268 6180          IBCM_SVC_DECR(statep->state_svc_infop);
6269 6181          mutex_exit(&ibcm_svc_info_lock);
6270 6182  
6271 6183          IBTF_DPRINTF_L4(cmlog, "ibcm_cep_state_req: Client handler returned %d"
6272 6184              " statep 0x%p", cb_status, statep);
6273 6185  
6274 6186          if (cb_status == IBT_CM_DEFER) {
6275 6187  
6276      -                _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(statep->defer_cm_msg))
6277      -
6278 6188                  if (statep->defer_cm_msg == NULL)
6279 6189                          statep->defer_cm_msg =
6280 6190                              kmem_zalloc(IBCM_MSG_SIZE, KM_SLEEP);
6281 6191                  bcopy(cm_req_msgp, statep->defer_cm_msg, IBCM_MSG_SIZE);
6282 6192  
6283      -                _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(statep->defer_cm_msg))
6284      -
6285 6193                  /*
6286 6194                   * unblock any blocked cm proceed api calls. Do not access
6287 6195                   * statep after cv_signal
6288 6196                   */
6289 6197                  mutex_enter(&statep->state_mutex);
6290 6198                  statep->clnt_proceed = IBCM_UNBLOCK;
6291 6199                  cv_broadcast(&statep->block_client_cv);
6292 6200                  mutex_exit(&statep->state_mutex);
6293 6201  
6294 6202                  kmem_free(priv_data, IBT_MAX_PRIV_DATA_SZ);
↓ open down ↓ 57 lines elided ↑ open up ↑
6352 6260                  IBTF_DPRINTF_L2(cmlog, "ibcm_process_cep_req_cm_hdlr: statep %p"
6353 6261                      " Client handler unexpected return %x", statep, cb_status);
6354 6262                  *reject_reason = IBT_CM_CONSUMER;
6355 6263          }
6356 6264  
6357 6265          /* client handler gave CM ok */
6358 6266          if (cb_status == IBT_CM_ACCEPT) {
6359 6267                  ibcm_rep_msg_t  *rep_msgp = (ibcm_rep_msg_t *)
6360 6268                      IBCM_OUT_MSGP(statep->stored_msg);
6361 6269  
6362      -
6363      -                _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*statep))
6364      -                _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*rep_msgp))
6365      -
6366 6270                  /*
6367 6271                   * Check first if ret_args make sense. If not, bailout
6368 6272                   * here rather than going along and panicing later.
6369 6273                   */
6370 6274                  channel = clnt_info->reply_event->rep.cm_channel;
6371 6275                  if (IBCM_INVALID_CHANNEL(channel)) {
6372 6276                          IBTF_DPRINTF_L2(cmlog, "ibcm_process_cep_req_cm_hdlr: "
6373 6277                              "statep 0x%p server's QP handle is NULL", statep);
6374 6278                          *reject_reason = IBT_CM_NO_CHAN;
6375 6279                  }
↓ open down ↓ 264 lines elided ↑ open up ↑
6640 6544  
6641 6545                  IBTF_DPRINTF_L4(cmlog, "ibcm_process_cep_req_cm_hdlr:statep %p "
6642 6546                      "REP priv len %x", statep, clnt_info->priv_data_len);
6643 6547                  /* Copy PrivateData from priv_data */
6644 6548                  if (clnt_info->priv_data_len != 0) {
6645 6549                          bcopy(clnt_info->priv_data, rep_msgp->rep_private_data,
6646 6550                              min(IBT_REP_PRIV_DATA_SZ,
6647 6551                              clnt_info->priv_data_len));
6648 6552                  }
6649 6553  
6650      -                _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*statep))
6651      -                _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*rep_msgp))
6652      -
6653 6554                  return (IBCM_SEND_REP);
6654 6555          }
6655 6556  
6656 6557          /* REJ message */
6657 6558          rej_msgp = (ibcm_rej_msg_t *)IBCM_OUT_MSGP(statep->stored_msg);
6658 6559  
6659 6560          IBTF_DPRINTF_L4(cmlog, "ibcm_process_cep_req_cm_hdlr: statep %p REJ "
6660 6561              "priv len %x", statep, clnt_info->priv_data_len);
6661 6562  
6662      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*rej_msgp))
6663      -
6664 6563          /* if priv_data_len != 0 use priv_data to copy back to rej_priv_data */
6665 6564          if (clnt_info->priv_data_len != 0) {
6666 6565                  bcopy(clnt_info->priv_data, rej_msgp->rej_private_data,
6667 6566                      min(IBT_REJ_PRIV_DATA_SZ, clnt_info->priv_data_len));
6668 6567          }
6669 6568  
6670 6569          if (cb_status == IBT_CM_REDIRECT_PORT) {
6671 6570                  ib_gid_t tgid;
6672 6571  
6673 6572                  tgid.gid_guid =
↓ open down ↓ 37 lines elided ↑ open up ↑
6711 6610                   * byte 1 of the rej_ari[] array.
6712 6611                   */
6713 6612                  if (((statep->svcid & IB_SID_IPADDR_PREFIX_MASK) == 0) &&
6714 6613                      (statep->svcid & IB_SID_IPADDR_PREFIX)) {
6715 6614                          rej_msgp->rej_addl_rej_info[0] = 1;
6716 6615                  }
6717 6616          }
6718 6617  
6719 6618          rej_msgp->rej_msg_type_plus = IBT_CM_FAILURE_REQ << 6;
6720 6619  
6721      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*rej_msgp))
6722      -
6723 6620          return (IBCM_SEND_REJ);
6724 6621  }
6725 6622  
6726 6623  /*
6727 6624   * ibcm_cep_state_rep:
6728 6625   *      QP state transition function called for an incoming REP on active side
6729 6626   *
6730 6627   * INPUTS:
6731 6628   *      statep          - state pointer
6732 6629   *      cm_rep_msg      - REP message pointer
↓ open down ↓ 158 lines elided ↑ open up ↑
6891 6788                      " active cep_timeout(usec) 0x%x ", statep, time);
6892 6789  
6893 6790                  IBTF_DPRINTF_L4(cmlog, "ibcm_process_cep_rep_cm_hdlr: statep %p"
6894 6791                      " passive hca_ack_delay(ib_time) = 0x%x, ", statep,
6895 6792                      cm_rep_msgp->rep_target_delay_plus >> 3);
6896 6793  
6897 6794                  IBTF_DPRINTF_L5(cmlog, "ibcm_process_cep_rep_cm_hdlr: statep %p"
6898 6795                      " rnr_retry_cnt = 0x%x", statep,
6899 6796                      cm_rep_msgp->rep_rnr_retry_cnt_plus >> 5);
6900 6797  
6901      -                _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*statep))
6902 6798                  statep->starting_psn =
6903 6799                      b2h32(cm_rep_msgp->rep_starting_psn_plus) >> 8;
6904 6800  
6905      -                _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*statep))
6906      -
6907 6801                  /* Call IBTL CM's qp modify function from Init to RTR */
6908 6802                  if (ibcm_invoke_qp_modify(statep,
6909 6803                      (ibcm_req_msg_t *)IBCM_OUT_MSGP(statep->stored_msg),
6910 6804                      cm_rep_msgp) != IBT_SUCCESS) {
6911 6805  
6912 6806                          IBTF_DPRINTF_L2(cmlog, "ibcm_process_cep_rep_cm_hdlr: "
6913 6807                              "statep %p, ibcm_invoke_qp_modify to RTR failed",
6914 6808                              statep);
6915 6809                          *reject_reason = IBT_CM_NO_RESC;
6916 6810                  /*
↓ open down ↓ 27 lines elided ↑ open up ↑
6944 6838                              IBCM_OUT_MSGP(statep->stored_msg);
6945 6839                          bcopy(clnt_info->priv_data, rtu_msgp->rtu_private_data,
6946 6840                              min(IBT_RTU_PRIV_DATA_SZ,
6947 6841                              clnt_info->priv_data_len));
6948 6842                  }
6949 6843  
6950 6844                  *reject_reason = IBT_CM_SUCCESS;
6951 6845                  return (rval);
6952 6846          }
6953 6847  
6954      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*rej_msgp))
6955      -
6956 6848          /* Fill up the REJ fields, from ret_args */
6957 6849          rej_msgp = (ibcm_rej_msg_t *)IBCM_OUT_MSGP(statep->stored_msg);
6958 6850          rej_msgp->rej_msg_type_plus = IBT_CM_FAILURE_REP << 6;
6959 6851  
6960 6852          /* if priv_len != 0 use priv_data to copy back to rej_priv_data */
6961 6853          if (clnt_info->priv_data_len != 0)
6962 6854                  bcopy(clnt_info->priv_data, rej_msgp->rej_private_data,
6963 6855                      min(IBT_REJ_PRIV_DATA_SZ, clnt_info->priv_data_len));
6964 6856  
6965 6857          if (clnt_info->reply_event != NULL)
6966 6858                  *arej_len =
6967 6859                      min(clnt_info->reply_event->rej.ari_consumer.rej_ari_len,
6968 6860                      IBT_CM_ADDL_REJ_LEN);
6969 6861  
6970      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(clnt_info->reply_event->rej))
6971      -
6972 6862          if (*arej_len != 0)     /* asserts that clnt_info->reply_event != 0 */
6973 6863                  bcopy(clnt_info->reply_event->rej.ari_consumer.rej_ari,
6974 6864                      &rej_msgp->rej_addl_rej_info, *arej_len);
6975 6865  
6976      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(clnt_info->reply_event->rej))
6977      -
6978      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*rej_msgp))
6979      -
6980 6866          rval = IBCM_SEND_REJ;
6981 6867  
6982 6868          /* Disassociate statep and QP */
6983 6869          IBCM_SET_CHAN_PRIVATE(statep->channel, NULL);
6984 6870  
6985 6871          /* callback client, to enable client to do resource cleanup */
6986 6872          ibcm_handler_conn_fail(statep, IBT_CM_FAILURE_REJ_SENT,
6987 6873              IBT_CM_FAILURE_REP, *reject_reason, NULL, 0);
6988 6874  
6989 6875          return (rval);
↓ open down ↓ 355 lines elided ↑ open up ↑
7345 7231  /* Used to initialize client args with addl rej information from REJ MAD */
7346 7232  static void
7347 7233  ibcm_copy_addl_rej(ibcm_state_data_t *statep, ibcm_rej_msg_t *rej_msgp,
7348 7234      ibt_cm_conn_failed_t *failed)
7349 7235  {
7350 7236          uint16_t        rej_reason = b2h16(rej_msgp->rej_rejection_reason);
7351 7237          uint8_t         ari_len = rej_msgp->rej_reject_info_len_plus >> 1;
7352 7238          ibcm_classportinfo_msg_t tclp;
7353 7239          ibt_arej_info_t *cf_addl = &failed->cf_additional;
7354 7240  
7355      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*cf_addl))
7356      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(failed->cf_arej_info_valid))
7357      -
7358 7241          failed->cf_arej_info_valid = B_FALSE;
7359 7242  
7360 7243          IBTF_DPRINTF_L3(cmlog, "ibcm_copy_addl_rej: rej_reason = %d "
7361 7244              "ari_len = %d", rej_reason, ari_len);
7362 7245  
7363 7246          if ((statep->mode == IBCM_PASSIVE_MODE) &&
7364 7247              (rej_reason != IBT_CM_CONSUMER))
7365 7248                  return;
7366 7249  
7367 7250          switch (rej_reason) {
↓ open down ↓ 86 lines elided ↑ open up ↑
7454 7337                  if (ari_len < 3)        /* 3 bytes needed for 20 bits */
7455 7338                          break;
7456 7339                  failed->cf_arej_info_valid = B_TRUE;
7457 7340                  /* take the first 20 bits */
7458 7341                  cf_addl->ari_flow =
7459 7342                      b2h32(*(uint32_t *)&rej_msgp->rej_addl_rej_info) >> 12;
7460 7343                  break;
7461 7344          default:
7462 7345                  break;
7463 7346          }
7464      -
7465      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(failed->cf_arej_info_valid))
7466      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*cf_addl))
7467 7347  }
7468 7348  
7469 7349  
7470 7350  /* Used to copy classportinfo to MAD from client initialized args */
7471 7351  static void
7472 7352  ibcm_init_clp_to_mad(ibcm_classportinfo_msg_t *clp, ibt_redirect_info_t *rinfo)
7473 7353  {
7474 7354  
7475      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*clp))
7476      -
7477 7355          bcopy(&ibcm_clpinfo, clp, sizeof (ibcm_clpinfo));
7478 7356  
7479 7357          clp->RedirectGID_hi = h2b64(rinfo->rdi_gid.gid_prefix);
7480 7358          clp->RedirectGID_lo = h2b64(rinfo->rdi_gid.gid_guid);
7481 7359          clp->RedirectTC_plus =
7482 7360              h2b32((rinfo->rdi_tclass << 24) | (rinfo->rdi_sl << 20) |
7483 7361              (rinfo->rdi_flow & 0xfffff));
7484 7362          clp->RedirectLID = h2b16(rinfo->rdi_dlid);
7485 7363          clp->RedirectQP_plus = h2b32(rinfo->rdi_qpn & 0xffffff);
7486 7364          clp->RedirectQ_Key = h2b32(rinfo->rdi_qkey);
7487 7365          clp->RedirectP_Key = h2b16(rinfo->rdi_pkey);
7488 7366  
7489 7367          IBTF_DPRINTF_L4(cmlog, "ibcm_init_clp_to_mad: RedirectGID= %llX:%llX,"
7490 7368              " RedirectLID= 0x%lX", clp->RedirectGID_hi, clp->RedirectGID_lo,
7491 7369              clp->RedirectLID);
7492      -
7493      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*clp))
7494 7370  }
7495 7371  
7496 7372  
7497 7373  /* Used to initialize classportinfo to be returned to clients, from MAD */
7498 7374  static void
7499 7375  ibcm_init_clp_from_mad(ibcm_classportinfo_msg_t *clp,
7500 7376      ibt_redirect_info_t *rinfo)
7501 7377  {
7502 7378          uint32_t temp32;
7503 7379  
↓ open down ↓ 215 lines elided ↑ open up ↑
7719 7595                   * begins at offset 24 in sidr rep
7720 7596                   */
7721 7597                          ibcm_init_clp_to_mad(
7722 7598                              (ibcm_classportinfo_msg_t *)
7723 7599                              &sidr_repp->sidr_rep_class_port_info,
7724 7600                              ud_clnt_info->redirect_infop);
7725 7601                  }
7726 7602                  return;
7727 7603          }
7728 7604  
7729      -
7730      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*sidr_repp))
7731      -
7732 7605          sidr_repp->sidr_rep_qkey =
7733 7606              h2b32(ud_clnt_info->ud_qkey);
7734 7607          sidr_repp->sidr_rep_qpn_plus = h2b32(ud_clnt_info->ud_qpn << 8);
7735      -
7736      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*sidr_repp))
7737 7608  }
7738 7609  
7739 7610  /*
7740 7611   * ibcm_sidr_rep_ud_handler:
7741 7612   *      Invoke Client's UD handler For SIDR_REP msg
7742 7613   *
7743 7614   * INPUTS:
7744 7615   *      ud_statep       - ud_state pointer
7745 7616   *      sidr_rep_msgp   - SIDR_REQ message pointer
7746 7617   *
↓ open down ↓ 223 lines elided ↑ open up ↑
7970 7841      ibcm_apr_msg_t *apr_msg)
7971 7842  {
7972 7843          ibt_cm_event_t          event;
7973 7844          ibt_cm_return_args_t    ret_args;
7974 7845          ibt_cm_status_t         cb_status;
7975 7846          ibcm_clnt_reply_info_t  clnt_info;
7976 7847  
7977 7848  
7978 7849          IBTF_DPRINTF_L4(cmlog, "ibcm_cep_state_lap: statep 0x%p", statep);
7979 7850  
7980      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*apr_msg))
7981      -
7982 7851          /* If APM is not supported, return error */
7983 7852          if (!(statep->hcap->hca_caps & IBT_HCA_AUTO_PATH_MIG)) {
7984 7853                  apr_msg->apr_ap_status = IBT_CM_AP_NOT_SUPPORTED;
7985 7854                  return (IBCM_SEND_APR);
7986 7855          }
7987 7856  
7988 7857          if (statep->local_qpn !=
7989 7858              b2h32(lap_msg->lap_remote_qpn_eecn_plus) >> 8) {
7990 7859                  apr_msg->apr_ap_status = IBT_CM_AP_REJECT;
7991 7860                  IBTF_DPRINTF_L4(cmlog, "ibcm_cep_state_lap: local_qpn %x does "
7992 7861                      "not match remote's remote_qpn %x", statep->local_qpn,
7993 7862                      b2h32(lap_msg->lap_remote_qpn_eecn_plus) >> 8);
7994 7863                  return (IBCM_SEND_APR);
7995 7864          }
7996 7865  
7997      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*apr_msg))
7998      -
7999 7866          /* Fill up the event */
8000 7867          bzero(&event, sizeof (event));
8001 7868          event.cm_type = IBT_CM_EVENT_LAP_RCV;
8002 7869          event.cm_channel = statep->channel;
8003 7870          event.cm_session_id = statep;
8004 7871          event.cm_priv_data = lap_msg->lap_private_data;
8005 7872          event.cm_priv_data_len =  IBT_LAP_PRIV_DATA_SZ;
8006 7873          event.cm_event.lap.lap_timeout = ibt_ib2usec(
8007 7874              ((uint8_t *)&lap_msg->lap_remote_qpn_eecn_plus)[3] >> 3);
8008 7875  
8009 7876          ibcm_fill_adds_from_lap(&event.cm_event.lap.lap_alternate_path,
8010 7877              lap_msg, IBCM_PASSIVE_MODE);
8011 7878  
8012 7879          cb_status = statep->cm_handler(statep->state_cm_private, &event,
8013 7880              &ret_args, apr_msg->apr_private_data, IBT_APR_PRIV_DATA_SZ);
8014 7881  
8015 7882          IBTF_DPRINTF_L3(cmlog, "ibcm_cep_state_lap: cb_status = %d", cb_status);
8016 7883          if (cb_status == IBT_CM_DEFER) {
8017      -
8018      -                _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(statep->defer_cm_msg))
8019      -
8020 7884                  if (statep->defer_cm_msg == NULL)
8021 7885                          statep->defer_cm_msg =
8022 7886                              kmem_zalloc(IBCM_MSG_SIZE, KM_SLEEP);
8023 7887                  bcopy(lap_msg, statep->defer_cm_msg, IBCM_MSG_SIZE);
8024      -
8025      -                _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(statep->defer_cm_msg))
8026      -
8027 7888                  /* unblock any blocked cm proceed api calls */
8028 7889                  mutex_enter(&statep->state_mutex);
8029 7890                  statep->clnt_proceed = IBCM_UNBLOCK;
8030 7891                  cv_broadcast(&statep->block_client_cv);
8031 7892                  mutex_exit(&statep->state_mutex);
8032 7893  
8033 7894                  return (IBCM_DEFER);
8034 7895          }
8035 7896  
8036 7897          clnt_info.reply_event = (ibt_cm_proceed_reply_t *)&ret_args.cm_ret;
↓ open down ↓ 76 lines elided ↑ open up ↑
8113 7974  {
8114 7975          ibtl_cm_hca_port_t      port;
8115 7976          ibt_qp_query_attr_t     qp_attrs;
8116 7977          ibt_cep_modify_flags_t  cep_flags;
8117 7978          ibt_status_t            status;
8118 7979          ibt_adds_vect_t         *adds;
8119 7980  
8120 7981          if (cb_status == IBT_CM_DEFAULT)
8121 7982                  cb_status = IBT_CM_REJECT;
8122 7983  
8123      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*apr_msg))
8124      -
8125 7984          /* verify status */
8126 7985          apr_msg->apr_addl_info_len = 0;
8127 7986          if (cb_status == IBT_CM_ACCEPT) {
8128 7987                  apr_msg->apr_ap_status = IBT_CM_AP_LOADED;
8129 7988          } else if (cb_status == IBT_CM_REJECT) {
8130 7989                  apr_msg->apr_ap_status = IBT_CM_AP_REJECT;
8131 7990          } else if (cb_status == IBT_CM_REDIRECT) {
8132 7991                  apr_msg->apr_ap_status = IBT_CM_AP_REDIRECT;
8133 7992                  /* copy redirect info to APR */
8134 7993                  apr_msg->apr_addl_info_len = sizeof (ibcm_classportinfo_msg_t);
↓ open down ↓ 90 lines elided ↑ open up ↑
8225 8084          print_modify_qp("PASSIVE LAP QUERY", statep->channel,
8226 8085              cep_flags, &qp_attrs.qp_info);
8227 8086  #endif
8228 8087  
8229 8088          if (status != IBT_SUCCESS) {
8230 8089                  apr_msg->apr_ap_status = IBT_CM_AP_REJECT;
8231 8090                  IBTF_DPRINTF_L2(cmlog, "ibcm_process_cep_lap_cm_hdlr:"
8232 8091                      " ibt_modify_qp() returned = %d", status);
8233 8092                  return;
8234 8093          }
8235      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*apr_msg))
8236 8094  }
8237 8095  
8238 8096  
8239 8097  /*
8240 8098   * ibcm_post_apr_mad:
8241 8099   *      Posts a APR MAD and starts timer
8242 8100   *
8243 8101   * INPUTS:
8244 8102   *      statep          - state pointer
8245 8103   *
8246 8104   * RETURN VALUE: NONE
8247 8105   */
8248 8106  void
8249 8107  ibcm_post_apr_mad(ibcm_state_data_t *statep)
8250 8108  {
8251 8109          ibcm_apr_msg_t  *apr_msgp;
8252 8110  
8253      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*apr_msgp))
8254      -
8255 8111          apr_msgp = (ibcm_apr_msg_t *)IBCM_OUT_MSGP(statep->lapr_msg);
8256 8112  
8257 8113          apr_msgp->apr_local_comm_id = h2b32(statep->local_comid);
8258 8114          apr_msgp->apr_remote_comm_id = h2b32(statep->remote_comid);
8259 8115          IBCM_OUT_HDRP(statep->lapr_msg)->AttributeID =
8260 8116              h2b16(IBCM_INCOMING_APR + IBCM_ATTR_BASE_ID);
8261 8117  
8262      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*apr_msgp))
8263      -
8264 8118          ibcm_insert_trace(statep, IBCM_TRACE_OUTGOING_APR);
8265 8119  
8266 8120          ibcm_post_rc_mad(statep, statep->lapr_msg, ibcm_post_apr_complete,
8267 8121              statep);
8268 8122  }
8269 8123  
8270 8124  /*
8271 8125   * ibcm_process_apr_msg:
8272 8126   *      This call processes an incoming APR message
8273 8127   *
↓ open down ↓ 92 lines elided ↑ open up ↑
8366 8220      ibt_arej_info_t *ari, boolean_t *ari_valid)
8367 8221  {
8368 8222          uint8_t ari_len = apr_msgp->apr_addl_info_len;
8369 8223          ibcm_classportinfo_msg_t tclp;
8370 8224  
8371 8225          *ari_valid = B_FALSE;
8372 8226  
8373 8227          IBTF_DPRINTF_L3(cmlog, "ibcm_set_apr_arej: apr_status = %d "
8374 8228              "ari_len = %d", ap_status, ari_len);
8375 8229  
8376      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*ari))
8377      -
8378 8230          switch (ap_status) {
8379 8231          case IBT_CM_AP_REDIRECT:
8380 8232                  if (ari_len < sizeof (ibcm_classportinfo_msg_t))
8381 8233                          break;
8382 8234                  *ari_valid = B_TRUE;
8383 8235                  bcopy(apr_msgp->apr_addl_info, &tclp, sizeof (tclp));
8384 8236                  ibcm_init_clp_from_mad(&tclp, &ari->ari_redirect);
8385 8237                  break;
8386 8238          case IBT_CM_AP_RLID_REJECTED:
8387 8239                  if (ari_len < sizeof (ib_lid_t))
↓ open down ↓ 47 lines elided ↑ open up ↑
8435 8287          case IBT_CM_AP_SL_REJECTED:
8436 8288                  if (ari_len < 1)
8437 8289                          break;
8438 8290                  *ari_valid = B_TRUE;
8439 8291                  /* take the first 4 bits */
8440 8292                  ari->ari_sl = apr_msgp->apr_addl_info[0] >> 4;
8441 8293                  break;
8442 8294          default:
8443 8295                  break;
8444 8296          }
8445      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*ari))
8446 8297  }
8447 8298  
8448 8299  /*
8449 8300   * ibcm_cep_state_apr:
8450 8301   *      This call processes an incoming APR message
8451 8302   *
8452 8303   * INPUTS:
8453 8304   *      statep          - pointer to ibcm_state_data_t
8454 8305   *      lap_msg         - lap msg sent earlier
8455 8306   *      apr_msg         - apr msg received
↓ open down ↓ 197 lines elided ↑ open up ↑
8653 8504  ibcm_sync_lapr_idle(ibcm_state_data_t *statep)
8654 8505  {
8655 8506          timeout_id_t    timer_val = statep->timerid;
8656 8507          ibt_cm_event_t  event;
8657 8508  
8658 8509          IBTF_DPRINTF_L3(cmlog, "ibcm_sync_lapr_idle:"
8659 8510              "statep %p state %d ap_state %d", statep, statep->state,
8660 8511              statep->ap_state);
8661 8512  
8662 8513          ASSERT(MUTEX_HELD(&statep->state_mutex));
8663      -        _NOTE(LOCK_RELEASED_AS_SIDE_EFFECT(&statep->state_mutex))
8664 8514  
8665 8515          /* Busy AP states on active/passive sides */
8666 8516          if ((statep->ap_state == IBCM_AP_STATE_LAP_RCVD) ||
8667 8517              (statep->ap_state == IBCM_AP_STATE_APR_RCVD) ||
8668 8518              (statep->ap_state == IBCM_AP_STATE_MRA_LAP_SENT) ||
8669 8519              (statep->ap_state == IBCM_AP_STATE_TIMED_OUT)) {
8670 8520  
8671 8521                  /* wait till ap_state becomes IBCM_AP_STATE_IDLE */
8672 8522                  while (statep->ap_state != IBCM_AP_STATE_IDLE)
8673 8523                          cv_wait(&statep->block_mad_cv, &statep->state_mutex);
↓ open down ↓ 130 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX