aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/mthca/mthca_qp.c
diff options
context:
space:
mode:
authorRoland Dreier <rolandd@cisco.com>2006-02-03 14:53:28 -0800
committerRoland Dreier <rolandd@cisco.com>2006-03-20 10:08:12 -0800
commit3fa1fa3e809dc009a080ca9f052cee2e17836c63 (patch)
tree471bc486f70e8cd4d3950b0ff256f12db057b951 /drivers/infiniband/hw/mthca/mthca_qp.c
parentIB/mad: Simplify SMI by eliminating smi_check_local_dr_smp() (diff)
downloadlinux-dev-3fa1fa3e809dc009a080ca9f052cee2e17836c63.tar.xz
linux-dev-3fa1fa3e809dc009a080ca9f052cee2e17836c63.zip
IB/mthca: Generate SQ drained events when requested
Add low-level driver support to ib_mthca so that consumers can request a "send queue drained" event be generated when a transiton to the SQD state completes. Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/mthca/mthca_qp.c')
-rw-r--r--drivers/infiniband/hw/mthca/mthca_qp.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_qp.c b/drivers/infiniband/hw/mthca/mthca_qp.c
index bdba39a8d9f9..97f5303d2c02 100644
--- a/drivers/infiniband/hw/mthca/mthca_qp.c
+++ b/drivers/infiniband/hw/mthca/mthca_qp.c
@@ -415,6 +415,12 @@ static const struct {
},
[IB_QPS_SQD] = {
.trans = MTHCA_TRANS_RTS2SQD,
+ .opt_param = {
+ [UD] = IB_QP_EN_SQD_ASYNC_NOTIFY,
+ [UC] = IB_QP_EN_SQD_ASYNC_NOTIFY,
+ [RC] = IB_QP_EN_SQD_ASYNC_NOTIFY,
+ [MLX] = IB_QP_EN_SQD_ASYNC_NOTIFY
+ }
},
},
[IB_QPS_SQD] = {
@@ -577,6 +583,7 @@ int mthca_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask)
struct mthca_qp_param *qp_param;
struct mthca_qp_context *qp_context;
u32 req_param, opt_param;
+ u32 sqd_event = 0;
u8 status;
int err;
@@ -841,8 +848,13 @@ int mthca_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask)
qp_context->srqn = cpu_to_be32(1 << 24 |
to_msrq(ibqp->srq)->srqn);
+ if (cur_state == IB_QPS_RTS && new_state == IB_QPS_SQD &&
+ attr_mask & IB_QP_EN_SQD_ASYNC_NOTIFY &&
+ attr->en_sqd_async_notify)
+ sqd_event = 1 << 31;
+
err = mthca_MODIFY_QP(dev, state_table[cur_state][new_state].trans,
- qp->qpn, 0, mailbox, 0, &status);
+ qp->qpn, 0, mailbox, sqd_event, &status);
if (status) {
mthca_warn(dev, "modify QP %d returned status %02x.\n",
state_table[cur_state][new_state].trans, status);