Skip to content

Commit 47cbd1f

Browse files
jpirkochrmhoffmann
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. Change-Id: I8301442073b4af1e19a1ee207fa5055a3ab5c908 Signed-off-by: Jiri Pirko <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent e967300 commit 47cbd1f

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

drivers/net/team/team.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2081,6 +2081,7 @@ static void team_setup(struct net_device *dev)
20812081
dev->flags |= IFF_MULTICAST;
20822082
dev->priv_flags &= ~(IFF_XMIT_DST_RELEASE | IFF_TX_SKB_SHARING);
20832083
dev->priv_flags |= IFF_NO_QUEUE;
2084+
dev->priv_flags |= IFF_TEAM;
20842085

20852086
/*
20862087
* 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
@@ -1271,6 +1271,7 @@ struct net_device_ops {
12711271
* @IFF_NO_QUEUE: device can run without qdisc attached
12721272
* @IFF_OPENVSWITCH: device is a Open vSwitch master
12731273
* @IFF_L3MDEV_SLAVE: device is enslaved to an L3 master device
1274+
* @IFF_TEAM: device is a team device
12741275
*/
12751276
enum netdev_priv_flags {
12761277
IFF_802_1Q_VLAN = 1<<0,
@@ -1297,6 +1298,7 @@ enum netdev_priv_flags {
12971298
IFF_NO_QUEUE = 1<<21,
12981299
IFF_OPENVSWITCH = 1<<22,
12991300
IFF_L3MDEV_SLAVE = 1<<23,
1301+
IFF_TEAM = 1<<24,
13001302
};
13011303

13021304
#define IFF_802_1Q_VLAN IFF_802_1Q_VLAN
@@ -1323,6 +1325,7 @@ enum netdev_priv_flags {
13231325
#define IFF_NO_QUEUE IFF_NO_QUEUE
13241326
#define IFF_OPENVSWITCH IFF_OPENVSWITCH
13251327
#define IFF_L3MDEV_SLAVE IFF_L3MDEV_SLAVE
1328+
#define IFF_TEAM IFF_TEAM
13261329

13271330
/**
13281331
* struct net_device - The DEVICE structure.
@@ -3974,6 +3977,11 @@ static inline bool netif_is_ovs_master(const struct net_device *dev)
39743977
return dev->priv_flags & IFF_OPENVSWITCH;
39753978
}
39763979

3980+
static inline bool netif_is_team_master(struct net_device *dev)
3981+
{
3982+
return dev->priv_flags & IFF_TEAM;
3983+
}
3984+
39773985
/* This device needs to keep skb dst for qdisc enqueue or ndo_start_xmit() */
39783986
static inline void netif_keep_dst(struct net_device *dev)
39793987
{

0 commit comments

Comments
 (0)