Lines Matching refs:hca

50 static int iser_ib_free_hca(iser_hca_t *hca);
51 static int iser_ib_update_hcaports(iser_hca_t *hca);
201 iser_hca_t *hca;
215 for (hca = list_head(&iser_state->is_hcalist);
216 hca != NULL;
217 hca = list_next(&iser_state->is_hcalist, hca)) {
219 for (i = 0; i < hca->hca_num_ports; i++) {
221 if (hca->hca_port_info[i].p_linkstate !=
232 gid = hca->hca_port_info[i].p_sgid_tbl[0];
236 idm_svc->is_iser_svc, hca->hca_guid, gid) == NULL) {
239 idm_svc, hca->hca_guid, gid);
361 iser_hca_t *hca;
364 /* Lookup the hca using the gid in the path info */
365 hca = iser_ib_guid2hca(hca_guid);
366 if (hca == NULL) {
372 chan = iser_ib_alloc_rc_channel(hca, hca_port);
402 iser_hca_t *hca;
422 /* get the hca port from the path info */
425 /* Lookup the hca using the gid in the path info */
426 hca = iser_ib_gid2hca(lgid);
427 if (hca == NULL) {
430 (longlong_t)hca->hca_guid);
434 chan = iser_ib_alloc_rc_channel(hca, hca_port);
440 (longlong_t)hca->hca_guid, hca_port);
450 (longlong_t)hca->hca_guid, hca_port);
466 iser_ib_alloc_rc_channel(iser_hca_t *hca, uint8_t hca_port)
480 chan->ic_hca = hca;
487 sq_size = min(hca->hca_attr.hca_max_chan_sz, ISER_IB_SENDQ_SIZE);
488 rq_size = min(hca->hca_attr.hca_max_chan_sz, ISER_IB_RECVQ_SIZE);
495 if (hca->hca_attr.hca_max_cq_sz >= (sq_size + 1)) {
498 chan->ic_sendcq_sz = hca->hca_attr.hca_max_cq_sz;
502 if (hca->hca_attr.hca_max_cq_sz >= (rq_size + 1)) {
505 chan->ic_recvcq_sz = hca->hca_attr.hca_max_cq_sz;
513 status = iser_ib_setup_cq(hca->hca_hdl, chan->ic_sendcq_sz,
526 status = iser_ib_setup_cq(hca->hca_hdl, chan->ic_recvcq_sz,
541 sq_size, rq_size, hca->hca_pdhdl, &chanargs);
543 status = ibt_alloc_rc_channel(hca->hca_hdl,
765 iser_hca_t *hca;
791 hca = chan->ic_hca;
793 if (hca == NULL) {
818 msg = iser_msg_get(hca, rq_space, &msg_ret);
939 iser_hca_t *hca;
951 hca = iser_ib_guid2hca(event->ev_hca_guid);
952 if (hca == NULL) {
955 hca = iser_ib_alloc_hca(event->ev_hca_guid);
956 if (hca == NULL) {
963 list_insert_tail(&iser_state->is_hcalist, hca);
969 status = iser_ib_update_hcaports(hca);
980 gid = hca->hca_port_info[event->ev_port - 1].p_sgid_tbl[0];
1043 iser_hca_t *hca;
1051 hca = iser_ib_guid2hca(event->ev_hca_guid);
1052 ASSERT(hca != NULL);
1054 status = iser_ib_update_hcaports(hca);
1063 gid = hca->hca_port_info[event->ev_port - 1].p_sgid_tbl[0];
1080 iser_hca_t *nexthca, *hca;
1086 hca = iser_ib_guid2hca(event->ev_hca_guid);
1087 for (i = 0; i < hca->hca_num_ports; i++) {
1088 iser_ib_deactivate_port(hca->hca_guid,
1089 hca->hca_port_info[i].p_sgid_tbl[0]);
1098 for (hca = list_head(&iser_state->is_hcalist);
1099 hca != NULL;
1100 hca = nexthca) {
1102 nexthca = list_next(&iser_state->is_hcalist, hca);
1104 if (hca->hca_guid == event->ev_hca_guid) {
1106 list_remove(&iser_state->is_hcalist, hca);
1109 status = iser_ib_free_hca(hca);
1112 "Failed to free hca(%p)", (void *)hca);
1113 list_insert_tail(&iser_state->is_hcalist, hca);
1176 iser_hca_t *hca;
1200 hca = iser_ib_alloc_hca(guid[i]);
1201 if (hca == NULL) {
1209 list_insert_tail(&iser_state->is_hcalist, hca);
1241 iser_hca_t *nexthca, *hca;
1245 for (hca = list_head(&iser_state->is_hcalist);
1246 hca != NULL;
1247 hca = nexthca) {
1249 nexthca = list_next(&iser_state->is_hcalist, hca);
1251 list_remove(&iser_state->is_hcalist, hca);
1253 status = iser_ib_free_hca(hca);
1257 list_insert_tail(&iser_state->is_hcalist, hca);
1280 iser_hca_t *hca;
1284 hca = (iser_hca_t *)kmem_zalloc(sizeof (iser_hca_t), KM_SLEEP);
1287 status = ibt_open_hca(iser_state->is_ibhdl, guid, &hca->hca_hdl);
1291 kmem_free(hca, sizeof (iser_hca_t));
1295 hca->hca_guid = guid;
1296 hca->hca_clnt_hdl = iser_state->is_ibhdl;
1299 status = ibt_query_hca(hca->hca_hdl, &hca->hca_attr);
1304 (void) ibt_close_hca(hca->hca_hdl);
1305 kmem_free(hca, sizeof (iser_hca_t));
1310 status = ibt_query_hca_ports(hca->hca_hdl, 0,
1311 &hca->hca_port_info, &hca->hca_num_ports,
1312 &hca->hca_port_info_sz);
1317 (void) ibt_close_hca(hca->hca_hdl);
1318 kmem_free(hca, sizeof (iser_hca_t));
1323 status = ibt_alloc_pd(hca->hca_hdl, IBT_PD_NO_FLAGS,
1324 &hca->hca_pdhdl);
1329 (void) ibt_close_hca(hca->hca_hdl);
1330 ibt_free_portinfo(hca->hca_port_info, hca->hca_port_info_sz);
1331 kmem_free(hca, sizeof (iser_hca_t));
1336 iser_init_hca_caches(hca);
1338 return (hca);
1342 iser_ib_free_hca(iser_hca_t *hca)
1348 ASSERT(hca != NULL);
1349 if (hca->hca_failed)
1352 hca_port_info = hca->hca_port_info;
1353 hca_port_info_sz = hca->hca_port_info_sz;
1359 iser_fini_hca_caches(hca);
1361 status = ibt_free_pd(hca->hca_hdl, hca->hca_pdhdl);
1368 status = ibt_close_hca(hca->hca_hdl);
1377 kmem_free(hca, sizeof (iser_hca_t));
1385 status = ibt_alloc_pd(hca->hca_hdl, IBT_PD_NO_FLAGS, &hca->hca_pdhdl);
1387 hca->hca_failed = B_TRUE;
1395 iser_init_hca_caches(hca);
1401 iser_ib_update_hcaports(iser_hca_t *hca)
1407 ASSERT(hca != NULL);
1409 status = ibt_query_hca_ports(hca->hca_hdl, 0, &pinfop, &nport, &size);
1415 oldpinfop = hca->hca_port_info;
1416 oldsize = hca->hca_port_info_sz;
1417 hca->hca_port_info = pinfop;
1418 hca->hca_port_info_sz = size;
1427 * Given a gid, find the corresponding hca
1433 iser_hca_t *hca;
1437 for (hca = list_head(&iser_state->is_hcalist);
1438 hca != NULL;
1439 hca = list_next(&iser_state->is_hcalist, hca)) {
1441 for (i = 0; i < hca->hca_num_ports; i++) {
1442 if ((hca->hca_port_info[i].p_sgid_tbl[0].gid_prefix ==
1444 (hca->hca_port_info[i].p_sgid_tbl[0].gid_guid ==
1449 return (hca);
1465 iser_hca_t *hca;
1468 for (hca = list_head(&iser_state->is_hcalist);
1469 hca != NULL;
1470 hca = list_next(&iser_state->is_hcalist, hca)) {
1472 if (hca->hca_guid == guid) {
1474 return (hca);
1602 /* Set the local hca port on which the channel is allocated */