]> git.baikalelectronics.ru Git - kernel.git/commit
ipv4: save cpu cycles from check_leaf()
authorEric Dumazet <eric.dumazet@gmail.com>
Mon, 18 Jul 2011 03:16:33 +0000 (03:16 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 18 Jul 2011 17:41:18 +0000 (10:41 -0700)
commitbddc5e602dab05c0afcbc512dcf3799c0e8483a3
tree4965fe06affeaa121afa4a18b0644cbeb9e7d639
parent8badca03a429f49aad68e4251d6e5a7c6702423a
ipv4: save cpu cycles from check_leaf()

Compiler is not smart enough to avoid double BSWAP instructions in
ntohl(inet_make_mask(plen)).

Lets cache this value in struct leaf_info, (fill a hole on 64bit arches)

With route cache disabled, this saves ~2% of cpu in udpflood bench on
x86_64 machine.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/fib_trie.c