svn commit: r339891 - head/sys/dev/cxgbe/iw_cxgbe

Navdeep Parhar np at FreeBSD.org
Mon Oct 29 22:35:47 UTC 2018


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;
 }
 


More information about the svn-src-all mailing list