Skip to content

Commit c981e42

Browse files
jpirkodavem330
authored andcommitted
net: add netif_is_team_master helper
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>
1 parent 3952af4 commit c981e42

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

‎drivers/net/team/team.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2054,6 +2054,7 @@ static void team_setup(struct net_device *dev)
20542054
dev->flags |= IFF_MULTICAST;
20552055
dev->priv_flags &= ~(IFF_XMIT_DST_RELEASE | IFF_TX_SKB_SHARING);
20562056
dev->priv_flags |= IFF_NO_QUEUE;
2057+
dev->priv_flags |= IFF_TEAM;
20572058

20582059
/*
20592060
* Indicate we support unicast address filtering. That way core won't

‎include/linux/netdevice.h‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1273,6 +1273,7 @@ struct net_device_ops {
12731273
* @IFF_NO_QUEUE: device can run without qdisc attached
12741274
* @IFF_OPENVSWITCH: device is a Open vSwitch master
12751275
* @IFF_L3MDEV_SLAVE: device is enslaved to an L3 master device
1276+
* @IFF_TEAM: device is a team device
12761277
*/
12771278
enum netdev_priv_flags {
12781279
IFF_802_1Q_VLAN = 1<<0,
@@ -1299,6 +1300,7 @@ enum netdev_priv_flags {
12991300
IFF_NO_QUEUE = 1<<21,
13001301
IFF_OPENVSWITCH = 1<<22,
13011302
IFF_L3MDEV_SLAVE = 1<<23,
1303+
IFF_TEAM = 1<<24,
13021304
};
13031305

13041306
#define IFF_802_1Q_VLAN IFF_802_1Q_VLAN
@@ -1325,6 +1327,7 @@ enum netdev_priv_flags {
13251327
#define IFF_NO_QUEUE IFF_NO_QUEUE
13261328
#define IFF_OPENVSWITCH IFF_OPENVSWITCH
13271329
#define IFF_L3MDEV_SLAVE IFF_L3MDEV_SLAVE
1330+
#define IFF_TEAM IFF_TEAM
13281331

13291332
/**
13301333
* struct net_device - The DEVICE structure.
@@ -3889,6 +3892,11 @@ static inline bool netif_is_ovs_master(const struct net_device *dev)
38893892
return dev->priv_flags & IFF_OPENVSWITCH;
38903893
}
38913894

3895+
static inline bool netif_is_team_master(struct net_device *dev)
3896+
{
3897+
return dev->priv_flags & IFF_TEAM;
3898+
}
3899+
38923900
/* This device needs to keep skb dst for qdisc enqueue or ndo_start_xmit() */
38933901
static inline void netif_keep_dst(struct net_device *dev)
38943902
{

0 commit comments

Comments
 (0)