Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 31 Jul 2018 11:23:44 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r336964 - head/sys/ofed/include/rdma
Message-ID:  <201807311123.w6VBNikQ034204@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Tue Jul 31 11:23:44 2018
New Revision: 336964
URL: https://svnweb.freebsd.org/changeset/base/336964

Log:
  Only NULL check the VNET pointer when VIMAGE is enabled in ibcore.
  Else a NULL VNET pointer should be ignored. This fixes address resolving
  when VIMAGE is disabled.
  
  MFC after:		3 days
  Sponsored by:		Mellanox Technologies

Modified:
  head/sys/ofed/include/rdma/ib_sa.h

Modified: head/sys/ofed/include/rdma/ib_sa.h
==============================================================================
--- head/sys/ofed/include/rdma/ib_sa.h	Tue Jul 31 10:18:30 2018	(r336963)
+++ head/sys/ofed/include/rdma/ib_sa.h	Tue Jul 31 11:23:44 2018	(r336964)
@@ -182,7 +182,11 @@ struct ib_sa_path_rec {
 
 static inline struct net_device *ib_get_ndev_from_path(struct ib_sa_path_rec *rec)
 {
-	return rec->net ? dev_get_by_index(rec->net, rec->ifindex) : NULL;
+#ifdef VIMAGE
+	if (rec->net == NULL)
+		return NULL;
+#endif
+	return dev_get_by_index(rec->net, rec->ifindex);
 }
 
 #define IB_SA_MCMEMBER_REC_MGID				IB_SA_COMP_MASK( 0)



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