All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net: bridge: use netif_is_bridge_port()
@ 2019-03-29 13:38 Julian Wiedmann
  2019-03-29 14:50 ` Roopa Prabhu
  2019-03-29 20:48 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Julian Wiedmann @ 2019-03-29 13:38 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Julian Wiedmann, Roopa Prabhu, Nikolay Aleksandrov

Replace the br_port_exists() macro with its twin from netdevice.h

CC: Roopa Prabhu <roopa@cumulusnetworks.com>
CC: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
---
 net/bridge/br_if.c        | 2 +-
 net/bridge/br_multicast.c | 6 +++---
 net/bridge/br_netlink.c   | 2 +-
 net/bridge/br_private.h   | 6 ++----
 4 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index 41f0a696a65f..4a9aaa3fac8f 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -179,7 +179,7 @@ int nbp_backup_change(struct net_bridge_port *p,
 	ASSERT_RTNL();
 
 	if (backup_dev) {
-		if (!br_port_exists(backup_dev))
+		if (!netif_is_bridge_port(backup_dev))
 			return -ENOENT;
 
 		backup_p = br_port_get_rtnl(backup_dev);
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
index b257342c0860..f5343dfac282 100644
--- a/net/bridge/br_multicast.c
+++ b/net/bridge/br_multicast.c
@@ -2189,7 +2189,7 @@ int br_multicast_list_adjacent(struct net_device *dev,
 	int count = 0;
 
 	rcu_read_lock();
-	if (!br_ip_list || !br_port_exists(dev))
+	if (!br_ip_list || !netif_is_bridge_port(dev))
 		goto unlock;
 
 	port = br_port_get_rcu(dev);
@@ -2236,7 +2236,7 @@ bool br_multicast_has_querier_anywhere(struct net_device *dev, int proto)
 	bool ret = false;
 
 	rcu_read_lock();
-	if (!br_port_exists(dev))
+	if (!netif_is_bridge_port(dev))
 		goto unlock;
 
 	port = br_port_get_rcu(dev);
@@ -2272,7 +2272,7 @@ bool br_multicast_has_querier_adjacent(struct net_device *dev, int proto)
 	bool ret = false;
 
 	rcu_read_lock();
-	if (!br_port_exists(dev))
+	if (!netif_is_bridge_port(dev))
 		goto unlock;
 
 	port = br_port_get_rcu(dev);
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
index 9c07591b0232..4f9f59eba8b4 100644
--- a/net/bridge/br_netlink.c
+++ b/net/bridge/br_netlink.c
@@ -102,7 +102,7 @@ static size_t br_get_link_af_size_filtered(const struct net_device *dev,
 	size_t vinfo_sz = 0;
 
 	rcu_read_lock();
-	if (br_port_exists(dev)) {
+	if (netif_is_bridge_port(dev)) {
 		p = br_port_get_rcu(dev);
 		vg = nbp_vlan_group_rcu(p);
 	} else if (dev->priv_flags & IFF_EBRIDGE) {
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index 00deef7fc1f3..7946aa3b6e09 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -288,8 +288,6 @@ struct net_bridge_port {
 #define br_auto_port(p) ((p)->flags & BR_AUTO_MASK)
 #define br_promisc_port(p) ((p)->flags & BR_PROMISC)
 
-#define br_port_exists(dev) (dev->priv_flags & IFF_BRIDGE_PORT)
-
 static inline struct net_bridge_port *br_port_get_rcu(const struct net_device *dev)
 {
 	return rcu_dereference(dev->rx_handler_data);
@@ -297,13 +295,13 @@ static inline struct net_bridge_port *br_port_get_rcu(const struct net_device *d
 
 static inline struct net_bridge_port *br_port_get_rtnl(const struct net_device *dev)
 {
-	return br_port_exists(dev) ?
+	return netif_is_bridge_port(dev) ?
 		rtnl_dereference(dev->rx_handler_data) : NULL;
 }
 
 static inline struct net_bridge_port *br_port_get_rtnl_rcu(const struct net_device *dev)
 {
-	return br_port_exists(dev) ?
+	return netif_is_bridge_port(dev) ?
 		rcu_dereference_rtnl(dev->rx_handler_data) : NULL;
 }
 
-- 
2.16.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: bridge: use netif_is_bridge_port()
  2019-03-29 13:38 [PATCH net-next] net: bridge: use netif_is_bridge_port() Julian Wiedmann
@ 2019-03-29 14:50 ` Roopa Prabhu
  2019-03-29 20:48 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Roopa Prabhu @ 2019-03-29 14:50 UTC (permalink / raw)
  To: Julian Wiedmann; +Cc: David Miller, netdev, Nikolay Aleksandrov

On Fri, Mar 29, 2019 at 6:38 AM Julian Wiedmann <jwi@linux.ibm.com> wrote:
>
> Replace the br_port_exists() macro with its twin from netdevice.h
>
> CC: Roopa Prabhu <roopa@cumulusnetworks.com>
> CC: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
> Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>

Acked-by: Roopa Prabhu <roopa@cumulusnetworks.com>

Looks fine to me.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: bridge: use netif_is_bridge_port()
  2019-03-29 13:38 [PATCH net-next] net: bridge: use netif_is_bridge_port() Julian Wiedmann
  2019-03-29 14:50 ` Roopa Prabhu
@ 2019-03-29 20:48 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2019-03-29 20:48 UTC (permalink / raw)
  To: jwi; +Cc: netdev, roopa, nikolay

From: Julian Wiedmann <jwi@linux.ibm.com>
Date: Fri, 29 Mar 2019 14:38:19 +0100

> Replace the br_port_exists() macro with its twin from netdevice.h
> 
> CC: Roopa Prabhu <roopa@cumulusnetworks.com>
> CC: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
> Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>

Applied.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-04-01 18:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-29 13:38 [PATCH net-next] net: bridge: use netif_is_bridge_port() Julian Wiedmann
2019-03-29 14:50 ` Roopa Prabhu
2019-03-29 20:48 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.