From e32cd65c5b0a38a14ee9be061a0352c5fe03a6ad Mon Sep 17 00:00:00 2001 From: Navdeep Parhar Date: Wed, 29 Aug 2018 04:37:53 +0000 Subject: [PATCH] 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 --- sys/dev/cxgbe/iw_cxgbe/cm.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/dev/cxgbe/iw_cxgbe/cm.c b/sys/dev/cxgbe/iw_cxgbe/cm.c index ce42a90ad59b..9eab1750bb11 100644 --- a/sys/dev/cxgbe/iw_cxgbe/cm.c +++ b/sys/dev/cxgbe/iw_cxgbe/cm.c @@ -76,6 +76,7 @@ struct cpl_set_tcb_rpl; #include #include #include +#include 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_conn_param *conn_param) 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_conn_param *conn_param) 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, gfp_t gfp) if (!ep->parent_ep) ep->com.state = MORIBUND; + + CURVNET_SET(ep->com.so->so_vnet); sodisconnect(ep->com.so); + CURVNET_RESTORE(); } }