From 77ef013aadadd248843ad90022f36ba177b24e7f Mon Sep 17 00:00:00 2001 From: David Ahern Date: Fri, 31 Mar 2017 07:14:00 -0700 Subject: net: mpls: Convert number of nexthops to u8 Number of nexthops and number of alive nexthops are tracked using an unsigned int. A route should never have more than 255 nexthops so convert both to u8. Update all references and intermediate variables to consistently use u8 as well. Shrinks the size of mpls_route from 32 bytes to 24 bytes with a 2-byte hole before the nexthops. Signed-off-by: David Ahern Signed-off-by: David S. Miller --- net/mpls/internal.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'net/mpls/internal.h') diff --git a/net/mpls/internal.h b/net/mpls/internal.h index 91419fe63464..2ac97433c3b7 100644 --- a/net/mpls/internal.h +++ b/net/mpls/internal.h @@ -127,12 +127,13 @@ struct mpls_route { /* next hop label forwarding entry */ u8 rt_payload_type; u8 rt_max_alen; u8 rt_ttl_propagate; - unsigned int rt_nhn; + u8 rt_nhn; /* rt_nhn_alive is accessed under RCU in the packet path; it * is modified handling netdev events with rtnl lock held */ - unsigned int rt_nhn_alive; + u8 rt_nhn_alive; + u16 rt_reserved1; struct mpls_nh rt_nh[0]; }; -- cgit v1.2.3