diff mbox series

iw_cxgb4: always disconnect when QP is transitioning to TERMINATE state

Message ID 20190402091611.23796-1-bharat@chelsio.com (mailing list archive)
State Mainlined
Commit d2c33370ae73105c7c7df8f7048d20653991b4cb
Delegated to: Jason Gunthorpe
Headers show
Series iw_cxgb4: always disconnect when QP is transitioning to TERMINATE state | expand

Commit Message

Potnuri Bharat Teja April 2, 2019, 9:16 a.m. UTC
On receiving a TERM from peer, Host moves the QP to TERMINATE state and
then moves the adapter out of RDMA mode. After issuing a TERM, peer issues
a CLOSE and at this point of time if the connectivity between peer and
host is lost for a significant amount of time, the QP remains in TERMINATE
state.
Therefore c4iw_modify_qp() needs to initiate a close on entering terminate
state.

Signed-off-by: Potnuri Bharat Teja <bharat@chelsio.com>
---
 drivers/infiniband/hw/cxgb4/qp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Jason Gunthorpe April 3, 2019, 6:47 p.m. UTC | #1
On Tue, Apr 02, 2019 at 02:46:11PM +0530, Potnuri Bharat Teja wrote:
> On receiving a TERM from peer, Host moves the QP to TERMINATE state and
> then moves the adapter out of RDMA mode. After issuing a TERM, peer issues
> a CLOSE and at this point of time if the connectivity between peer and
> host is lost for a significant amount of time, the QP remains in TERMINATE
> state.
> Therefore c4iw_modify_qp() needs to initiate a close on entering terminate
> state.
> 
> Signed-off-by: Potnuri Bharat Teja <bharat@chelsio.com>
> ---
>  drivers/infiniband/hw/cxgb4/qp.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Applied to for-next

Thanks,
Jason
diff mbox series

Patch

diff --git a/drivers/infiniband/hw/cxgb4/qp.c b/drivers/infiniband/hw/cxgb4/qp.c
index d3a82839f5ea..0f548b9d1a5b 100644
--- a/drivers/infiniband/hw/cxgb4/qp.c
+++ b/drivers/infiniband/hw/cxgb4/qp.c
@@ -1976,10 +1976,10 @@  int c4iw_modify_qp(struct c4iw_dev *rhp, struct c4iw_qp *qhp,
 			qhp->attr.layer_etype = attrs->layer_etype;
 			qhp->attr.ecode = attrs->ecode;
 			ep = qhp->ep;
+			c4iw_get_ep(&ep->com);
+			disconnect = 1;
 			if (!internal) {
-				c4iw_get_ep(&qhp->ep->com);
 				terminate = 1;
-				disconnect = 1;
 			} else {
 				terminate = qhp->attr.send_term;
 				ret = rdma_fini(rhp, qhp, ep);