public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Vipul Pandya <vipul-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: roland-BHEL68pLQRGGvPXPguhicg@public.gmane.org,
	divy-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org,
	swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org,
	abhishek-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org,
	Vipul Pandya <vipul-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
Subject: [PATCH 08/11] RDMA/cxgb4: don't reconnect on abort for mpa_rev 1
Date: Mon,  7 Jan 2013 18:41:57 +0530	[thread overview]
Message-ID: <1357564320-15022-9-git-send-email-vipul@chelsio.com> (raw)
In-Reply-To: <1357564320-15022-1-git-send-email-vipul-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>

only reconnect if the endpoint wasn't freed.

peer_abort() should only attempt to reconnect if the endpoint wasn't freed.
Also remove hwtid from the debugfs idr.

Add missing check for peer2peer in MPAv2 code

use correct mpa version on reject.

Signed-off-by: Vipul Pandya <vipul-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
---
 drivers/infiniband/hw/cxgb4/cm.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c
index ab5b4dd..88933af 100644
--- a/drivers/infiniband/hw/cxgb4/cm.c
+++ b/drivers/infiniband/hw/cxgb4/cm.c
@@ -284,10 +284,10 @@ void _c4iw_free_ep(struct kref *kref)
 	if (test_bit(QP_REFERENCED, &ep->com.flags))
 		deref_qp(ep);
 	if (test_bit(RELEASE_RESOURCES, &ep->com.flags)) {
+		remove_handle(ep->com.dev, &ep->com.dev->hwtid_idr, ep->hwtid);
 		cxgb4_remove_tid(ep->com.dev->rdev.lldi.tids, 0, ep->hwtid);
 		dst_release(ep->dst);
 		cxgb4_l2t_release(ep->l2t);
-		remove_handle(ep->com.dev, &ep->com.dev->hwtid_idr, ep->hwtid);
 	}
 	kfree(ep);
 }
@@ -699,7 +699,7 @@ static int send_mpa_reject(struct c4iw_ep *ep, const void *pdata, u8 plen)
 	memset(mpa, 0, sizeof(*mpa));
 	memcpy(mpa->key, MPA_KEY_REP, sizeof(mpa->key));
 	mpa->flags = MPA_REJECT;
-	mpa->revision = mpa_rev;
+	mpa->revision = ep->mpa_attr.version;
 	mpa->private_data_size = htons(plen);
 
 	if (ep->mpa_attr.version == 2 && ep->mpa_attr.enhanced_rdma_conn) {
@@ -2176,7 +2176,7 @@ static int peer_abort(struct c4iw_dev *dev, struct sk_buff *skb)
 		break;
 	case MPA_REQ_SENT:
 		stop_ep_timer(ep);
-		if (mpa_rev == 2 && ep->tried_with_mpa_v1)
+		if (mpa_rev == 1 || (mpa_rev == 2 && ep->tried_with_mpa_v1))
 			connect_reply_upcall(ep, -ECONNRESET);
 		else {
 			/*
@@ -2248,9 +2248,8 @@ static int peer_abort(struct c4iw_dev *dev, struct sk_buff *skb)
 out:
 	if (release)
 		release_ep_resources(ep);
-
-	/* retry with mpa-v1 */
-	if (ep && ep->retry_with_mpa_v1) {
+	else if (ep->retry_with_mpa_v1) {
+		remove_handle(ep->com.dev, &ep->com.dev->hwtid_idr, ep->hwtid);
 		cxgb4_remove_tid(ep->com.dev->rdev.lldi.tids, 0, ep->hwtid);
 		dst_release(ep->dst);
 		cxgb4_l2t_release(ep->l2t);
-- 
1.7.1

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

  parent reply	other threads:[~2013-01-07 13:11 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-07 13:11 [PATCH 00/11] Critical bug fixes for RDMA/cxgb4 Vipul Pandya
     [not found] ` <1357564320-15022-1-git-send-email-vipul-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
2013-01-07 13:11   ` [PATCH 01/11] RDMA/cxgb4: abort connections that receive unexpected streaming mode data Vipul Pandya
2013-01-07 13:11   ` [PATCH 02/11] RDMA/cxgb4: abort connections when moving to ERROR state Vipul Pandya
2013-01-07 13:11   ` [PATCH 03/11] RDMA/cxgb4: Display streaming mode error only if detected in RTS Vipul Pandya
2013-01-07 13:11   ` [PATCH 04/11] RDMA/cxgb4: keep qp referenced until TID released Vipul Pandya
2013-01-07 13:11   ` [PATCH 05/11] RDMA/cxgb4: Always log async errors Vipul Pandya
2013-01-07 13:11   ` [PATCH 06/11] RDMA/cxgb4: only log rx_data warnings if cpl status is non zero Vipul Pandya
2013-01-07 13:11   ` [PATCH 07/11] RDMA/cxgb4: endpoint timeout race condition Vipul Pandya
2013-01-07 13:11   ` Vipul Pandya [this message]
2013-01-07 13:11   ` [PATCH 09/11] RDMA/cxgb4: Don't wakeup threads for MPAv2 Vipul Pandya
2013-01-07 13:11   ` [PATCH 10/11] RDMA/cxgb4: Insert hwtid in pass_accept_req instead in pass_establish Vipul Pandya
2013-01-07 13:12   ` [PATCH 11/11] RDMA/cxgb4: Address sparse warnings Vipul Pandya
2013-01-07 15:44   ` [PATCH 00/11] Critical bug fixes for RDMA/cxgb4 Steve Wise
     [not found]     ` <50EAED60.7080507-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
2013-01-07 15:45       ` Steve Wise
2013-01-08  0:33   ` Roland Dreier
     [not found]     ` <CAL1RGDWra_K=BKUY04dUdCQwJcCOf+FHYrsQb2jA9+eM2ygqCw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-01-08  6:13       ` Vipul Pandya
     [not found]         ` <50EBB91C.2070001-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
2013-01-16  7:17           ` Vipul Pandya

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1357564320-15022-9-git-send-email-vipul@chelsio.com \
    --to=vipul-ut6up61k2wzbdgjk7y7tuq@public.gmane.org \
    --cc=abhishek-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org \
    --cc=divy-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=roland-BHEL68pLQRGGvPXPguhicg@public.gmane.org \
    --cc=swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox