Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Oct 2018 22:35:46 +0000 (UTC)
From:      Navdeep Parhar <np@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r339891 - head/sys/dev/cxgbe/iw_cxgbe
Message-ID:  <201810292235.w9TMZk6v091923@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: np
Date: Mon Oct 29 22:35:46 2018
New Revision: 339891
URL: https://svnweb.freebsd.org/changeset/base/339891

Log:
  cxgbe/iw_cxgbe: Install the socket upcall before calling soconnect to
  ensure that it always runs when soisconnected does.
  
  Submitted by:	Krishnamraju Eraparaju @ Chelsio
  MFC after:	1 month
  Sponsored by:	Chelsio Communications

Modified:
  head/sys/dev/cxgbe/iw_cxgbe/cm.c

Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c
==============================================================================
--- head/sys/dev/cxgbe/iw_cxgbe/cm.c	Mon Oct 29 22:24:31 2018	(r339890)
+++ head/sys/dev/cxgbe/iw_cxgbe/cm.c	Mon Oct 29 22:35:46 2018	(r339891)
@@ -2601,22 +2601,24 @@ int c4iw_connect(struct iw_cm_id *cm_id, struct iw_cm_
 		goto fail;
 
 	setiwsockopt(ep->com.so);
+	init_iwarp_socket(ep->com.so, &ep->com);
 	err = -soconnect(ep->com.so, (struct sockaddr *)&ep->com.remote_addr,
 		ep->com.thread);
-	if (!err) {
-		init_iwarp_socket(ep->com.so, &ep->com);
-		goto out;
-	} else
+	if (err)
 		goto fail_free_so;
+	CTR2(KTR_IW_CXGBE, "%s:ccE, ep %p", __func__, ep);
+	return 0;
 
 fail_free_so:
+	uninit_iwarp_socket(ep->com.so);
+	ep->com.state = DEAD;
 	sock_release(ep->com.so);
 fail:
 	deref_cm_id(&ep->com);
 	c4iw_put_ep(&ep->com);
 	ep = NULL;
 out:
-	CTR2(KTR_IW_CXGBE, "%s:ccE ret:%d", __func__, err);
+	CTR2(KTR_IW_CXGBE, "%s:ccE Error %d", __func__, err);
 	return err;
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201810292235.w9TMZk6v091923>