]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
net: add netif_is_team_master helper
authorJiri Pirko <jiri@mellanox.com>
Thu, 3 Dec 2015 11:12:06 +0000 (12:12 +0100)
committerBrian Maly <brian.maly@oracle.com>
Tue, 19 Mar 2019 16:09:02 +0000 (12:09 -0400)
Orabug: 29495360

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>
(cherry picked from commit c981e4213e9d2d4ec79501bd607722ec712742a2)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/team/team.c
include/linux/netdevice.h

drivers/net/team/team.c
include/linux/netdevice.h

index 2b45d0168c3c1bfeb2a798703aacf1fe52b4b982..8ae02cc3fbfd1d16d528c0b875a9516c896aac11 100644 (file)
@@ -2050,6 +2050,7 @@ static void team_setup(struct net_device *dev)
        dev->tx_queue_len = 0;
        dev->flags |= IFF_MULTICAST;
        dev->priv_flags &= ~(IFF_XMIT_DST_RELEASE | IFF_TX_SKB_SHARING);
+       dev->priv_flags |= IFF_TEAM;
 
        /*
         * Indicate we support unicast address filtering. That way core won't
index 7eaee17f54b710f1e88be0b843e215d0fa39e294..a6b177fab6fdfdf5c21cb63cb16b17ae1a8b5863 100644 (file)
@@ -1250,6 +1250,7 @@ struct net_device_ops {
  * @IFF_MACSEC: device is a MACsec device
  * @IFF_FAILOVER: device is a failover master device
  * @IFF_FAILOVER_SLAVE: device is lower dev of a failover master device
+ * @IFF_TEAM: device is a team device
  */
 enum netdev_priv_flags {
        IFF_802_1Q_VLAN                 = 1<<0,
@@ -1281,6 +1282,7 @@ enum netdev_priv_flags {
        IFF_MACSEC                      = 1<<27,
        IFF_FAILOVER                    = 1<<28,
        IFF_FAILOVER_SLAVE              = 1<<29,
+       IFF_TEAM                        = 1<<24,
 };
 
 #define IFF_802_1Q_VLAN                        IFF_802_1Q_VLAN
@@ -1312,6 +1314,7 @@ enum netdev_priv_flags {
 #define IFF_MACSEC                     IFF_MACSEC
 #define IFF_FAILOVER                   IFF_FAILOVER
 #define IFF_FAILOVER_SLAVE             IFF_FAILOVER_SLAVE
+#define IFF_TEAM                       IFF_TEAM
 
 /**
  *     struct net_device - The DEVICE structure.
@@ -3902,6 +3905,11 @@ static inline bool netif_is_failover_slave(const struct net_device *dev)
        return dev->priv_flags & IFF_FAILOVER_SLAVE;
 }
 
+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)
 {