aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/cxgb4/cm.c
diff options
context:
space:
mode:
authorSteve Wise <swise@opengridcomputing.com>2010-09-10 12:15:09 -0400
committerRoland Dreier <rolandd@cisco.com>2010-09-28 13:46:32 -0400
commit0e42c1f4303f3f8d5b2c257dc5488b0ad465097d (patch)
tree8c32681b45fb4ec784d2c511ebb3fd02d06a2f65 /drivers/infiniband/hw/cxgb4/cm.c
parent6ff0e343b3356897cef1f09452f93acb13703911 (diff)
RDMA/cxgb4: Handle CPL_RDMA_TERMINATE messages
T4 FW sends up CPL_RDMA_TERMINATE to indicate a peer TERM. This triggers the QP moving to TERMINATE state. Signed-off-by: Steve Wise <swise@opengridcomputing.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/cxgb4/cm.c')
-rw-r--r--drivers/infiniband/hw/cxgb4/cm.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c
index 2c60266bb6c..2f0a26cf8e0 100644
--- a/drivers/infiniband/hw/cxgb4/cm.c
+++ b/drivers/infiniband/hw/cxgb4/cm.c
@@ -1725,23 +1725,24 @@ static int close_con_rpl(struct c4iw_dev *dev, struct sk_buff *skb)
1725 1725
1726static int terminate(struct c4iw_dev *dev, struct sk_buff *skb) 1726static int terminate(struct c4iw_dev *dev, struct sk_buff *skb)
1727{ 1727{
1728 struct c4iw_ep *ep; 1728 struct cpl_rdma_terminate *rpl = cplhdr(skb);
1729 struct cpl_rdma_terminate *term = cplhdr(skb);
1730 struct tid_info *t = dev->rdev.lldi.tids; 1729 struct tid_info *t = dev->rdev.lldi.tids;
1731 unsigned int tid = GET_TID(term); 1730 unsigned int tid = GET_TID(rpl);
1731 struct c4iw_ep *ep;
1732 struct c4iw_qp_attributes attrs;
1732 1733
1733 ep = lookup_tid(t, tid); 1734 ep = lookup_tid(t, tid);
1735 BUG_ON(!ep);
1734 1736
1735 if (state_read(&ep->com) != FPDU_MODE) 1737 if (ep->com.qp) {
1736 return 0; 1738 printk(KERN_WARNING MOD "TERM received tid %u qpid %u\n", tid,
1739 ep->com.qp->wq.sq.qid);
1740 attrs.next_state = C4IW_QP_STATE_TERMINATE;
1741 c4iw_modify_qp(ep->com.qp->rhp, ep->com.qp,
1742 C4IW_QP_ATTR_NEXT_STATE, &attrs, 1);
1743 } else
1744 printk(KERN_WARNING MOD "TERM received tid %u no qp\n", tid);
1737 1745
1738 PDBG("%s ep %p tid %u\n", __func__, ep, ep->hwtid);
1739 skb_pull(skb, sizeof *term);
1740 PDBG("%s saving %d bytes of term msg\n", __func__, skb->len);
1741 skb_copy_from_linear_data(skb, ep->com.qp->attr.terminate_buffer,
1742 skb->len);
1743 ep->com.qp->attr.terminate_msg_len = skb->len;
1744 ep->com.qp->attr.is_terminate_local = 0;
1745 return 0; 1746 return 0;
1746} 1747}
1747 1748