With later firmware, the chances of getting streaming mode data after
we exit RTS is likely, so we don't need to warn for it.  The only real
case where we don't expect it is when the QP is in RTS.

move QP to ERROR when streaming mode data received.

Signed-off-by: Vipul Pandya <vi...@chelsio.com>
---
 drivers/infiniband/hw/cxgb4/cm.c |   26 ++++++++++++++------------
 1 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c
index 3dce47a..31d1fac 100644
--- a/drivers/infiniband/hw/cxgb4/cm.c
+++ b/drivers/infiniband/hw/cxgb4/cm.c
@@ -1403,21 +1403,23 @@ static int rx_data(struct c4iw_dev *dev, struct sk_buff 
*skb)
                ep->rcv_seq += dlen;
                process_mpa_request(ep, skb);
                break;
-       default:
-               pr_err("%s Unexpected streaming data." \
-                      " ep %p state %d tid %u status %d\n",
-                      __func__, ep, state_read(&ep->com), ep->hwtid, status);
-
-               if (ep->com.qp) {
-                       struct c4iw_qp_attributes attrs;
-
-                       attrs.next_state = C4IW_QP_STATE_ERROR;
-                       c4iw_modify_qp(ep->com.qp->rhp, ep->com.qp,
-                                      C4IW_QP_ATTR_NEXT_STATE, &attrs, 1);
-               }
+       case FPDU_MODE: {
+               struct c4iw_qp_attributes attrs;
+               BUG_ON(!ep->com.qp);
+               if (ep->com.qp->attr.state == C4IW_QP_STATE_RTS)
+                       pr_err("%s Unexpected streaming data." \
+                              " ep %p state %d tid %u status %d\n",
+                              __func__, ep, state_read(&ep->com),
+                              ep->hwtid, status);
+               attrs.next_state = C4IW_QP_STATE_ERROR;
+               c4iw_modify_qp(ep->com.qp->rhp, ep->com.qp,
+                              C4IW_QP_ATTR_NEXT_STATE, &attrs, 1);
                c4iw_ep_disconnect(ep, 1, GFP_KERNEL);
                break;
        }
+       default:
+               break;
+       }
        return 0;
 }
 
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to