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

Commit 8438884d authored by Or Gerlitz's avatar Or Gerlitz Committed by David S. Miller
Browse files

net/switchdev: Export the same parent ID service function



This helper serves to know if two switchdev port netdevices belong to the
same HW ASIC, e.g to figure out if forwarding offload is possible between them.

Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5c40348c
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -227,6 +227,8 @@ void switchdev_port_fwd_mark_set(struct net_device *dev,
				 struct net_device *group_dev,
				 bool joining);

bool switchdev_port_same_parent_id(struct net_device *a,
				   struct net_device *b);
#else

static inline void switchdev_deferred_process(void)
@@ -351,6 +353,12 @@ static inline void switchdev_port_fwd_mark_set(struct net_device *dev,
{
}

static inline bool switchdev_port_same_parent_id(struct net_device *a,
						 struct net_device *b)
{
	return false;
}

#endif

#endif /* _LINUX_SWITCHDEV_H_ */
+3 −2
Original line number Diff line number Diff line
@@ -1286,7 +1286,7 @@ void switchdev_fib_ipv4_abort(struct fib_info *fi)
}
EXPORT_SYMBOL_GPL(switchdev_fib_ipv4_abort);

static bool switchdev_port_same_parent_id(struct net_device *a,
bool switchdev_port_same_parent_id(struct net_device *a,
				   struct net_device *b)
{
	struct switchdev_attr a_attr = {
@@ -1323,6 +1323,7 @@ static u32 switchdev_port_fwd_mark_get(struct net_device *dev,

	return dev->ifindex;
}
EXPORT_SYMBOL_GPL(switchdev_port_same_parent_id);

static void switchdev_port_fwd_mark_reset(struct net_device *group_dev,
					  u32 old_mark, u32 *reset_mark)