Date: Thu, 10 Jan 2008 23:11:08 GMT From: Steve Wise <swise@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 132995 for review Message-ID: <200801102311.m0ANB8u7028904@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=132995 Change 132995 by swise@swise:vic10:iwarp on 2008/01/10 23:10:49 sge register lock needs to be a spin lock. Affected files ... .. //depot/projects/iwarp/sys/dev/cxgb/cxgb_main.c#10 edit .. //depot/projects/iwarp/sys/dev/cxgb/cxgb_offload.c#11 edit .. //depot/projects/iwarp/sys/dev/cxgb/cxgb_sge.c#8 edit Differences ... ==== //depot/projects/iwarp/sys/dev/cxgb/cxgb_main.c#10 (text+ko) ==== @@ -471,7 +471,7 @@ snprintf(sc->elmerlockbuf, ADAPTER_LOCK_NAME_LEN, "cxgb elmer lock %d", device_get_unit(dev)); - MTX_INIT(&sc->sge.reg_lock, sc->reglockbuf, NULL, MTX_DEF); + MTX_INIT(&sc->sge.reg_lock, sc->reglockbuf, NULL, MTX_SPIN); MTX_INIT(&sc->mdio_lock, sc->mdiolockbuf, NULL, MTX_DEF); MTX_INIT(&sc->elmer_lock, sc->elmerlockbuf, NULL, MTX_DEF); @@ -2362,7 +2362,7 @@ } case CHELSIO_GET_SGE_CONTEXT: { struct ch_cntxt *ecntxt = (struct ch_cntxt *)data; - mtx_lock(&sc->sge.reg_lock); + mtx_lock_spin(&sc->sge.reg_lock); switch (ecntxt->cntxt_type) { case CNTXT_TYPE_EGRESS: error = t3_sge_read_ecntxt(sc, ecntxt->cntxt_id, @@ -2384,7 +2384,7 @@ error = EINVAL; break; } - mtx_unlock(&sc->sge.reg_lock); + mtx_unlock_spin(&sc->sge.reg_lock); break; } case CHELSIO_GET_SGE_DESC: { ==== //depot/projects/iwarp/sys/dev/cxgb/cxgb_offload.c#11 (text+ko) ==== @@ -313,10 +313,10 @@ struct rdma_cq_op *req = data; /* may be called in any context */ - mtx_lock(&adapter->sge.reg_lock); + mtx_lock_spin(&adapter->sge.reg_lock); ret = t3_sge_cqcntxt_op(adapter, req->id, req->op, req->credits); - mtx_unlock(&adapter->sge.reg_lock); + mtx_unlock_spin(&adapter->sge.reg_lock); break; } case RDMA_GET_MEM: { @@ -342,28 +342,28 @@ case RDMA_CQ_SETUP: { struct rdma_cq_setup *req = data; - mtx_lock(&adapter->sge.reg_lock); + mtx_lock_spin(&adapter->sge.reg_lock); ret = t3_sge_init_cqcntxt(adapter, req->id, req->base_addr, req->size, ASYNC_NOTIF_RSPQ, req->ovfl_mode, req->credits, req->credit_thres); - mtx_unlock(&adapter->sge.reg_lock); + mtx_unlock_spin(&adapter->sge.reg_lock); break; } case RDMA_CQ_DISABLE: - mtx_lock(&adapter->sge.reg_lock); + mtx_lock_spin(&adapter->sge.reg_lock); ret = t3_sge_disable_cqcntxt(adapter, *(unsigned int *)data); - mtx_unlock(&adapter->sge.reg_lock); + mtx_unlock_spin(&adapter->sge.reg_lock); break; case RDMA_CTRL_QP_SETUP: { struct rdma_ctrlqp_setup *req = data; - mtx_lock(&adapter->sge.reg_lock); + mtx_lock_spin(&adapter->sge.reg_lock); ret = t3_sge_init_ecntxt(adapter, FW_RI_SGEEC_START, 0, SGE_CNTXT_RDMA, ASYNC_NOTIF_RSPQ, req->base_addr, req->size, FW_RI_TID_START, 1, 0); - mtx_unlock(&adapter->sge.reg_lock); + mtx_unlock_spin(&adapter->sge.reg_lock); break; } default: ==== //depot/projects/iwarp/sys/dev/cxgb/cxgb_sge.c#8 (text+ko) ==== @@ -1689,9 +1689,9 @@ } for (i = 0; i < SGE_RXQ_PER_SET; ++i) { if (q->fl[i].desc) { - mtx_lock(&sc->sge.reg_lock); + mtx_lock_spin(&sc->sge.reg_lock); t3_sge_disable_fl(sc, q->fl[i].cntxt_id); - mtx_unlock(&sc->sge.reg_lock); + mtx_unlock_spin(&sc->sge.reg_lock); bus_dmamap_unload(q->fl[i].desc_tag, q->fl[i].desc_map); bus_dmamem_free(q->fl[i].desc_tag, q->fl[i].desc, q->fl[i].desc_map); @@ -1706,9 +1706,9 @@ for (i = 0; i < SGE_TXQ_PER_SET; i++) { if (q->txq[i].desc) { - mtx_lock(&sc->sge.reg_lock); + mtx_lock_spin(&sc->sge.reg_lock); t3_sge_enable_ecntxt(sc, q->txq[i].cntxt_id, 0); - mtx_unlock(&sc->sge.reg_lock); + mtx_unlock_spin(&sc->sge.reg_lock); bus_dmamap_unload(q->txq[i].desc_tag, q->txq[i].desc_map); bus_dmamem_free(q->txq[i].desc_tag, q->txq[i].desc, @@ -1723,9 +1723,9 @@ } if (q->rspq.desc) { - mtx_lock(&sc->sge.reg_lock); + mtx_lock_spin(&sc->sge.reg_lock); t3_sge_disable_rspcntxt(sc, q->rspq.cntxt_id); - mtx_unlock(&sc->sge.reg_lock); + mtx_unlock_spin(&sc->sge.reg_lock); bus_dmamap_unload(q->rspq.desc_tag, q->rspq.desc_map); bus_dmamem_free(q->rspq.desc_tag, q->rspq.desc, @@ -2331,7 +2331,7 @@ #endif q->lro.enabled = lro_default; - mtx_lock(&sc->sge.reg_lock); + mtx_lock_spin(&sc->sge.reg_lock); ret = -t3_sge_init_rspcntxt(sc, q->rspq.cntxt_id, irq_vec_idx, q->rspq.phys_addr, q->rspq.size, q->fl[0].buf_size, 1, 0); @@ -2387,7 +2387,7 @@ device_get_unit(sc->dev), irq_vec_idx); MTX_INIT(&q->rspq.lock, q->rspq.lockbuf, NULL, MTX_DEF); - mtx_unlock(&sc->sge.reg_lock); + mtx_unlock_spin(&sc->sge.reg_lock); t3_update_qset_coalesce(q, p); q->port = pi; @@ -2401,7 +2401,7 @@ return (0); err_unlock: - mtx_unlock(&sc->sge.reg_lock); + mtx_unlock_spin(&sc->sge.reg_lock); err: t3_free_qset(sc, q);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200801102311.m0ANB8u7028904>