mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-23 05:56:14 -04:00
net: Introduce VRF related flags and helpers
Add a VRF_MASTER flag for interfaces and helper functions for determining if a device is a VRF_MASTER. Add link attribute for passing VRF_TABLE id. Add vrf_ptr to netdevice. Add various macros for determining if a device is a VRF device, the index of the master VRF device and table associated with VRF device. Signed-off-by: Shrijeet Mukherjee <shm@cumulusnetworks.com> 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
0344338bd8
commit
4e3c89920c
@@ -1289,6 +1289,7 @@ enum netdev_priv_flags {
|
||||
IFF_XMIT_DST_RELEASE_PERM = 1<<22,
|
||||
IFF_IPVLAN_MASTER = 1<<23,
|
||||
IFF_IPVLAN_SLAVE = 1<<24,
|
||||
IFF_VRF_MASTER = 1<<25,
|
||||
};
|
||||
|
||||
#define IFF_802_1Q_VLAN IFF_802_1Q_VLAN
|
||||
@@ -1316,6 +1317,7 @@ enum netdev_priv_flags {
|
||||
#define IFF_XMIT_DST_RELEASE_PERM IFF_XMIT_DST_RELEASE_PERM
|
||||
#define IFF_IPVLAN_MASTER IFF_IPVLAN_MASTER
|
||||
#define IFF_IPVLAN_SLAVE IFF_IPVLAN_SLAVE
|
||||
#define IFF_VRF_MASTER IFF_VRF_MASTER
|
||||
|
||||
/**
|
||||
* struct net_device - The DEVICE structure.
|
||||
@@ -1432,6 +1434,7 @@ enum netdev_priv_flags {
|
||||
* @dn_ptr: DECnet specific data
|
||||
* @ip6_ptr: IPv6 specific data
|
||||
* @ax25_ptr: AX.25 specific data
|
||||
* @vrf_ptr: VRF specific data
|
||||
* @ieee80211_ptr: IEEE 802.11 specific data, assign before registering
|
||||
*
|
||||
* @last_rx: Time of last Rx
|
||||
@@ -1650,6 +1653,7 @@ struct net_device {
|
||||
struct dn_dev __rcu *dn_ptr;
|
||||
struct inet6_dev __rcu *ip6_ptr;
|
||||
void *ax25_ptr;
|
||||
struct net_vrf_dev __rcu *vrf_ptr;
|
||||
struct wireless_dev *ieee80211_ptr;
|
||||
struct wpan_dev *ieee802154_ptr;
|
||||
#if IS_ENABLED(CONFIG_MPLS_ROUTING)
|
||||
@@ -3808,6 +3812,22 @@ static inline bool netif_supports_nofcs(struct net_device *dev)
|
||||
return dev->priv_flags & IFF_SUPP_NOFCS;
|
||||
}
|
||||
|
||||
static inline bool netif_is_vrf(const struct net_device *dev)
|
||||
{
|
||||
return dev->priv_flags & IFF_VRF_MASTER;
|
||||
}
|
||||
|
||||
static inline bool netif_index_is_vrf(struct net *net, int ifindex)
|
||||
{
|
||||
struct net_device *dev = dev_get_by_index_rcu(net, ifindex);
|
||||
bool rc = false;
|
||||
|
||||
if (dev)
|
||||
rc = netif_is_vrf(dev);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
/* This device needs to keep skb dst for qdisc enqueue or ndo_start_xmit() */
|
||||
static inline void netif_keep_dst(struct net_device *dev)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user