Netdev List
 help / color / mirror / Atom feed
From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
To: netdev@vger.kernel.org
Cc: roopa@cumulusnetworks.com, davem@davemloft.net,
	stephen@networkplumber.org, bridge@lists.linux-foundation.org,
	idosch@idosch.org,
	Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Subject: [PATCH net-next v2 4/9] net: bridge: convert group_addr_set option to a bit
Date: Wed, 26 Sep 2018 17:01:02 +0300	[thread overview]
Message-ID: <20180926140107.10218-5-nikolay@cumulusnetworks.com> (raw)
In-Reply-To: <20180926140107.10218-1-nikolay@cumulusnetworks.com>

Convert group_addr_set internal bridge opt to a bit.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
---
 net/bridge/br_netlink.c  | 2 +-
 net/bridge/br_private.h  | 2 +-
 net/bridge/br_sysfs_br.c | 2 +-
 net/bridge/br_vlan.c     | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
index 521893df0c2a..b00ccf35c35d 100644
--- a/net/bridge/br_netlink.c
+++ b/net/bridge/br_netlink.c
@@ -1139,7 +1139,7 @@ static int br_changelink(struct net_device *brdev, struct nlattr *tb[],
 		spin_lock_bh(&br->lock);
 		memcpy(br->group_addr, new_addr, sizeof(br->group_addr));
 		spin_unlock_bh(&br->lock);
-		br->group_addr_set = true;
+		br_opt_toggle(br, BROPT_GROUP_ADDR_SET, true);
 		br_recalculate_fwd_mask(br);
 	}
 
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index d8eadab09d7d..dda117ce386e 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -312,6 +312,7 @@ enum net_bridge_opts {
 	BROPT_NF_CALL_IPTABLES,
 	BROPT_NF_CALL_IP6TABLES,
 	BROPT_NF_CALL_ARPTABLES,
+	BROPT_GROUP_ADDR_SET,
 };
 
 struct net_bridge {
@@ -355,7 +356,6 @@ struct net_bridge {
 	unsigned long			bridge_ageing_time;
 
 	u8				group_addr[ETH_ALEN];
-	bool				group_addr_set;
 
 	enum {
 		BR_NO_STP, 		/* no spanning tree */
diff --git a/net/bridge/br_sysfs_br.c b/net/bridge/br_sysfs_br.c
index 0f8545c94948..4c2d56354d89 100644
--- a/net/bridge/br_sysfs_br.c
+++ b/net/bridge/br_sysfs_br.c
@@ -303,7 +303,7 @@ static ssize_t group_addr_store(struct device *d,
 	ether_addr_copy(br->group_addr, new_addr);
 	spin_unlock_bh(&br->lock);
 
-	br->group_addr_set = true;
+	br_opt_toggle(br, BROPT_GROUP_ADDR_SET, true);
 	br_recalculate_fwd_mask(br);
 	netdev_state_change(br->dev);
 
diff --git a/net/bridge/br_vlan.c b/net/bridge/br_vlan.c
index 61d698bfe2b7..5942e03dd845 100644
--- a/net/bridge/br_vlan.c
+++ b/net/bridge/br_vlan.c
@@ -695,7 +695,7 @@ struct net_bridge_vlan *br_vlan_find(struct net_bridge_vlan_group *vg, u16 vid)
 /* Must be protected by RTNL. */
 static void recalculate_group_addr(struct net_bridge *br)
 {
-	if (br->group_addr_set)
+	if (br_opt_get(br, BROPT_GROUP_ADDR_SET))
 		return;
 
 	spin_lock_bh(&br->lock);
-- 
2.11.0

  parent reply	other threads:[~2018-09-26 20:14 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-26 14:00 [PATCH net-next v2 0/9] net: bridge: convert bool options to bits Nikolay Aleksandrov
2018-09-26 14:00 ` [PATCH net-next v2 1/9] net: bridge: make struct opening bracket consistent Nikolay Aleksandrov
2018-09-26 14:01 ` [PATCH net-next v2 2/9] net: bridge: add bitfield for options and convert vlan opts Nikolay Aleksandrov
2018-09-26 14:01 ` [PATCH net-next v2 3/9] net: bridge: convert nf call options to bits Nikolay Aleksandrov
2018-09-26 14:01 ` Nikolay Aleksandrov [this message]
2018-09-26 14:01 ` [PATCH net-next v2 5/9] net: bridge: convert and rename mcast disabled Nikolay Aleksandrov
2018-09-26 14:01 ` [PATCH net-next v2 6/9] net: bridge: convert mcast options to bits Nikolay Aleksandrov
2018-09-26 14:01 ` [PATCH net-next v2 7/9] net: bridge: convert neigh_suppress_enabled option to a bit Nikolay Aleksandrov
2018-09-26 14:01 ` [PATCH net-next v2 8/9] net: bridge: convert mtu_set_by_user " Nikolay Aleksandrov
2018-09-26 14:01 ` [PATCH net-next v2 9/9] net: bridge: pack net_bridge better Nikolay Aleksandrov
2018-09-26 14:04 ` [PATCH net-next v2 0/9] net: bridge: convert bool options to bits Nikolay Aleksandrov
2018-09-26 17:04   ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180926140107.10218-5-nikolay@cumulusnetworks.com \
    --to=nikolay@cumulusnetworks.com \
    --cc=bridge@lists.linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=idosch@idosch.org \
    --cc=netdev@vger.kernel.org \
    --cc=roopa@cumulusnetworks.com \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox