• Alexander Duyck's avatar
    fib_trie: Update last spot w/ idx >> n->bits code and explanation · 71e8b67d
    Alexander Duyck authored
    This change updates the fib_table_lookup function so that it is in sync
    with the fib_find_node function in terms of the explanation for the index
    check based on the bits value.
    
    I have also updated it from doing a mask to just doing a compare as I have
    found that seems to provide more options to the compiler as I have seen it
    turn this into a shift of the value and test under some circumstances.
    
    In addition I addressed one minor issue in which we kept computing the key
    ^ n->key when checking the fib aliases.  I pulled the xor out of the loop
    in order to reduce the number of memory reads in the lookup.  As a result
    we should save a couple cycles since the xor is only done once much earlier
    in the lookup.
    Signed-off-by: default avatarAlexander Duyck <alexander.h.duyck@redhat.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    71e8b67d
fib_trie.c 57.8 KB