From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexey Dobriyan Subject: [PATCH 2/3] net: dst: switch to 8-bit dst->flags Date: Thu, 7 Dec 2017 00:35:04 +0300 Message-ID: <20171206213505.17018-2-adobriyan@gmail.com> References: <20171206213505.17018-1-adobriyan@gmail.com> Cc: netdev@vger.kernel.org, Alexey Dobriyan To: davem@davemloft.net Return-path: Received: from mail-wr0-f194.google.com ([209.85.128.194]:39753 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752151AbdLFVfa (ORCPT ); Wed, 6 Dec 2017 16:35:30 -0500 Received: by mail-wr0-f194.google.com with SMTP id a41so5392908wra.6 for ; Wed, 06 Dec 2017 13:35:29 -0800 (PST) In-Reply-To: <20171206213505.17018-1-adobriyan@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: None of the flags is 16-bit currently. Space savings on x86_64: add/remove: 0/0 grow/shrink: 2/16 up/down: 7/-29 (-22) Function old new delta netdev_frame_hook 464 470 +6 gre_fill_metadata_dst 257 258 +1 xfrm_resolve_and_create_bundle 2817 2816 -1 ipv6_add_addr 1724 1723 -1 ip6_rt_cache_alloc 472 471 -1 ip6_route_info_create 2955 2954 -1 icmp6_dst_alloc 569 568 -1 dst_init 166 165 -1 dev_fill_metadata_dst 395 394 -1 bnxt_start_xmit 3119 3118 -1 arp_process 2524 2523 -1 addrconf_dst_alloc 442 441 -1 xfrm_lookup 2029 2027 -2 ip6_tnl_xmit 2965 2963 -2 rt_dst_alloc 200 197 -3 do_execute_actions 2799 2796 -3 addrconf_disable_policy_idev 449 445 -4 br_netfilter_rtable_init 66 61 -5 Signed-off-by: Alexey Dobriyan --- include/net/dst.h | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/include/net/dst.h b/include/net/dst.h index 0f0905bda423..25decfa4e14a 100644 --- a/include/net/dst.h +++ b/include/net/dst.h @@ -31,7 +31,7 @@ */ struct sk_buff; -typedef unsigned short __bitwise dst_flags_t; +typedef u8 __bitwise dst_flags_t; struct dst_entry { struct net_device *dev; @@ -47,14 +47,15 @@ struct dst_entry { int (*output)(struct net *net, struct sock *sk, struct sk_buff *skb); dst_flags_t flags; -#define DST_HOST ((dst_flags_t __force)0x0001) -#define DST_NOXFRM ((dst_flags_t __force)0x0002) -#define DST_NOPOLICY ((dst_flags_t __force)0x0004) -#define DST_NOCOUNT ((dst_flags_t __force)0x0008) -#define DST_FAKE_RTABLE ((dst_flags_t __force)0x0010) -#define DST_XFRM_TUNNEL ((dst_flags_t __force)0x0020) -#define DST_XFRM_QUEUE ((dst_flags_t __force)0x0040) -#define DST_METADATA ((dst_flags_t __force)0x0080) +#define DST_HOST ((dst_flags_t __force)0x01) +#define DST_NOXFRM ((dst_flags_t __force)0x02) +#define DST_NOPOLICY ((dst_flags_t __force)0x04) +#define DST_NOCOUNT ((dst_flags_t __force)0x08) +#define DST_FAKE_RTABLE ((dst_flags_t __force)0x10) +#define DST_XFRM_TUNNEL ((dst_flags_t __force)0x20) +#define DST_XFRM_QUEUE ((dst_flags_t __force)0x40) +#define DST_METADATA ((dst_flags_t __force)0x80) + u8 __pad2; /* A non-zero value of dst->obsolete forces by-hand validation * of the route entry. Positive values are set by the generic -- 2.13.6