Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3443b00e authored by Petr Machata's avatar Petr Machata Committed by David S. Miller
Browse files

team: Publish team_port_get_rcu()



A follow-up patch adds a new entry point, team_port_dev_txable(). Making
it an ordinary exported function would mean that any module that may
need the service in one of the supported configurations also
unconditionally needs to pull in the team module, whether or not the
user actually intends to create team interfaces.

To prevent that, team_port_dev_txable() is defined in if_team.h, and
therefore all dependencies of that function also need to be
publicly-visible.

Therefore move team_port_get_rcu() from team.c to if_team.h.

Signed-off-by: default avatarPetr Machata <petrm@mellanox.com>
Reviewed-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 80fd2d6c
Loading
Loading
Loading
Loading
+0 −5
Original line number Original line Diff line number Diff line
@@ -41,11 +41,6 @@


#define team_port_exists(dev) (dev->priv_flags & IFF_TEAM_PORT)
#define team_port_exists(dev) (dev->priv_flags & IFF_TEAM_PORT)


static struct team_port *team_port_get_rcu(const struct net_device *dev)
{
	return rcu_dereference(dev->rx_handler_data);
}

static struct team_port *team_port_get_rtnl(const struct net_device *dev)
static struct team_port *team_port_get_rtnl(const struct net_device *dev)
{
{
	struct team_port *port = rtnl_dereference(dev->rx_handler_data);
	struct team_port *port = rtnl_dereference(dev->rx_handler_data);
+5 −0
Original line number Original line Diff line number Diff line
@@ -74,6 +74,11 @@ struct team_port {
	long mode_priv[0];
	long mode_priv[0];
};
};


static inline struct team_port *team_port_get_rcu(const struct net_device *dev)
{
	return rcu_dereference(dev->rx_handler_data);
}

static inline bool team_port_enabled(struct team_port *port)
static inline bool team_port_enabled(struct team_port *port)
{
{
	return port->index != -1;
	return port->index != -1;