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
This commit is contained in:
hselasky 2019-10-16 08:55:29 +00:00
parent a8aff284db
commit ae1053fff8
2 changed files with 1 additions and 13 deletions

View File

@ -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);

View File

@ -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) {