Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Aug 2018 04:37:54 +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: r338366 - head/sys/dev/cxgbe/iw_cxgbe
Message-ID:  <201808290437.w7T4bslS017869@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: np
Date: Wed Aug 29 04:37:53 2018
New Revision: 338366
URL: https://svnweb.freebsd.org/changeset/base/338366

Log:
  cxgbe/iw_cxgbe: Fix iWARP RDMA + VIMAGE operation by setting the VNET
  properly in a couple of places in the driver.
  
  Submitted by:	Krishnamraju Eraparaju @ Chelsio
  Approved by:	re@ (rgrimes@)
  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	Wed Aug 29 02:49:18 2018	(r338365)
+++ head/sys/dev/cxgbe/iw_cxgbe/cm.c	Wed Aug 29 04:37:53 2018	(r338366)
@@ -76,6 +76,7 @@ struct cpl_set_tcb_rpl;
 #include <linux/inetdevice.h>
 #include <linux/if_vlan.h>
 #include <net/netevent.h>
+#include <rdma/rdma_cm.h>
 
 static spinlock_t req_lock;
 static TAILQ_HEAD(c4iw_ep_list, c4iw_ep_common) req_list;
@@ -2523,6 +2524,8 @@ int c4iw_connect(struct iw_cm_id *cm_id, struct iw_cm_
 	struct c4iw_dev *dev = to_c4iw_dev(cm_id->device);
 	struct c4iw_ep *ep = NULL;
 	struct ifnet    *nh_ifp;        /* Logical egress interface */
+	struct rdma_cm_id *rdma_id = (struct rdma_cm_id*)cm_id->context;
+	struct vnet *vnet = rdma_id->route.addr.dev_addr.net;
 
 	CTR2(KTR_IW_CXGBE, "%s:ccB %p", __func__, cm_id);
 
@@ -2568,7 +2571,10 @@ int c4iw_connect(struct iw_cm_id *cm_id, struct iw_cm_
 	ref_qp(ep);
 	ep->com.thread = curthread;
 
+	CURVNET_SET(vnet);
 	err = get_ifnet_from_raddr(&cm_id->remote_addr, &nh_ifp);
+	CURVNET_RESTORE();
+
 	if (err) {
 
 		CTR2(KTR_IW_CXGBE, "%s:cc7 %p", __func__, ep);
@@ -2811,7 +2817,10 @@ int c4iw_ep_disconnect(struct c4iw_ep *ep, int abrupt,
 
 			if (!ep->parent_ep)
 				ep->com.state = MORIBUND;
+
+			CURVNET_SET(ep->com.so->so_vnet);
 			sodisconnect(ep->com.so);
+			CURVNET_RESTORE();
 		}
 
 	}



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