Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Jan 2021 12:30:31 GMT
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 125cdcc13b70 - stable/12 - MFC r353632: Replace rdma_is_upper_dev_rcu() with rdma_vlan_dev_real_dev() in ibcore. This reduces the number of references to VLAN_TRUNKDEV() in ibcore. Currently only VLAN is supported as a child interface in FreeBSD. Remove superfluous RCU locking.
Message-ID:  <202101221230.10MCUVFN000844@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by hselasky:

URL: https://cgit.FreeBSD.org/src/commit/?id=125cdcc13b7016b9edecba01eaf9d29a8c5fbd0b

commit 125cdcc13b7016b9edecba01eaf9d29a8c5fbd0b
Author:     Hans Petter Selasky <hselasky@FreeBSD.org>
AuthorDate: 2019-10-16 08:55:29 +0000
Commit:     Hans Petter Selasky <hselasky@FreeBSD.org>
CommitDate: 2021-01-22 12:27:45 +0000

    MFC r353632:
    Replace rdma_is_upper_dev_rcu() with rdma_vlan_dev_real_dev() in ibcore.
    This reduces the number of references to VLAN_TRUNKDEV() in ibcore.
    Currently only VLAN is supported as a child interface in FreeBSD.
    Remove superfluous RCU locking.
    
    Sponsored by:   Mellanox Technologies
---
 sys/ofed/drivers/infiniband/core/core_priv.h   | 10 ----------
 sys/ofed/drivers/infiniband/core/ib_sa_query.c |  4 +---
 2 files changed, 1 insertion(+), 13 deletions(-)

diff --git a/sys/ofed/drivers/infiniband/core/core_priv.h b/sys/ofed/drivers/infiniband/core/core_priv.h
index bfb307e531f7..7e3401ddf90a 100644
--- a/sys/ofed/drivers/infiniband/core/core_priv.h
+++ b/sys/ofed/drivers/infiniband/core/core_priv.h
@@ -128,16 +128,6 @@ int ib_cache_setup_one(struct ib_device *device);
 void ib_cache_cleanup_one(struct ib_device *device);
 void ib_cache_release_one(struct ib_device *device);
 
-static inline bool rdma_is_upper_dev_rcu(struct net_device *dev,
-					 struct net_device *upper)
-{
-
-	/* TODO: add support for LAGG */
-	upper = VLAN_TRUNKDEV(upper);
-
-	return (dev == upper);
-}
-
 int addr_init(void);
 void addr_cleanup(void);
 
diff --git a/sys/ofed/drivers/infiniband/core/ib_sa_query.c b/sys/ofed/drivers/infiniband/core/ib_sa_query.c
index 971cbba1833e..7b09b7a7e3f5 100644
--- a/sys/ofed/drivers/infiniband/core/ib_sa_query.c
+++ b/sys/ofed/drivers/infiniband/core/ib_sa_query.c
@@ -702,12 +702,10 @@ int ib_init_ah_from_path(struct ib_device *device, u8 port_num,
 			return -ENODEV;
 		}
 		ndev = ib_get_ndev_from_path(rec);
-		rcu_read_lock();
 		if ((ndev && ndev != resolved_dev) ||
 		    (resolved_dev != idev &&
-		     !rdma_is_upper_dev_rcu(idev, resolved_dev)))
+		     rdma_vlan_dev_real_dev(resolved_dev) != idev))
 			ret = -EHOSTUNREACH;
-		rcu_read_unlock();
 		dev_put(idev);
 		dev_put(resolved_dev);
 		if (ret) {



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