[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <75d00c06deadc0386811874f9e4edbf5381df949.1659195179.git.sevinj.aghayeva@gmail.com>
Date: Sat, 30 Jul 2022 12:03:30 -0400
From: Sevinj Aghayeva <sevinj.aghayeva@...il.com>
To: aroulin@...dia.com
Cc: sbrivio@...hat.com, roopa@...dia.com,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Nikolay Aleksandrov <razor@...ckwall.org>,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
bridge@...ts.linux-foundation.org,
Sevinj Aghayeva <sevinj.aghayeva@...il.com>
Subject: [PATCH net-next 1/3] net: bridge: export br_vlan_upper_change
This function contains the logic for correctly setting the bridge
binding behavior of a vlan interface. Therefore, it should be executed
whenever the bridge binding flag of a vlan interface changes via the
vlan_dev_change_flags function in the 8021q module. Currently this
function is private, and it is only executed when a vlan interface is
first created. Export the function so that it can be called from
vlan_dev_change_flags.
Signed-off-by: Sevinj Aghayeva <sevinj.aghayeva@...il.com>
Reviewed-by: Stefano Brivio <sbrivio@...hat.com>
Reviewed-by: Andy Roulin <aroulin@...dia.com>
Reviewed-by: Roopa Prabhu <roopa@...dia.com>
---
include/linux/if_bridge.h | 9 +++++++++
net/bridge/br_vlan.c | 7 ++++---
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h
index d62ef428e3aa..0d92b0ed0961 100644
--- a/include/linux/if_bridge.h
+++ b/include/linux/if_bridge.h
@@ -180,6 +180,9 @@ void br_fdb_clear_offload(const struct net_device *dev, u16 vid);
bool br_port_flag_is_set(const struct net_device *dev, unsigned long flag);
u8 br_port_get_stp_state(const struct net_device *dev);
clock_t br_get_ageing_time(const struct net_device *br_dev);
+void br_vlan_upper_change(struct net_device *dev,
+ struct net_device *upper_dev,
+ bool linking);
#else
static inline struct net_device *
br_fdb_find_port(const struct net_device *br_dev,
@@ -208,6 +211,12 @@ static inline clock_t br_get_ageing_time(const struct net_device *br_dev)
{
return 0;
}
+
+static inline void br_vlan_upper_change(struct net_device *dev,
+ struct net_device *upper_dev,
+ bool linking)
+{
+}
#endif
#endif
diff --git a/net/bridge/br_vlan.c b/net/bridge/br_vlan.c
index 6e53dc991409..6bfc36da5a88 100644
--- a/net/bridge/br_vlan.c
+++ b/net/bridge/br_vlan.c
@@ -1653,9 +1653,9 @@ static void br_vlan_set_all_vlan_dev_state(struct net_bridge_port *p)
}
}
-static void br_vlan_upper_change(struct net_device *dev,
- struct net_device *upper_dev,
- bool linking)
+void br_vlan_upper_change(struct net_device *dev,
+ struct net_device *upper_dev,
+ bool linking)
{
struct net_bridge *br = netdev_priv(dev);
@@ -1670,6 +1670,7 @@ static void br_vlan_upper_change(struct net_device *dev,
br_vlan_has_upper_bind_vlan_dev(dev));
}
}
+EXPORT_SYMBOL_GPL(br_vlan_upper_change);
struct br_vlan_link_state_walk_data {
struct net_bridge *br;
--
2.25.1
Powered by blists - more mailing lists