|
@@ -1240,13 +1240,8 @@ struct net_device_ops {
|
|
*
|
|
*
|
|
* @IFF_802_1Q_VLAN: 802.1Q VLAN device
|
|
* @IFF_802_1Q_VLAN: 802.1Q VLAN device
|
|
* @IFF_EBRIDGE: Ethernet bridging device
|
|
* @IFF_EBRIDGE: Ethernet bridging device
|
|
- * @IFF_SLAVE_INACTIVE: bonding slave not the curr. active
|
|
|
|
- * @IFF_MASTER_8023AD: bonding master, 802.3ad
|
|
|
|
- * @IFF_MASTER_ALB: bonding master, balance-alb
|
|
|
|
* @IFF_BONDING: bonding master or slave
|
|
* @IFF_BONDING: bonding master or slave
|
|
- * @IFF_SLAVE_NEEDARP: need ARPs for validation
|
|
|
|
* @IFF_ISATAP: ISATAP interface (RFC4214)
|
|
* @IFF_ISATAP: ISATAP interface (RFC4214)
|
|
- * @IFF_MASTER_ARPMON: bonding master, ARP mon in use
|
|
|
|
* @IFF_WAN_HDLC: WAN HDLC device
|
|
* @IFF_WAN_HDLC: WAN HDLC device
|
|
* @IFF_XMIT_DST_RELEASE: dev_hard_start_xmit() is allowed to
|
|
* @IFF_XMIT_DST_RELEASE: dev_hard_start_xmit() is allowed to
|
|
* release skb->dst
|
|
* release skb->dst
|
|
@@ -1264,46 +1259,38 @@ struct net_device_ops {
|
|
* @IFF_MACVLAN: Macvlan device
|
|
* @IFF_MACVLAN: Macvlan device
|
|
* @IFF_VRF_MASTER: device is a VRF master
|
|
* @IFF_VRF_MASTER: device is a VRF master
|
|
* @IFF_NO_QUEUE: device can run without qdisc attached
|
|
* @IFF_NO_QUEUE: device can run without qdisc attached
|
|
|
|
+ * @IFF_OPENVSWITCH: device is a Open vSwitch master
|
|
*/
|
|
*/
|
|
enum netdev_priv_flags {
|
|
enum netdev_priv_flags {
|
|
IFF_802_1Q_VLAN = 1<<0,
|
|
IFF_802_1Q_VLAN = 1<<0,
|
|
IFF_EBRIDGE = 1<<1,
|
|
IFF_EBRIDGE = 1<<1,
|
|
- IFF_SLAVE_INACTIVE = 1<<2,
|
|
|
|
- IFF_MASTER_8023AD = 1<<3,
|
|
|
|
- IFF_MASTER_ALB = 1<<4,
|
|
|
|
- IFF_BONDING = 1<<5,
|
|
|
|
- IFF_SLAVE_NEEDARP = 1<<6,
|
|
|
|
- IFF_ISATAP = 1<<7,
|
|
|
|
- IFF_MASTER_ARPMON = 1<<8,
|
|
|
|
- IFF_WAN_HDLC = 1<<9,
|
|
|
|
- IFF_XMIT_DST_RELEASE = 1<<10,
|
|
|
|
- IFF_DONT_BRIDGE = 1<<11,
|
|
|
|
- IFF_DISABLE_NETPOLL = 1<<12,
|
|
|
|
- IFF_MACVLAN_PORT = 1<<13,
|
|
|
|
- IFF_BRIDGE_PORT = 1<<14,
|
|
|
|
- IFF_OVS_DATAPATH = 1<<15,
|
|
|
|
- IFF_TX_SKB_SHARING = 1<<16,
|
|
|
|
- IFF_UNICAST_FLT = 1<<17,
|
|
|
|
- IFF_TEAM_PORT = 1<<18,
|
|
|
|
- IFF_SUPP_NOFCS = 1<<19,
|
|
|
|
- IFF_LIVE_ADDR_CHANGE = 1<<20,
|
|
|
|
- IFF_MACVLAN = 1<<21,
|
|
|
|
- IFF_XMIT_DST_RELEASE_PERM = 1<<22,
|
|
|
|
- IFF_IPVLAN_MASTER = 1<<23,
|
|
|
|
- IFF_IPVLAN_SLAVE = 1<<24,
|
|
|
|
- IFF_VRF_MASTER = 1<<25,
|
|
|
|
- IFF_NO_QUEUE = 1<<26,
|
|
|
|
|
|
+ IFF_BONDING = 1<<2,
|
|
|
|
+ IFF_ISATAP = 1<<3,
|
|
|
|
+ IFF_WAN_HDLC = 1<<4,
|
|
|
|
+ IFF_XMIT_DST_RELEASE = 1<<5,
|
|
|
|
+ IFF_DONT_BRIDGE = 1<<6,
|
|
|
|
+ IFF_DISABLE_NETPOLL = 1<<7,
|
|
|
|
+ IFF_MACVLAN_PORT = 1<<8,
|
|
|
|
+ IFF_BRIDGE_PORT = 1<<9,
|
|
|
|
+ IFF_OVS_DATAPATH = 1<<10,
|
|
|
|
+ IFF_TX_SKB_SHARING = 1<<11,
|
|
|
|
+ IFF_UNICAST_FLT = 1<<12,
|
|
|
|
+ IFF_TEAM_PORT = 1<<13,
|
|
|
|
+ IFF_SUPP_NOFCS = 1<<14,
|
|
|
|
+ IFF_LIVE_ADDR_CHANGE = 1<<15,
|
|
|
|
+ IFF_MACVLAN = 1<<16,
|
|
|
|
+ IFF_XMIT_DST_RELEASE_PERM = 1<<17,
|
|
|
|
+ IFF_IPVLAN_MASTER = 1<<18,
|
|
|
|
+ IFF_IPVLAN_SLAVE = 1<<19,
|
|
|
|
+ IFF_VRF_MASTER = 1<<20,
|
|
|
|
+ IFF_NO_QUEUE = 1<<21,
|
|
|
|
+ IFF_OPENVSWITCH = 1<<22,
|
|
};
|
|
};
|
|
|
|
|
|
#define IFF_802_1Q_VLAN IFF_802_1Q_VLAN
|
|
#define IFF_802_1Q_VLAN IFF_802_1Q_VLAN
|
|
#define IFF_EBRIDGE IFF_EBRIDGE
|
|
#define IFF_EBRIDGE IFF_EBRIDGE
|
|
-#define IFF_SLAVE_INACTIVE IFF_SLAVE_INACTIVE
|
|
|
|
-#define IFF_MASTER_8023AD IFF_MASTER_8023AD
|
|
|
|
-#define IFF_MASTER_ALB IFF_MASTER_ALB
|
|
|
|
#define IFF_BONDING IFF_BONDING
|
|
#define IFF_BONDING IFF_BONDING
|
|
-#define IFF_SLAVE_NEEDARP IFF_SLAVE_NEEDARP
|
|
|
|
#define IFF_ISATAP IFF_ISATAP
|
|
#define IFF_ISATAP IFF_ISATAP
|
|
-#define IFF_MASTER_ARPMON IFF_MASTER_ARPMON
|
|
|
|
#define IFF_WAN_HDLC IFF_WAN_HDLC
|
|
#define IFF_WAN_HDLC IFF_WAN_HDLC
|
|
#define IFF_XMIT_DST_RELEASE IFF_XMIT_DST_RELEASE
|
|
#define IFF_XMIT_DST_RELEASE IFF_XMIT_DST_RELEASE
|
|
#define IFF_DONT_BRIDGE IFF_DONT_BRIDGE
|
|
#define IFF_DONT_BRIDGE IFF_DONT_BRIDGE
|
|
@@ -1322,6 +1309,7 @@ enum netdev_priv_flags {
|
|
#define IFF_IPVLAN_SLAVE IFF_IPVLAN_SLAVE
|
|
#define IFF_IPVLAN_SLAVE IFF_IPVLAN_SLAVE
|
|
#define IFF_VRF_MASTER IFF_VRF_MASTER
|
|
#define IFF_VRF_MASTER IFF_VRF_MASTER
|
|
#define IFF_NO_QUEUE IFF_NO_QUEUE
|
|
#define IFF_NO_QUEUE IFF_NO_QUEUE
|
|
|
|
+#define IFF_OPENVSWITCH IFF_OPENVSWITCH
|
|
|
|
|
|
/**
|
|
/**
|
|
* struct net_device - The DEVICE structure.
|
|
* struct net_device - The DEVICE structure.
|
|
@@ -2127,6 +2115,13 @@ struct netdev_notifier_change_info {
|
|
unsigned int flags_changed;
|
|
unsigned int flags_changed;
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+struct netdev_notifier_changeupper_info {
|
|
|
|
+ struct netdev_notifier_info info; /* must be first */
|
|
|
|
+ struct net_device *upper_dev; /* new upper dev */
|
|
|
|
+ bool master; /* is upper dev master */
|
|
|
|
+ bool linking; /* is the nofication for link or unlink */
|
|
|
|
+};
|
|
|
|
+
|
|
static inline void netdev_notifier_info_init(struct netdev_notifier_info *info,
|
|
static inline void netdev_notifier_info_init(struct netdev_notifier_info *info,
|
|
struct net_device *dev)
|
|
struct net_device *dev)
|
|
{
|
|
{
|
|
@@ -3841,6 +3836,16 @@ static inline bool netif_is_vrf(const struct net_device *dev)
|
|
return dev->priv_flags & IFF_VRF_MASTER;
|
|
return dev->priv_flags & IFF_VRF_MASTER;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static inline bool netif_is_bridge_master(const struct net_device *dev)
|
|
|
|
+{
|
|
|
|
+ return dev->priv_flags & IFF_EBRIDGE;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static inline bool netif_is_ovs_master(const struct net_device *dev)
|
|
|
|
+{
|
|
|
|
+ return dev->priv_flags & IFF_OPENVSWITCH;
|
|
|
|
+}
|
|
|
|
+
|
|
static inline bool netif_index_is_vrf(struct net *net, int ifindex)
|
|
static inline bool netif_index_is_vrf(struct net *net, int ifindex)
|
|
{
|
|
{
|
|
bool rc = false;
|
|
bool rc = false;
|