summaryrefslogtreecommitdiff
path: root/include/linux/netdevice.h
diff options
context:
space:
mode:
authorJiri Pirko <jiri@mellanox.com>2015-08-27 10:31:20 +0300
committerDavid S. Miller <davem@davemloft.net>2015-08-28 02:28:35 +0300
commit35d4e1725202e6656fcfa8b88447327ad3ae0c0c (patch)
treea3d559ce4df8e097e51e443749bf3830e7030906 /include/linux/netdevice.h
parent0894ae3f0a587bda9733ec4a4b67af7ded3a9498 (diff)
downloadlinux-35d4e1725202e6656fcfa8b88447327ad3ae0c0c.tar.xz
net: add netif_is_ovs_master helper with IFF_OPENVSWITCH private flag
Add this helper so code can easily figure out if netdev is openswitch. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r--include/linux/netdevice.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index be625f4754b9..6656a43c072d 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1264,6 +1264,7 @@ struct net_device_ops {
* @IFF_MACVLAN: Macvlan device
* @IFF_VRF_MASTER: device is a VRF master
* @IFF_NO_QUEUE: device can run without qdisc attached
+ * @IFF_OPENVSWITCH: device is a Open vSwitch master
*/
enum netdev_priv_flags {
IFF_802_1Q_VLAN = 1<<0,
@@ -1293,6 +1294,7 @@ enum netdev_priv_flags {
IFF_IPVLAN_SLAVE = 1<<24,
IFF_VRF_MASTER = 1<<25,
IFF_NO_QUEUE = 1<<26,
+ IFF_OPENVSWITCH = 1<<27,
};
#define IFF_802_1Q_VLAN IFF_802_1Q_VLAN
@@ -1322,6 +1324,7 @@ enum netdev_priv_flags {
#define IFF_IPVLAN_SLAVE IFF_IPVLAN_SLAVE
#define IFF_VRF_MASTER IFF_VRF_MASTER
#define IFF_NO_QUEUE IFF_NO_QUEUE
+#define IFF_OPENVSWITCH IFF_OPENVSWITCH
/**
* struct net_device - The DEVICE structure.
@@ -3853,6 +3856,11 @@ 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)
{
bool rc = false;