Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 54385
b: refs/heads/master
c: 4a97d47
h: refs/heads/master
i:
  54383: 1267126
v: v3
  • Loading branch information
Steve Wise authored and Roland Dreier committed May 1, 2007
1 parent 26d8107 commit a9d318b
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 32 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 347fcfbed261fdd11f46fa03d524e1bddddab3a6
refs/heads/master: 4a97d47ef7946cf31b76945c3199b0b5cad6a8ed
69 changes: 38 additions & 31 deletions trunk/drivers/infiniband/hw/cxgb3/iwch_qp.c
Original file line number Diff line number Diff line change
Expand Up @@ -471,43 +471,62 @@ int iwch_bind_mw(struct ib_qp *qp,
return err;
}

static void build_term_codes(int t3err, u8 *layer_type, u8 *ecode, int tagged)
static inline void build_term_codes(struct respQ_msg_t *rsp_msg,
u8 *layer_type, u8 *ecode)
{
switch (t3err) {
int status = TPT_ERR_INTERNAL_ERR;
int tagged = 0;
int opcode = -1;
int rqtype = 0;
int send_inv = 0;

if (rsp_msg) {
status = CQE_STATUS(rsp_msg->cqe);
opcode = CQE_OPCODE(rsp_msg->cqe);
rqtype = RQ_TYPE(rsp_msg->cqe);
send_inv = (opcode == T3_SEND_WITH_INV) ||
(opcode == T3_SEND_WITH_SE_INV);
tagged = (opcode == T3_RDMA_WRITE) ||
(rqtype && (opcode == T3_READ_RESP));
}

switch (status) {
case TPT_ERR_STAG:
if (tagged == 1) {
*layer_type = LAYER_DDP|DDP_TAGGED_ERR;
*ecode = DDPT_INV_STAG;
} else if (tagged == 2) {
if (send_inv) {
*layer_type = LAYER_RDMAP|RDMAP_REMOTE_OP;
*ecode = RDMAP_CANT_INV_STAG;
} else {
*layer_type = LAYER_RDMAP|RDMAP_REMOTE_PROT;
*ecode = RDMAP_INV_STAG;
}
break;
case TPT_ERR_PDID:
*layer_type = LAYER_RDMAP|RDMAP_REMOTE_PROT;
if ((opcode == T3_SEND_WITH_INV) ||
(opcode == T3_SEND_WITH_SE_INV))
*ecode = RDMAP_CANT_INV_STAG;
else
*ecode = RDMAP_STAG_NOT_ASSOC;
break;
case TPT_ERR_QPID:
*layer_type = LAYER_RDMAP|RDMAP_REMOTE_PROT;
*ecode = RDMAP_STAG_NOT_ASSOC;
break;
case TPT_ERR_ACCESS:
if (tagged == 1) {
*layer_type = LAYER_DDP|DDP_TAGGED_ERR;
*ecode = DDPT_STAG_NOT_ASSOC;
} else if (tagged == 2) {
*layer_type = LAYER_RDMAP|RDMAP_REMOTE_PROT;
*ecode = RDMAP_STAG_NOT_ASSOC;
}
*layer_type = LAYER_RDMAP|RDMAP_REMOTE_PROT;
*ecode = RDMAP_ACC_VIOL;
break;
case TPT_ERR_WRAP:
*layer_type = LAYER_RDMAP|RDMAP_REMOTE_PROT;
*ecode = RDMAP_TO_WRAP;
break;
case TPT_ERR_BOUND:
if (tagged == 1) {
if (tagged) {
*layer_type = LAYER_DDP|DDP_TAGGED_ERR;
*ecode = DDPT_BASE_BOUNDS;
} else if (tagged == 2) {
} else {
*layer_type = LAYER_RDMAP|RDMAP_REMOTE_PROT;
*ecode = RDMAP_BASE_BOUNDS;
} else {
*layer_type = LAYER_DDP|DDP_UNTAGGED_ERR;
*ecode = DDPU_MSG_TOOBIG;
}
break;
case TPT_ERR_INVALIDATE_SHARED_MR:
Expand Down Expand Up @@ -591,8 +610,6 @@ int iwch_post_terminate(struct iwch_qp *qhp, struct respQ_msg_t *rsp_msg)
{
union t3_wr *wqe;
struct terminate_message *term;
int status;
int tagged = 0;
struct sk_buff *skb;

PDBG("%s %d\n", __FUNCTION__, __LINE__);
Expand All @@ -610,17 +627,7 @@ int iwch_post_terminate(struct iwch_qp *qhp, struct respQ_msg_t *rsp_msg)

/* immediate data starts here. */
term = (struct terminate_message *)wqe->send.sgl;
if (rsp_msg) {
status = CQE_STATUS(rsp_msg->cqe);
if (CQE_OPCODE(rsp_msg->cqe) == T3_RDMA_WRITE)
tagged = 1;
if ((CQE_OPCODE(rsp_msg->cqe) == T3_READ_REQ) ||
(CQE_OPCODE(rsp_msg->cqe) == T3_READ_RESP))
tagged = 2;
} else {
status = TPT_ERR_INTERNAL_ERR;
}
build_term_codes(status, &term->layer_etype, &term->ecode, tagged);
build_term_codes(rsp_msg, &term->layer_etype, &term->ecode);
build_fw_riwrh((void *)wqe, T3_WR_SEND,
T3_COMPLETION_FLAG | T3_NOTIFY_FLAG, 1,
qhp->ep->hwtid, 5);
Expand Down

0 comments on commit a9d318b

Please sign in to comment.