net: add netif_is_team_master helper
authorJiri Pirko <jiri@mellanox.com>
Thu, 3 Dec 2015 11:12:06 +0000 (12:12 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 3 Dec 2015 16:49:24 +0000 (11:49 -0500)
Similar to other helpers, caller can use this to find out if device is
team master.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/team/team.c
include/linux/netdevice.h

index 651d35ea22c5f8335b50c0b0aa75c834eb4c83c5..d2f3ee832c478eab0248a41974b8ff05b9637528 100644 (file)
@@ -2054,6 +2054,7 @@ static void team_setup(struct net_device *dev)
        dev->flags |= IFF_MULTICAST;
        dev->priv_flags &= ~(IFF_XMIT_DST_RELEASE | IFF_TX_SKB_SHARING);
        dev->priv_flags |= IFF_NO_QUEUE;
+       dev->priv_flags |= IFF_TEAM;
 
        /*
         * Indicate we support unicast address filtering. That way core won't
index fcbc5259c6303f10ee1163d959e612006c8f4ffd..2b889be65d8849710a176e3ab70be16f66342867 100644 (file)
@@ -1273,6 +1273,7 @@ struct net_device_ops {
  * @IFF_NO_QUEUE: device can run without qdisc attached
  * @IFF_OPENVSWITCH: device is a Open vSwitch master
  * @IFF_L3MDEV_SLAVE: device is enslaved to an L3 master device
+ * @IFF_TEAM: device is a team device
  */
 enum netdev_priv_flags {
        IFF_802_1Q_VLAN                 = 1<<0,
@@ -1299,6 +1300,7 @@ enum netdev_priv_flags {
        IFF_NO_QUEUE                    = 1<<21,
        IFF_OPENVSWITCH                 = 1<<22,
        IFF_L3MDEV_SLAVE                = 1<<23,
+       IFF_TEAM                        = 1<<24,
 };
 
 #define IFF_802_1Q_VLAN                        IFF_802_1Q_VLAN
@@ -1325,6 +1327,7 @@ enum netdev_priv_flags {
 #define IFF_NO_QUEUE                   IFF_NO_QUEUE
 #define IFF_OPENVSWITCH                        IFF_OPENVSWITCH
 #define IFF_L3MDEV_SLAVE               IFF_L3MDEV_SLAVE
+#define IFF_TEAM                       IFF_TEAM
 
 /**
  *     struct net_device - The DEVICE structure.
@@ -3889,6 +3892,11 @@ static inline bool netif_is_ovs_master(const struct net_device *dev)
        return dev->priv_flags & IFF_OPENVSWITCH;
 }
 
+static inline bool netif_is_team_master(struct net_device *dev)
+{
+       return dev->priv_flags & IFF_TEAM;
+}
+
 /* This device needs to keep skb dst for qdisc enqueue or ndo_start_xmit() */
 static inline void netif_keep_dst(struct net_device *dev)
 {
This page took 0.031143 seconds and 5 git commands to generate.