1593 sp = sp->session_nextp;
1594 }
1595
1596 /* wait until all the sessions are off this HCA */
1597 sp = statep->rds_sessionlistp;
1598 while (sp) {
1599 if (sp->session_hca_guid != hca_guid) {
1600 sp = sp->session_nextp;
1601 continue;
1602 }
1603
1604 rw_enter(&sp->session_lock, RW_READER);
1605 RDS_DPRINTF2("rdsib_del_hca", "SP(%p) State: %d", sp,
1606 sp->session_state);
1607
1608 while ((sp->session_state == RDS_SESSION_STATE_HCA_CLOSING) ||
1609 (sp->session_state == RDS_SESSION_STATE_ERROR) ||
1610 (sp->session_state == RDS_SESSION_STATE_PASSIVE_CLOSING) ||
1611 (sp->session_state == RDS_SESSION_STATE_CLOSED)) {
1612 rw_exit(&sp->session_lock);
1613 delay(drv_usectohz(1000000));
1614 rw_enter(&sp->session_lock, RW_READER);
1615 RDS_DPRINTF2("rdsib_del_hca", "SP(%p) State: %d", sp,
1616 sp->session_state);
1617 }
1618
1619 rw_exit(&sp->session_lock);
1620
1621 sp = sp->session_nextp;
1622 }
1623 rw_exit(&statep->rds_sessionlock);
1624
1625 /*
1626 * if rdsib_close_ib was called before this, then that would have
1627 * unbound the service on all ports. In that case, the HCA structs
1628 * will contain stale bindhdls. Hence, we do not call unbind unless
1629 * the service is still registered.
1630 */
1631 if (statep->rds_srvhdl != NULL) {
1632 /* unbind RDS service on all ports on this HCA */
1633 for (ix = 0; ix < hcap->hca_nports; ix++) {
|
1593 sp = sp->session_nextp;
1594 }
1595
1596 /* wait until all the sessions are off this HCA */
1597 sp = statep->rds_sessionlistp;
1598 while (sp) {
1599 if (sp->session_hca_guid != hca_guid) {
1600 sp = sp->session_nextp;
1601 continue;
1602 }
1603
1604 rw_enter(&sp->session_lock, RW_READER);
1605 RDS_DPRINTF2("rdsib_del_hca", "SP(%p) State: %d", sp,
1606 sp->session_state);
1607
1608 while ((sp->session_state == RDS_SESSION_STATE_HCA_CLOSING) ||
1609 (sp->session_state == RDS_SESSION_STATE_ERROR) ||
1610 (sp->session_state == RDS_SESSION_STATE_PASSIVE_CLOSING) ||
1611 (sp->session_state == RDS_SESSION_STATE_CLOSED)) {
1612 rw_exit(&sp->session_lock);
1613 delay(drv_sectohz(1));
1614 rw_enter(&sp->session_lock, RW_READER);
1615 RDS_DPRINTF2("rdsib_del_hca", "SP(%p) State: %d", sp,
1616 sp->session_state);
1617 }
1618
1619 rw_exit(&sp->session_lock);
1620
1621 sp = sp->session_nextp;
1622 }
1623 rw_exit(&statep->rds_sessionlock);
1624
1625 /*
1626 * if rdsib_close_ib was called before this, then that would have
1627 * unbound the service on all ports. In that case, the HCA structs
1628 * will contain stale bindhdls. Hence, we do not call unbind unless
1629 * the service is still registered.
1630 */
1631 if (statep->rds_srvhdl != NULL) {
1632 /* unbind RDS service on all ports on this HCA */
1633 for (ix = 0; ix < hcap->hca_nports; ix++) {
|