net: bridge: convert mtu_set_by_user to a bit
authorNikolay Aleksandrov <nikolay@cumulusnetworks.com>
Wed, 26 Sep 2018 14:01:06 +0000 (17:01 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 26 Sep 2018 17:04:23 +0000 (10:04 -0700)
Convert the last remaining bool option to a bit thus reducing the overall
net_bridge size further by 8 bytes.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/bridge/br_device.c
net/bridge/br_if.c
net/bridge/br_private.h

index a0afdca73d8f11807544a730d87f133aad7ed409..e053a4e4375883976f668b1769ad399b707365b7 100644 (file)
@@ -228,7 +228,7 @@ static int br_change_mtu(struct net_device *dev, int new_mtu)
        dev->mtu = new_mtu;
 
        /* this flag will be cleared if the MTU was automatically adjusted */
-       br->mtu_set_by_user = true;
+       br_opt_toggle(br, BROPT_MTU_SET_BY_USER, true);
 #if IS_ENABLED(CONFIG_BRIDGE_NETFILTER)
        /* remember the MTU in the rtable for PMTU */
        dst_metric_set(&br->fake_rtable.dst, RTAX_MTU, new_mtu);
index 3bb66508f07d4fda006568313e64547b88281f6f..9b46d2dc4c224e39e865adf3956c5528da9b68f9 100644 (file)
@@ -508,14 +508,14 @@ void br_mtu_auto_adjust(struct net_bridge *br)
        ASSERT_RTNL();
 
        /* if the bridge MTU was manually configured don't mess with it */
-       if (br->mtu_set_by_user)
+       if (br_opt_get(br, BROPT_MTU_SET_BY_USER))
                return;
 
        /* change to the minimum MTU and clear the flag which was set by
         * the bridge ndo_change_mtu callback
         */
        dev_set_mtu(br->dev, br_mtu_min(br));
-       br->mtu_set_by_user = false;
+       br_opt_toggle(br, BROPT_MTU_SET_BY_USER, false);
 }
 
 static void br_set_gso_limits(struct net_bridge *br)
index 6bdcc701bc71e17e4eb72b39ebf8137c9b1e8d0b..92d08f8c7dd401d6f8b0ca42e0e5cfa2fe5a4735 100644 (file)
@@ -319,6 +319,7 @@ enum net_bridge_opts {
        BROPT_MULTICAST_STATS_ENABLED,
        BROPT_HAS_IPV6_ADDR,
        BROPT_NEIGH_SUPPRESS_ENABLED,
+       BROPT_MTU_SET_BY_USER,
 };
 
 struct net_bridge {
@@ -415,7 +416,6 @@ struct net_bridge {
 #ifdef CONFIG_NET_SWITCHDEV
        int offload_fwd_mark;
 #endif
-       bool                            mtu_set_by_user;
        struct hlist_head               fdb_list;
 };