From 0d29420c16d650d33e4bcf4e2820b2a237880201 Mon Sep 17 00:00:00 2001 From: hselasky Date: Fri, 29 Apr 2016 11:31:27 +0000 Subject: [PATCH] MFC r298458: Add missing set of the current VNET when inputting IP packets in IPoIB. This fixes a kernel panic when using IPoIB with VIMAGE and infiniband. PR: 208957 Sponsored by: Mellanox Technologies Tested by: Justin Clift git-svn-id: svn://svn.freebsd.org/base/stable/9@298780 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c index 2a9326973..7ba90d1bd 100644 --- a/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c +++ b/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c @@ -481,6 +481,8 @@ void ipoib_cm_handle_rx_wc(struct ipoib_dev_priv *priv, struct ib_wc *wc) int has_srq; u_short proto; + CURVNET_SET_QUIET(dev->if_vnet); + ipoib_dbg_data(priv, "cm recv completion: id %d, status: %d\n", wr_id, wc->status); @@ -496,7 +498,7 @@ void ipoib_cm_handle_rx_wc(struct ipoib_dev_priv *priv, struct ib_wc *wc) } else ipoib_warn(priv, "cm recv completion event with wrid %d (> %d)\n", wr_id, ipoib_recvq_size); - return; + goto done; } p = wc->qp->qp_context; @@ -520,7 +522,7 @@ void ipoib_cm_handle_rx_wc(struct ipoib_dev_priv *priv, struct ib_wc *wc) queue_work(ipoib_workqueue, &priv->cm.rx_reap_task); spin_unlock(&priv->lock); } - return; + goto done; } } @@ -579,6 +581,9 @@ repost: "for buf %d\n", wr_id); } } +done: + CURVNET_RESTORE(); + return; } static inline int post_send(struct ipoib_dev_priv *priv, -- 2.45.0