[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220107150056.250437-10-vladimir.oltean@nxp.com>
Date: Fri, 7 Jan 2022 17:00:53 +0200
From: Vladimir Oltean <vladimir.oltean@....com>
To: netdev@...r.kernel.org
Cc: Andrew Lunn <andrew@...n.ch>,
Vivien Didelot <vivien.didelot@...il.com>,
Florian Fainelli <f.fainelli@...il.com>,
Ansuel Smith <ansuelsmth@...il.com>,
Tobias Waldekranz <tobias@...dekranz.com>,
DENG Qingfang <dqfext@...il.com>
Subject: [RFC PATCH net-next 09/12] net: dsa: move dsa_foreign_dev_check above dsa_slave_switchdev_event_work
In preparation of LAG FDB support, we'll need to call
switchdev_lower_dev_find in order to get a handle of a DSA user port
from a LAG interface. That function takes dsa_foreign_dev_check() as one
of its arguments. So to avoid forward declarations,
dsa_foreign_dev_check() needs to be moved above it.
Signed-off-by: Vladimir Oltean <vladimir.oltean@....com>
---
net/dsa/slave.c | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 257298da8f83..d087b0ae0a7d 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -2086,6 +2086,22 @@ bool dsa_slave_dev_check(const struct net_device *dev)
}
EXPORT_SYMBOL_GPL(dsa_slave_dev_check);
+static bool dsa_foreign_dev_check(const struct net_device *dev,
+ const struct net_device *foreign_dev)
+{
+ const struct dsa_port *dp = dsa_slave_to_port(dev);
+ struct dsa_switch_tree *dst = dp->ds->dst;
+
+ if (netif_is_bridge_master(foreign_dev))
+ return !dsa_tree_offloads_bridge_dev(dst, foreign_dev);
+
+ if (netif_is_bridge_port(foreign_dev))
+ return !dsa_tree_offloads_bridge_port(dst, foreign_dev);
+
+ /* Everything else is foreign */
+ return true;
+}
+
static int dsa_slave_changeupper(struct net_device *dev,
struct netdev_notifier_changeupper_info *info)
{
@@ -2437,22 +2453,6 @@ static void dsa_slave_switchdev_event_work(struct work_struct *work)
kfree(switchdev_work);
}
-static bool dsa_foreign_dev_check(const struct net_device *dev,
- const struct net_device *foreign_dev)
-{
- const struct dsa_port *dp = dsa_slave_to_port(dev);
- struct dsa_switch_tree *dst = dp->ds->dst;
-
- if (netif_is_bridge_master(foreign_dev))
- return !dsa_tree_offloads_bridge_dev(dst, foreign_dev);
-
- if (netif_is_bridge_port(foreign_dev))
- return !dsa_tree_offloads_bridge_port(dst, foreign_dev);
-
- /* Everything else is foreign */
- return true;
-}
-
static int dsa_slave_fdb_event(struct net_device *dev,
struct net_device *orig_dev,
unsigned long event, const void *ctx,
--
2.25.1
Powered by blists - more mailing lists