From: Igor Maravic <redacted>
If the found tos is smaller then our tos,
don't pass through all the entries in fib_alias
list to find the match.
Directly jump to the last entry in the list, and check if the
tos value is 0.
Signed-off-by: Igor Maravic <redacted>
---
net/ipv4/fib_trie.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
@@ -265,14 +265,8 @@ static inline int tkey_sub_equals(t_key a, int offset, int bits, t_key b)staticinlineinttkey_mismatch(t_keya,intoffset,t_keyb){-t_keydiff=a^b;-inti=offset;--if(!diff)-return0;-while((diff<<i)>>(KEYLENGTH-1)==0)-i++;-returni;+t_keydiff=(a^b)&(~((t_key)0)<<offset>>offset);+returndiff?(KEYLENGTH-__fls(diff)-1):0;}/*
From: David Miller <davem@davemloft.net> Date: 2012-08-28 18:56:17
From: igorm@etf.rs
Date: Tue, 28 Aug 2012 10:52:18 +0200
From: Igor Maravic <redacted>
Optimize tkey_mismatch function by using __fls function.
Signed-off-by: Igor Maravic <redacted>
This will actually run slower on architectures like sparc that
don't have special instructions for __fls.
Your TOS "optimization" isn't very useful either since having
TOS routes is very rare.