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

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/ib/clients/ibd/ibd.c
          +++ new/usr/src/uts/common/io/ib/clients/ibd/ibd.c
↓ open down ↓ 611 lines elided ↑ open up ↑
 612  612              ddi_driver_name(state->id_dip), ddi_get_instance(state->id_dip),
 613  613              (u_longlong_t)hca_guid, state->id_port, state->id_pkey,
 614  614              part_name);
 615  615          va_start(ap, fmt);
 616  616          (void) vsnprintf(ibd_print_buf + len, sizeof (ibd_print_buf) - len,
 617  617              fmt, ap);
 618  618          cmn_err(CE_NOTE, "!%s", ibd_print_buf);
 619  619          va_end(ap);
 620  620  }
 621  621  
 622      -/*
 623      - * Warlock directives
 624      - */
 625      -
 626      -/*
 627      - * id_lso_lock
 628      - *
 629      - * state->id_lso->bkt_nfree may be accessed without a lock to
 630      - * determine the threshold at which we have to ask the nw layer
 631      - * to resume transmission (see ibd_resume_transmission()).
 632      - */
 633      -_NOTE(MUTEX_PROTECTS_DATA(ibd_state_t::id_lso_lock,
 634      -    ibd_state_t::id_lso))
 635      -_NOTE(DATA_READABLE_WITHOUT_LOCK(ibd_state_t::id_lso))
 636      -_NOTE(SCHEME_PROTECTS_DATA("init", ibd_state_t::id_lso_policy))
 637      -_NOTE(DATA_READABLE_WITHOUT_LOCK(ibd_lsobkt_t::bkt_nfree))
 638      -
 639      -/*
 640      - * id_scq_poll_lock
 641      - */
 642      -_NOTE(MUTEX_PROTECTS_DATA(ibd_state_t::id_scq_poll_lock,
 643      -    ibd_state_t::id_scq_poll_busy))
 644      -
 645      -/*
 646      - * id_txpost_lock
 647      - */
 648      -_NOTE(MUTEX_PROTECTS_DATA(ibd_state_t::id_txpost_lock,
 649      -    ibd_state_t::id_tx_head))
 650      -_NOTE(MUTEX_PROTECTS_DATA(ibd_state_t::id_txpost_lock,
 651      -    ibd_state_t::id_tx_busy))
 652      -
 653      -/*
 654      - * id_acache_req_lock
 655      - */
 656      -_NOTE(MUTEX_PROTECTS_DATA(ibd_state_t::id_acache_req_lock, 
 657      -    ibd_state_t::id_acache_req_cv))
 658      -_NOTE(MUTEX_PROTECTS_DATA(ibd_state_t::id_acache_req_lock, 
 659      -    ibd_state_t::id_req_list))
 660      -_NOTE(SCHEME_PROTECTS_DATA("atomic",
 661      -    ibd_acache_s::ac_ref))
 662      -
 663      -/*
 664      - * id_ac_mutex
 665      - *
 666      - * This mutex is actually supposed to protect id_ah_op as well,
 667      - * but this path of the code isn't clean (see update of id_ah_op
 668      - * in ibd_async_acache(), immediately after the call to
 669      - * ibd_async_mcache()). For now, we'll skip this check by
 670      - * declaring that id_ah_op is protected by some internal scheme
 671      - * that warlock isn't aware of.
 672      - */
 673      -_NOTE(MUTEX_PROTECTS_DATA(ibd_state_t::id_ac_mutex,
 674      -    ibd_state_t::id_ah_active))
 675      -_NOTE(MUTEX_PROTECTS_DATA(ibd_state_t::id_ac_mutex,
 676      -    ibd_state_t::id_ah_free))
 677      -_NOTE(MUTEX_PROTECTS_DATA(ibd_state_t::id_ac_mutex,
 678      -    ibd_state_t::id_ah_addr))
 679      -_NOTE(SCHEME_PROTECTS_DATA("ac mutex should protect this",
 680      -    ibd_state_t::id_ah_op))
 681      -_NOTE(MUTEX_PROTECTS_DATA(ibd_state_t::id_ac_mutex,
 682      -    ibd_state_t::id_ah_error))
 683      -_NOTE(MUTEX_PROTECTS_DATA(ibd_state_t::id_ac_mutex,
 684      -    ibd_state_t::id_ac_hot_ace))
 685      -_NOTE(DATA_READABLE_WITHOUT_LOCK(ibd_state_t::id_ah_error))
 686      -
 687      -/*
 688      - * id_mc_mutex
 689      - */
 690      -_NOTE(MUTEX_PROTECTS_DATA(ibd_state_t::id_mc_mutex,
 691      -    ibd_state_t::id_mc_full))
 692      -_NOTE(MUTEX_PROTECTS_DATA(ibd_state_t::id_mc_mutex,
 693      -    ibd_state_t::id_mc_non))
 694      -
 695      -/*
 696      - * id_trap_lock
 697      - */
 698      -_NOTE(MUTEX_PROTECTS_DATA(ibd_state_t::id_trap_lock,
 699      -    ibd_state_t::id_trap_cv))
 700      -_NOTE(MUTEX_PROTECTS_DATA(ibd_state_t::id_trap_lock,
 701      -    ibd_state_t::id_trap_stop))
 702      -_NOTE(MUTEX_PROTECTS_DATA(ibd_state_t::id_trap_lock,
 703      -    ibd_state_t::id_trap_inprog))
 704      -
 705      -/*
 706      - * id_prom_op
 707      - */
 708      -_NOTE(SCHEME_PROTECTS_DATA("only by async thread",
 709      -    ibd_state_t::id_prom_op))
 710      -
 711      -/*
 712      - * id_sched_lock
 713      - */
 714      -_NOTE(MUTEX_PROTECTS_DATA(ibd_state_t::id_sched_lock,
 715      -    ibd_state_t::id_sched_needed))
 716      -
 717      -/*
 718      - * id_link_mutex
 719      - */
 720      -_NOTE(MUTEX_PROTECTS_DATA(ibd_state_t::id_link_mutex, 
 721      -    ibd_state_t::id_link_state))
 722      -_NOTE(DATA_READABLE_WITHOUT_LOCK(ibd_state_t::id_link_state))
 723      -_NOTE(SCHEME_PROTECTS_DATA("only async thr and ibd_m_start",
 724      -    ibd_state_t::id_link_speed))
 725      -_NOTE(DATA_READABLE_WITHOUT_LOCK(ibd_state_t::id_sgid))
 726      -
 727      -/*
 728      - * id_tx_list.dl_mutex
 729      - */
 730      -_NOTE(MUTEX_PROTECTS_DATA(ibd_state_t::id_tx_list.dl_mutex,
 731      -    ibd_state_t::id_tx_list.dl_head))
 732      -_NOTE(MUTEX_PROTECTS_DATA(ibd_state_t::id_tx_list.dl_mutex,
 733      -    ibd_state_t::id_tx_list.dl_pending_sends))
 734      -_NOTE(MUTEX_PROTECTS_DATA(ibd_state_t::id_tx_list.dl_mutex,
 735      -    ibd_state_t::id_tx_list.dl_cnt))
 736      -
 737      -/*
 738      - * id_rx_list.dl_mutex
 739      - */
 740      -_NOTE(SCHEME_PROTECTS_DATA("atomic or dl mutex or single thr",
 741      -    ibd_state_t::id_rx_list.dl_bufs_outstanding))
 742      -_NOTE(SCHEME_PROTECTS_DATA("atomic or dl mutex or single thr",
 743      -    ibd_state_t::id_rx_list.dl_cnt))
 744      -
 745      -/*
 746      - * rc_timeout_lock
 747      - */
 748      -_NOTE(MUTEX_PROTECTS_DATA(ibd_state_t::rc_timeout_lock,
 749      -    ibd_state_t::rc_timeout_start))
 750      -_NOTE(MUTEX_PROTECTS_DATA(ibd_state_t::rc_timeout_lock,
 751      -    ibd_state_t::rc_timeout))
 752      -
 753      -
 754      -/*
 755      - * Items protected by atomic updates
 756      - */
 757      -_NOTE(SCHEME_PROTECTS_DATA("atomic update only",
 758      -    ibd_state_s::id_brd_rcv
 759      -    ibd_state_s::id_brd_xmt
 760      -    ibd_state_s::id_multi_rcv
 761      -    ibd_state_s::id_multi_xmt
 762      -    ibd_state_s::id_num_intrs
 763      -    ibd_state_s::id_rcv_bytes
 764      -    ibd_state_s::id_rcv_pkt
 765      -    ibd_state_s::id_rx_post_queue_index
 766      -    ibd_state_s::id_tx_short
 767      -    ibd_state_s::id_xmt_bytes
 768      -    ibd_state_s::id_xmt_pkt
 769      -    ibd_state_s::rc_rcv_trans_byte
 770      -    ibd_state_s::rc_rcv_trans_pkt
 771      -    ibd_state_s::rc_rcv_copy_byte
 772      -    ibd_state_s::rc_rcv_copy_pkt
 773      -    ibd_state_s::rc_xmt_bytes
 774      -    ibd_state_s::rc_xmt_small_pkt
 775      -    ibd_state_s::rc_xmt_fragmented_pkt
 776      -    ibd_state_s::rc_xmt_map_fail_pkt
 777      -    ibd_state_s::rc_xmt_map_succ_pkt
 778      -    ibd_rc_chan_s::rcq_invoking))
 779      -
 780      -/*
 781      - * Non-mutex protection schemes for data elements. Almost all of
 782      - * these are non-shared items.
 783      - */
 784      -_NOTE(SCHEME_PROTECTS_DATA("unshared or single-threaded",
 785      -    callb_cpr
 786      -    ib_gid_s
 787      -    ib_header_info
 788      -    ibd_acache_rq
 789      -    ibd_acache_s::ac_mce
 790      -    ibd_acache_s::ac_chan
 791      -    ibd_mcache::mc_fullreap
 792      -    ibd_mcache::mc_jstate
 793      -    ibd_mcache::mc_req
 794      -    ibd_rwqe_s
 795      -    ibd_swqe_s
 796      -    ibd_wqe_s
 797      -    ibt_wr_ds_s::ds_va
 798      -    ibt_wr_lso_s
 799      -    ipoib_mac::ipoib_qpn
 800      -    mac_capab_lso_s
 801      -    msgb::b_next
 802      -    msgb::b_cont
 803      -    msgb::b_rptr
 804      -    msgb::b_wptr
 805      -    ibd_state_s::id_bgroup_created
 806      -    ibd_state_s::id_mac_state
 807      -    ibd_state_s::id_mtu
 808      -    ibd_state_s::id_ud_num_rwqe
 809      -    ibd_state_s::id_ud_num_swqe
 810      -    ibd_state_s::id_qpnum
 811      -    ibd_state_s::id_rcq_hdl
 812      -    ibd_state_s::id_rx_buf_sz
 813      -    ibd_state_s::id_rx_bufs
 814      -    ibd_state_s::id_rx_mr_hdl
 815      -    ibd_state_s::id_rx_wqes
 816      -    ibd_state_s::id_rxwcs
 817      -    ibd_state_s::id_rxwcs_size
 818      -    ibd_state_s::id_rx_nqueues
 819      -    ibd_state_s::id_rx_queues
 820      -    ibd_state_s::id_scope
 821      -    ibd_state_s::id_scq_hdl
 822      -    ibd_state_s::id_tx_buf_sz
 823      -    ibd_state_s::id_tx_bufs
 824      -    ibd_state_s::id_tx_mr_hdl
 825      -    ibd_state_s::id_tx_rel_list.dl_cnt
 826      -    ibd_state_s::id_tx_wqes
 827      -    ibd_state_s::id_txwcs
 828      -    ibd_state_s::id_txwcs_size
 829      -    ibd_state_s::rc_listen_hdl
 830      -    ibd_state_s::rc_listen_hdl_OFED_interop
 831      -    ibd_state_s::rc_srq_size
 832      -    ibd_state_s::rc_srq_rwqes
 833      -    ibd_state_s::rc_srq_rx_bufs
 834      -    ibd_state_s::rc_srq_rx_mr_hdl
 835      -    ibd_state_s::rc_tx_largebuf_desc_base
 836      -    ibd_state_s::rc_tx_mr_bufs
 837      -    ibd_state_s::rc_tx_mr_hdl
 838      -    ipha_s
 839      -    icmph_s
 840      -    ibt_path_info_s::pi_sid
 841      -    ibd_rc_chan_s::ace
 842      -    ibd_rc_chan_s::chan_hdl
 843      -    ibd_rc_chan_s::state
 844      -    ibd_rc_chan_s::chan_state
 845      -    ibd_rc_chan_s::is_tx_chan
 846      -    ibd_rc_chan_s::rcq_hdl
 847      -    ibd_rc_chan_s::rcq_size
 848      -    ibd_rc_chan_s::scq_hdl
 849      -    ibd_rc_chan_s::scq_size
 850      -    ibd_rc_chan_s::rx_bufs
 851      -    ibd_rc_chan_s::rx_mr_hdl
 852      -    ibd_rc_chan_s::rx_rwqes
 853      -    ibd_rc_chan_s::tx_wqes
 854      -    ibd_rc_chan_s::tx_mr_bufs
 855      -    ibd_rc_chan_s::tx_mr_hdl
 856      -    ibd_rc_chan_s::tx_rel_list.dl_cnt
 857      -    ibd_rc_chan_s::is_used
 858      -    ibd_rc_tx_largebuf_s::lb_buf
 859      -    ibd_rc_msg_hello_s
 860      -    ibt_cm_return_args_s))
 861      -
 862      -/*
 863      - * ibd_rc_chan_s::next is protected by two mutexes:
 864      - * 1) ibd_state_s::rc_pass_chan_list.chan_list_mutex
 865      - * 2) ibd_state_s::rc_obs_act_chan_list.chan_list_mutex.
 866      - */
 867      -_NOTE(SCHEME_PROTECTS_DATA("protected by two mutexes",
 868      -    ibd_rc_chan_s::next))
 869      -
 870      -/*
 871      - * ibd_state_s.rc_tx_large_bufs_lock
 872      - */
 873      -_NOTE(MUTEX_PROTECTS_DATA(ibd_state_s::rc_tx_large_bufs_lock,
 874      -    ibd_state_s::rc_tx_largebuf_free_head))
 875      -_NOTE(MUTEX_PROTECTS_DATA(ibd_state_s::rc_tx_large_bufs_lock,
 876      -    ibd_state_s::rc_tx_largebuf_nfree))
 877      -_NOTE(MUTEX_PROTECTS_DATA(ibd_state_s::rc_tx_large_bufs_lock,
 878      -    ibd_rc_tx_largebuf_s::lb_next))
 879      -
 880      -/*
 881      - * ibd_acache_s.tx_too_big_mutex
 882      - */
 883      -_NOTE(MUTEX_PROTECTS_DATA(ibd_acache_s::tx_too_big_mutex,
 884      -    ibd_acache_s::tx_too_big_ongoing))
 885      -
 886      -/*
 887      - * tx_wqe_list.dl_mutex
 888      - */
 889      -_NOTE(MUTEX_PROTECTS_DATA(ibd_rc_chan_s::tx_wqe_list.dl_mutex,
 890      -    ibd_rc_chan_s::tx_wqe_list.dl_head))
 891      -_NOTE(MUTEX_PROTECTS_DATA(ibd_rc_chan_s::tx_wqe_list.dl_mutex,
 892      -    ibd_rc_chan_s::tx_wqe_list.dl_pending_sends))
 893      -_NOTE(MUTEX_PROTECTS_DATA(ibd_rc_chan_s::tx_wqe_list.dl_mutex,
 894      -    ibd_rc_chan_s::tx_wqe_list.dl_cnt))
 895      -
 896      -/*
 897      - * ibd_state_s.rc_ace_recycle_lock
 898      - */
 899      -_NOTE(MUTEX_PROTECTS_DATA(ibd_state_s::rc_ace_recycle_lock,
 900      -    ibd_state_s::rc_ace_recycle))
 901      -
 902      -/*
 903      - * rc_srq_rwqe_list.dl_mutex
 904      - */
 905      -_NOTE(SCHEME_PROTECTS_DATA("atomic or dl mutex or single thr",
 906      -    ibd_state_t::rc_srq_rwqe_list.dl_bufs_outstanding))
 907      -_NOTE(SCHEME_PROTECTS_DATA("atomic or dl mutex or single thr",
 908      -    ibd_state_t::rc_srq_rwqe_list.dl_cnt))
 909      -
 910      -/*
 911      - * Non-mutex protection schemes for data elements. They are counters
 912      - * for problem diagnosis. Don't need be protected.
 913      - */
 914      -_NOTE(SCHEME_PROTECTS_DATA("counters for problem diagnosis",
 915      -    ibd_state_s::rc_rcv_alloc_fail
 916      -    ibd_state_s::rc_rcq_err
 917      -    ibd_state_s::rc_ace_not_found
 918      -    ibd_state_s::rc_xmt_drop_too_long_pkt
 919      -    ibd_state_s::rc_xmt_icmp_too_long_pkt
 920      -    ibd_state_s::rc_xmt_reenter_too_long_pkt
 921      -    ibd_state_s::rc_swqe_short
 922      -    ibd_state_s::rc_swqe_mac_update
 923      -    ibd_state_s::rc_xmt_buf_short
 924      -    ibd_state_s::rc_xmt_buf_mac_update
 925      -    ibd_state_s::rc_scq_no_swqe
 926      -    ibd_state_s::rc_scq_no_largebuf
 927      -    ibd_state_s::rc_conn_succ
 928      -    ibd_state_s::rc_conn_fail
 929      -    ibd_state_s::rc_null_conn
 930      -    ibd_state_s::rc_no_estab_conn
 931      -    ibd_state_s::rc_act_close
 932      -    ibd_state_s::rc_pas_close
 933      -    ibd_state_s::rc_delay_ace_recycle
 934      -    ibd_state_s::rc_act_close_simultaneous
 935      -    ibd_state_s::rc_act_close_not_clean
 936      -    ibd_state_s::rc_pas_close_rcq_invoking
 937      -    ibd_state_s::rc_reset_cnt
 938      -    ibd_state_s::rc_timeout_act
 939      -    ibd_state_s::rc_timeout_pas
 940      -    ibd_state_s::rc_stop_connect))
 941      -
 942      -#ifdef DEBUG
 943      -/*
 944      - * Non-mutex protection schemes for data elements. They are counters
 945      - * for problem diagnosis. Don't need be protected.
 946      - */
 947      -_NOTE(SCHEME_PROTECTS_DATA("counters for problem diagnosis",
 948      -    ibd_state_s::rc_rwqe_short
 949      -    ibd_rc_stat_s::rc_rcv_trans_byte
 950      -    ibd_rc_stat_s::rc_rcv_trans_pkt
 951      -    ibd_rc_stat_s::rc_rcv_copy_byte
 952      -    ibd_rc_stat_s::rc_rcv_copy_pkt
 953      -    ibd_rc_stat_s::rc_rcv_alloc_fail
 954      -    ibd_rc_stat_s::rc_rcq_err 
 955      -    ibd_rc_stat_s::rc_rwqe_short
 956      -    ibd_rc_stat_s::rc_xmt_bytes
 957      -    ibd_rc_stat_s::rc_xmt_small_pkt
 958      -    ibd_rc_stat_s::rc_xmt_fragmented_pkt
 959      -    ibd_rc_stat_s::rc_xmt_map_fail_pkt
 960      -    ibd_rc_stat_s::rc_xmt_map_succ_pkt
 961      -    ibd_rc_stat_s::rc_ace_not_found
 962      -    ibd_rc_stat_s::rc_scq_no_swqe
 963      -    ibd_rc_stat_s::rc_scq_no_largebuf
 964      -    ibd_rc_stat_s::rc_swqe_short
 965      -    ibd_rc_stat_s::rc_swqe_mac_update
 966      -    ibd_rc_stat_s::rc_xmt_buf_short
 967      -    ibd_rc_stat_s::rc_xmt_buf_mac_update
 968      -    ibd_rc_stat_s::rc_conn_succ
 969      -    ibd_rc_stat_s::rc_conn_fail
 970      -    ibd_rc_stat_s::rc_null_conn
 971      -    ibd_rc_stat_s::rc_no_estab_conn
 972      -    ibd_rc_stat_s::rc_act_close
 973      -    ibd_rc_stat_s::rc_pas_close
 974      -    ibd_rc_stat_s::rc_delay_ace_recycle
 975      -    ibd_rc_stat_s::rc_act_close_simultaneous
 976      -    ibd_rc_stat_s::rc_reset_cnt
 977      -    ibd_rc_stat_s::rc_timeout_act
 978      -    ibd_rc_stat_s::rc_timeout_pas))
 979      -#endif
 980      -
 981  622  int
 982  623  _init()
 983  624  {
 984  625          int status;
 985  626  
 986  627          status = ddi_soft_state_init(&ibd_list, max(sizeof (ibd_state_t),
 987  628              PAGESIZE), 0);
 988  629          if (status != 0) {
 989  630                  DPRINT(10, "_init:failed in ddi_soft_state_init()");
 990  631                  return (status);
↓ open down ↓ 265 lines elided ↑ open up ↑
1256  897                                          ibd_async_trap(state, ptr);
1257  898                                          break;
1258  899                                  case IBD_ASYNC_SCHED:
1259  900                                          ibd_async_txsched(state);
1260  901                                          break;
1261  902                                  case IBD_ASYNC_LINK:
1262  903                                          ibd_async_link(state, ptr);
1263  904                                          break;
1264  905                                  case IBD_ASYNC_EXIT:
1265  906                                          mutex_enter(&state->id_acache_req_lock);
1266      -#ifndef __lock_lint
1267  907                                          CALLB_CPR_EXIT(&cprinfo);
1268      -#else
1269      -                                        mutex_exit(&state->id_acache_req_lock);
1270      -#endif
1271  908                                          return;
1272  909                                  case IBD_ASYNC_RC_TOO_BIG:
1273  910                                          ibd_async_rc_process_too_big(state,
1274  911                                              ptr);
1275  912                                          break;
1276  913                                  case IBD_ASYNC_RC_CLOSE_ACT_CHAN:
1277  914                                          ibd_async_rc_close_act_chan(state, ptr);
1278  915                                          break;
1279  916                                  case IBD_ASYNC_RC_RECYCLE_ACE:
1280  917                                          ibd_async_rc_recycle_ace(state, ptr);
↓ open down ↓ 2 lines elided ↑ open up ↑
1283  920                                          (void) ibd_rc_pas_close(ptr->rq_ptr,
1284  921                                              B_TRUE, B_TRUE);
1285  922                                          break;
1286  923                          }
1287  924  free_req_and_continue:
1288  925                          if (ptr != NULL)
1289  926                                  kmem_cache_free(state->id_req_kmc, ptr);
1290  927  
1291  928                          mutex_enter(&state->id_acache_req_lock);
1292  929                  } else {
1293      -#ifndef __lock_lint
1294  930                          /*
1295  931                           * Nothing to do: wait till new request arrives.
1296  932                           */
1297  933                          CALLB_CPR_SAFE_BEGIN(&cprinfo);
1298  934                          cv_wait(&state->id_acache_req_cv,
1299  935                              &state->id_acache_req_lock);
1300  936                          CALLB_CPR_SAFE_END(&cprinfo,
1301  937                              &state->id_acache_req_lock);
1302      -#endif
1303  938                  }
1304  939          }
1305  940  
1306  941          /*NOTREACHED*/
1307  942          _NOTE(NOT_REACHED)
1308  943  }
1309  944  
1310  945  /*
1311  946   * Return when it is safe to queue requests to the async daemon; primarily
1312  947   * for subnet trap and async event handling. Disallow requests before the
↓ open down ↓ 626 lines elided ↑ open up ↑
1939 1574          DPRINT(10, "ibd_async_link(): %d", opcode);
1940 1575  
1941 1576          /*
1942 1577           * On a link up, revalidate the link speed/width. No point doing
1943 1578           * this on a link down, since we will be unable to do SA operations,
1944 1579           * defaulting to the lowest speed. Also notice that we update our
1945 1580           * notion of speed before calling mac_link_update(), which will do
1946 1581           * necessary higher level notifications for speed changes.
1947 1582           */
1948 1583          if ((opcode == IBD_LINK_UP_ABSENT) || (opcode == IBD_LINK_UP)) {
1949      -                _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*state))
1950 1584                  state->id_link_speed = ibd_get_portspeed(state);
1951      -                _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*state))
1952 1585          }
1953 1586  
1954 1587          /*
1955 1588           * Do all the work required to establish our presence on
1956 1589           * the subnet.
1957 1590           */
1958 1591          if (opcode == IBD_LINK_UP_ABSENT) {
1959 1592                  /*
1960 1593                   * If in promiscuous mode ...
1961 1594                   */
↓ open down ↓ 231 lines elided ↑ open up ↑
2193 1826           */
2194 1827          itreply = port_infop->p_init_type_reply;
2195 1828          if (((itreply & SM_INIT_TYPE_REPLY_NO_LOAD_REPLY) == 0) &&
2196 1829              ((itreply & SM_INIT_TYPE_PRESERVE_CONTENT_REPLY) == 0)) {
2197 1830                  /*
2198 1831                   * Check to see if the subnet part of GID0 has changed. If
2199 1832                   * not, check the simple case first to see if the pkey
2200 1833                   * index is the same as before; finally check to see if the
2201 1834                   * pkey has been relocated to a different index in the table.
2202 1835                   */
2203      -                _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(state->id_sgid))
2204 1836                  if (bcmp(port_infop->p_sgid_tbl,
2205 1837                      &state->id_sgid, sizeof (ib_gid_t)) != 0) {
2206 1838  
2207 1839                          new_link_state = LINK_STATE_DOWN;
2208 1840  
2209 1841                  } else if (port_infop->p_pkey_tbl[state->id_pkix] ==
2210 1842                      state->id_pkey) {
2211 1843  
2212 1844                          new_link_state = LINK_STATE_UP;
2213 1845  
↓ open down ↓ 14 lines elided ↑ open up ↑
2228 1860                          (void) ibd_undo_start(state, LINK_STATE_DOWN);
2229 1861                          if ((ret = ibd_start(state)) != 0) {
2230 1862                                  DPRINT(10, "ibd_restart: cannot restart, "
2231 1863                                      "ret=%d", ret);
2232 1864                          }
2233 1865  
2234 1866                          goto link_mod_return;
2235 1867                  } else {
2236 1868                          new_link_state = LINK_STATE_DOWN;
2237 1869                  }
2238      -                _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(state->id_sgid))
2239 1870          }
2240 1871  
2241 1872  update_link_state:
2242 1873          if (port_infop) {
2243 1874                  ibt_free_portinfo(port_infop, port_infosz);
2244 1875          }
2245 1876  
2246 1877          /*
2247 1878           * If we're reporting a link up, check InitTypeReply to see if
2248 1879           * the SM has ensured that the port's presence in mcg, traps,
↓ open down ↓ 166 lines elided ↑ open up ↑
2415 2046          mac_free(macp);
2416 2047          return (DDI_SUCCESS);
2417 2048  }
2418 2049  
2419 2050  static int
2420 2051  ibd_record_capab(ibd_state_t *state)
2421 2052  {
2422 2053          ibt_hca_attr_t hca_attrs;
2423 2054          ibt_status_t ibt_status;
2424 2055  
2425      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*state))
2426      -
2427 2056          /*
2428 2057           * Query the HCA and fetch its attributes
2429 2058           */
2430 2059          ibt_status = ibt_query_hca(state->id_hca_hdl, &hca_attrs);
2431 2060          ASSERT(ibt_status == IBT_SUCCESS);
2432 2061  
2433 2062          /*
2434 2063           * 1. Set the Hardware Checksum capability. Currently we only consider
2435 2064           *    full checksum offload.
2436 2065           */
↓ open down ↓ 82 lines elided ↑ open up ↑
2519 2148  
2520 2149          if (hca_attrs.hca_max_chan_sz < state->id_ud_num_rwqe)
2521 2150                  state->id_ud_num_rwqe = hca_attrs.hca_max_chan_sz;
2522 2151  
2523 2152          state->id_rx_bufs_outstanding_limit = state->id_ud_num_rwqe -
2524 2153              IBD_RWQE_MIN;
2525 2154  
2526 2155          if (hca_attrs.hca_max_chan_sz < state->id_ud_num_swqe)
2527 2156                  state->id_ud_num_swqe = hca_attrs.hca_max_chan_sz;
2528 2157  
2529      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*state))
2530      -
2531 2158          return (DDI_SUCCESS);
2532 2159  }
2533 2160  
2534 2161  static int
2535 2162  ibd_part_busy(ibd_state_t *state)
2536 2163  {
2537 2164          if (atomic_add_32_nv(&state->id_rx_list.dl_bufs_outstanding, 0) != 0) {
2538 2165                  DPRINT(10, "ibd_part_busy: failed: rx bufs outstanding\n");
2539 2166                  return (DDI_FAILURE);
2540 2167          }
↓ open down ↓ 869 lines elided ↑ open up ↑
3410 3037          boolean_t found = B_FALSE;
3411 3038          int ret;
3412 3039          ibt_mcg_info_t mcg_info;
3413 3040  
3414 3041          state->id_bgroup_created = B_FALSE;
3415 3042          state->id_bgroup_present = B_FALSE;
3416 3043  
3417 3044  query_bcast_grp:
3418 3045          bzero(&mcg_attr, sizeof (ibt_mcg_attr_t));
3419 3046          mcg_attr.mc_pkey = state->id_pkey;
3420      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(state->id_mgid))
3421 3047          state->id_mgid.gid_guid = IB_MGID_IPV4_LOWGRP_MASK;
3422      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(state->id_mgid))
3423 3048  
3424 3049          for (i = 0; i < sizeof (scopes)/sizeof (scopes[0]); i++) {
3425 3050                  state->id_scope = mcg_attr.mc_scope = scopes[i];
3426 3051  
3427 3052                  /*
3428 3053                   * Look for the IPoIB broadcast group.
3429 3054                   */
3430      -                _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(state->id_mgid))
3431 3055                  state->id_mgid.gid_prefix =
3432 3056                      (((uint64_t)IB_MCGID_IPV4_PREFIX << 32) |
3433 3057                      ((uint64_t)state->id_scope << 48) |
3434 3058                      ((uint32_t)(state->id_pkey << 16)));
3435 3059                  mcg_attr.mc_mgid = state->id_mgid;
3436      -                _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(state->id_mgid))
3437 3060                  if (ibt_query_mcg(state->id_sgid, &mcg_attr, 1,
3438 3061                      &state->id_mcinfo, &numg) == IBT_SUCCESS) {
3439 3062                          found = B_TRUE;
3440 3063                          break;
3441 3064                  }
3442 3065          }
3443 3066  
3444 3067          if (!found) {
3445 3068                  if (state->id_create_broadcast_group) {
3446 3069                          /*
↓ open down ↓ 11 lines elided ↑ open up ↑
3458 3081                           * Create the ipoib broadcast group if it didn't exist
3459 3082                           */
3460 3083                          bzero(&mcg_attr, sizeof (ibt_mcg_attr_t));
3461 3084                          mcg_attr.mc_qkey = IBD_DEFAULT_QKEY;
3462 3085                          mcg_attr.mc_join_state = IB_MC_JSTATE_FULL;
3463 3086                          mcg_attr.mc_scope = IB_MC_SCOPE_SUBNET_LOCAL;
3464 3087                          mcg_attr.mc_pkey = state->id_pkey;
3465 3088                          mcg_attr.mc_flow = 0;
3466 3089                          mcg_attr.mc_sl = 0;
3467 3090                          mcg_attr.mc_tclass = 0;
3468      -                        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(state->id_mgid))
3469 3091                          state->id_mgid.gid_prefix =
3470 3092                              (((uint64_t)IB_MCGID_IPV4_PREFIX << 32) |
3471 3093                              ((uint64_t)IB_MC_SCOPE_SUBNET_LOCAL << 48) |
3472 3094                              ((uint32_t)(state->id_pkey << 16)));
3473 3095                          mcg_attr.mc_mgid = state->id_mgid;
3474      -                        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(state->id_mgid))
3475 3096  
3476 3097                          if ((ret = ibt_join_mcg(state->id_sgid, &mcg_attr,
3477 3098                              &mcg_info, NULL, NULL)) != IBT_SUCCESS) {
3478 3099                                  ibd_print_warn(state, "IPoIB broadcast group "
3479 3100                                      "absent, create failed: ret = %d\n", ret);
3480 3101                                  state->id_bgroup_created = B_FALSE;
3481 3102                                  return (IBT_FAILURE);
3482 3103                          }
3483 3104                          state->id_bgroup_created = B_TRUE;
3484 3105                          goto query_bcast_grp;
↓ open down ↓ 861 lines elided ↑ open up ↑
4346 3967          ibd_req_t *req;
4347 3968  
4348 3969          /*
4349 3970           * The trap handler will get invoked once for every event for
4350 3971           * every port. The input "gid" is the GID0 of the port the
4351 3972           * trap came in on; we just need to act on traps that came
4352 3973           * to our port, meaning the port on which the ipoib interface
4353 3974           * resides. Since ipoib uses GID0 of the port, we just match
4354 3975           * the gids to check whether we need to handle the trap.
4355 3976           */
4356      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(state->id_sgid))
4357 3977          if (bcmp(&gid, &state->id_sgid, sizeof (ib_gid_t)) != 0)
4358 3978                  return;
4359      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(state->id_sgid))
4360 3979  
4361 3980          DPRINT(10, "ibd_notices_handler : %d\n", code);
4362 3981  
4363 3982          switch (code) {
4364 3983                  case IBT_SM_EVENT_UNAVAILABLE:
4365 3984                          /*
4366 3985                           * If we are in promiscuous mode or have
4367 3986                           * sendnonmembers, we need to print a warning
4368 3987                           * message right now. Else, just store the
4369 3988                           * information, print when we enter promiscuous
↓ open down ↓ 966 lines elided ↑ open up ↑
5336 4955           * If the link is active, verify the pkey
5337 4956           */
5338 4957          if (port_infop->p_linkstate == IBT_PORT_ACTIVE) {
5339 4958                  if ((ret = ibt_pkey2index(state->id_hca_hdl, state->id_port,
5340 4959                      state->id_pkey, &state->id_pkix)) != IBT_SUCCESS) {
5341 4960                          state->id_link_state = LINK_STATE_DOWN;
5342 4961                  } else {
5343 4962                          state->id_link_state = LINK_STATE_UP;
5344 4963                  }
5345 4964                  state->id_mtu = (128 << port_infop->p_mtu);
5346      -                _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(state->id_sgid))
5347 4965                  state->id_sgid = *port_infop->p_sgid_tbl;
5348      -                _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(state->id_sgid))
5349 4966                  /*
5350 4967                   * Now that the port is active, record the port speed
5351 4968                   */
5352 4969                  state->id_link_speed = ibd_get_portspeed(state);
5353 4970          } else {
5354 4971                  /* Make sure that these are handled in PORT_UP/CHANGE */
5355 4972                  state->id_mtu = 0;
5356 4973                  state->id_link_state = LINK_STATE_DOWN;
5357 4974                  state->id_link_speed = 0;
5358 4975          }
↓ open down ↓ 3572 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX