Skip to content

Commit 3341d91

Browse files
Nikolay Aleksandrovdavem330
authored andcommitted
net: bridge: convert mtu_set_by_user to a bit
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 <[email protected]> Reviewed-by: Stephen Hemminger <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c69c2cd commit 3341d91

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

net/bridge/br_device.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ static int br_change_mtu(struct net_device *dev, int new_mtu)
228228
dev->mtu = new_mtu;
229229

230230
/* this flag will be cleared if the MTU was automatically adjusted */
231-
br->mtu_set_by_user = true;
231+
br_opt_toggle(br, BROPT_MTU_SET_BY_USER, true);
232232
#if IS_ENABLED(CONFIG_BRIDGE_NETFILTER)
233233
/* remember the MTU in the rtable for PMTU */
234234
dst_metric_set(&br->fake_rtable.dst, RTAX_MTU, new_mtu);

net/bridge/br_if.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,14 +508,14 @@ void br_mtu_auto_adjust(struct net_bridge *br)
508508
ASSERT_RTNL();
509509

510510
/* if the bridge MTU was manually configured don't mess with it */
511-
if (br->mtu_set_by_user)
511+
if (br_opt_get(br, BROPT_MTU_SET_BY_USER))
512512
return;
513513

514514
/* change to the minimum MTU and clear the flag which was set by
515515
* the bridge ndo_change_mtu callback
516516
*/
517517
dev_set_mtu(br->dev, br_mtu_min(br));
518-
br->mtu_set_by_user = false;
518+
br_opt_toggle(br, BROPT_MTU_SET_BY_USER, false);
519519
}
520520

521521
static void br_set_gso_limits(struct net_bridge *br)

net/bridge/br_private.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ enum net_bridge_opts {
319319
BROPT_MULTICAST_STATS_ENABLED,
320320
BROPT_HAS_IPV6_ADDR,
321321
BROPT_NEIGH_SUPPRESS_ENABLED,
322+
BROPT_MTU_SET_BY_USER,
322323
};
323324

324325
struct net_bridge {
@@ -415,7 +416,6 @@ struct net_bridge {
415416
#ifdef CONFIG_NET_SWITCHDEV
416417
int offload_fwd_mark;
417418
#endif
418-
bool mtu_set_by_user;
419419
struct hlist_head fdb_list;
420420
};
421421

0 commit comments

Comments
 (0)