net: Replace vrf_master_ifindex{, _rcu} with l3mdev equivalents
Replace calls to vrf_master_ifindex_rcu and vrf_master_ifindex with either
l3mdev_master_ifindex_rcu or l3mdev_master_ifindex.
The pattern:
oif = vrf_master_ifindex(dev) ? : dev->ifindex;
is replaced with
oif = l3mdev_fib_oif(dev);
And remove the now unused vrf macros.
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
ee15ee5d94
commit
385add906b
@@ -34,37 +34,6 @@ struct net_vrf {
|
||||
|
||||
|
||||
#if IS_ENABLED(CONFIG_NET_VRF)
|
||||
/* called with rcu_read_lock() */
|
||||
static inline int vrf_master_ifindex_rcu(const struct net_device *dev)
|
||||
{
|
||||
struct net_vrf_dev *vrf_ptr;
|
||||
int ifindex = 0;
|
||||
|
||||
if (!dev)
|
||||
return 0;
|
||||
|
||||
if (netif_is_l3_master(dev)) {
|
||||
ifindex = dev->ifindex;
|
||||
} else {
|
||||
vrf_ptr = rcu_dereference(dev->vrf_ptr);
|
||||
if (vrf_ptr)
|
||||
ifindex = vrf_ptr->ifindex;
|
||||
}
|
||||
|
||||
return ifindex;
|
||||
}
|
||||
|
||||
static inline int vrf_master_ifindex(const struct net_device *dev)
|
||||
{
|
||||
int ifindex;
|
||||
|
||||
rcu_read_lock();
|
||||
ifindex = vrf_master_ifindex_rcu(dev);
|
||||
rcu_read_unlock();
|
||||
|
||||
return ifindex;
|
||||
}
|
||||
|
||||
/* called with rcu_read_lock */
|
||||
static inline u32 vrf_dev_table_rcu(const struct net_device *dev)
|
||||
{
|
||||
@@ -139,16 +108,6 @@ static inline struct rtable *vrf_dev_get_rth(const struct net_device *dev)
|
||||
}
|
||||
|
||||
#else
|
||||
static inline int vrf_master_ifindex_rcu(const struct net_device *dev)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int vrf_master_ifindex(const struct net_device *dev)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline u32 vrf_dev_table_rcu(const struct net_device *dev)
|
||||
{
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user