Skip to content

Commit

Permalink
IB/mthca: Generate SQ drained events when requested
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Roland Dreier committed Mar 20, 2006
1 parent 5e9f71a commit 3fa1fa3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
3 changes: 2 additions & 1 deletion drivers/infiniband/hw/mthca/mthca_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1638,7 +1638,8 @@ int mthca_MODIFY_QP(struct mthca_dev *dev, int trans, u32 num,
}

} else
err = mthca_cmd(dev, mailbox->dma, (!!is_ee << 24) | num,
err = mthca_cmd(dev, mailbox->dma,
optmask | (!!is_ee << 24) | num,
op_mod, op[trans], CMD_TIME_CLASS_C, status);

if (my_mailbox)
Expand Down
14 changes: 13 additions & 1 deletion drivers/infiniband/hw/mthca/mthca_qp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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] = {
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 3fa1fa3

Please sign in to comment.