Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 55abf8df authored by Vipul Pandya's avatar Vipul Pandya Committed by Roland Dreier
Browse files

RDMA/cxgb4: Abort connections that receive unexpected streaming mode data



This error means the RDMA connection was knocked out of RDMA mode,
probably due to an error on the connection.

Signed-off-by: default avatarVipul Pandya <vipul@chelsio.com>
Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
parent 836dc9e3
Loading
Loading
Loading
Loading
+10 −9
Original line number Original line Diff line number Diff line
@@ -1391,30 +1391,31 @@ static int rx_data(struct c4iw_dev *dev, struct sk_buff *skb)
	skb_pull(skb, sizeof(*hdr));
	skb_pull(skb, sizeof(*hdr));
	skb_trim(skb, dlen);
	skb_trim(skb, dlen);


	ep->rcv_seq += dlen;
	BUG_ON(ep->rcv_seq != (ntohl(hdr->seq) + dlen));

	/* update RX credits */
	/* update RX credits */
	update_rx_credits(ep, dlen);
	update_rx_credits(ep, dlen);


	switch (state_read(&ep->com)) {
	switch (state_read(&ep->com)) {
	case MPA_REQ_SENT:
	case MPA_REQ_SENT:
		ep->rcv_seq += dlen;
		process_mpa_reply(ep, skb);
		process_mpa_reply(ep, skb);
		break;
		break;
	case MPA_REQ_WAIT:
	case MPA_REQ_WAIT:
		ep->rcv_seq += dlen;
		process_mpa_request(ep, skb);
		process_mpa_request(ep, skb);
		break;
		break;
	case MPA_REP_SENT:
		break;
	default:
	default:
		pr_err("%s Unexpected streaming data." \
		pr_err("%s Unexpected streaming data." \
		       " ep %p state %d tid %u status %d\n",
		       " ep %p state %d tid %u status %d\n",
		       __func__, ep, state_read(&ep->com), ep->hwtid, status);
		       __func__, ep, state_read(&ep->com), ep->hwtid, status);


		/*
		if (ep->com.qp) {
		 * The ep will timeout and inform the ULP of the failure.
			struct c4iw_qp_attributes attrs;
		 * See ep_timeout().

		 */
			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;
		break;
	}
	}
	return 0;
	return 0;