Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Aug 2018 08:28:49 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r337091 - stable/11/sys/ofed/drivers/infiniband/core
Message-ID:  <201808020828.w728SnI0045218@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Thu Aug  2 08:28:49 2018
New Revision: 337091
URL: https://svnweb.freebsd.org/changeset/base/337091

Log:
  MFC r336386:
  Honor port_num while resolving GID for IB link layer in ibcore.
  
  ah_attr contains the port number to which cm_id is bound. However, while
  searching for GID table for matching GID entry, the port number is
  ignored.
  
  This could cause the wrong GID to be used when the ah_attr is converted to
  an AH.
  
  Linux commit:
  563c4ba3bd2b8b0b21c65669ec2226b1cfa1138b
  
  Sponsored by:		Mellanox Technologies

Modified:
  stable/11/sys/ofed/drivers/infiniband/core/ib_multicast.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/ofed/drivers/infiniband/core/ib_multicast.c
==============================================================================
--- stable/11/sys/ofed/drivers/infiniband/core/ib_multicast.c	Thu Aug  2 08:27:49 2018	(r337090)
+++ stable/11/sys/ofed/drivers/infiniband/core/ib_multicast.c	Thu Aug  2 08:28:49 2018	(r337091)
@@ -727,21 +727,19 @@ int ib_init_ah_from_mcmember(struct ib_device *device,
 {
 	int ret;
 	u16 gid_index;
-	u8 p;
 
-	if (rdma_protocol_roce(device, port_num)) {
-		ret = ib_find_cached_gid_by_port(device, &rec->port_gid,
-						 gid_type, port_num,
-						 ndev,
-						 &gid_index);
-	} else if (rdma_protocol_ib(device, port_num)) {
-		ret = ib_find_cached_gid(device, &rec->port_gid,
-					 IB_GID_TYPE_IB, NULL, &p,
-					 &gid_index);
-	} else {
-		ret = -EINVAL;
-	}
+	/* GID table is not based on the netdevice for IB link layer,
+	 * so ignore ndev during search.
+	 */
+	if (rdma_protocol_ib(device, port_num))
+		ndev = NULL;
+	else if (!rdma_protocol_roce(device, port_num))
+		return -EINVAL;
 
+	ret = ib_find_cached_gid_by_port(device, &rec->port_gid,
+					 gid_type, port_num,
+					 ndev,
+					 &gid_index);
 	if (ret)
 		return ret;
 



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