1. 13 3月, 2015 1 次提交
    • A
      fib_trie: Provide a deterministic order for fib_alias w/ tables merged · 0b65bd97
      Alexander Duyck 提交于
      This change makes it so that we should always have a deterministic ordering
      for the main and local aliases within the merged table when two leaves
      overlap.
      
      So for example if we have a leaf with a key of 192.168.254.0.  If we
      previously added two aliases with a prefix length of 24 from both local and
      main the first entry would be first and the second would be second.  When I
      was coding this I had added a WARN_ON should such a situation occur as I
      wasn't sure how likely it would be.  However this WARN_ON has been
      triggered so this is something that should be addressed.
      
      With this patch the ordering of the aliases is as follows.  First they are
      sorted on prefix length, then on their table ID, then tos, and finally
      priority.  This way what we end up doing is essentially interleaving the
      two tables on what used to be leaf_info structure boundaries.
      
      Fixes: 0ddcf43d ("ipv4: FIB Local/MAIN table collapse")
      Reported-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NAlexander Duyck <alexander.h.duyck@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0b65bd97
  2. 12 3月, 2015 2 次提交
    • A
      fib_trie: Only display main table in /proc/net/route · 654eff45
      Alexander Duyck 提交于
      When we merged the tries for local and main I had overlooked the iterator
      for /proc/net/route.  As a result it was outputting both local and main
      when the two tries were merged.
      
      This patch resolves that by only providing output for aliases that are
      actually in the main trie.  As a result we should go back to the original
      behavior which I assume will be necessary to maintain legacy support.
      
      Fixes: 0ddcf43d ("ipv4: FIB Local/MAIN table collapse")
      Signed-off-by: NAlexander Duyck <alexander.h.duyck@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      654eff45
    • A
      ipv4: FIB Local/MAIN table collapse · 0ddcf43d
      Alexander Duyck 提交于
      This patch is meant to collapse local and main into one by converting
      tb_data from an array to a pointer.  Doing this allows us to point the
      local table into the main while maintaining the same variables in the
      table.
      
      As such the tb_data was converted from an array to a pointer, and a new
      array called data is added in order to still provide an object for tb_data
      to point to.
      
      In order to track the origin of the fib aliases a tb_id value was added in
      a hole that existed on 64b systems.  Using this we can also reverse the
      merge in the event that custom FIB rules are enabled.
      
      With this patch I am seeing an improvement of 20ns to 30ns for routing
      lookups as long as custom rules are not enabled, with custom rules enabled
      we fall back to split tables and the original behavior.
      Signed-off-by: NAlexander Duyck <alexander.h.duyck@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0ddcf43d
  3. 11 3月, 2015 2 次提交
  4. 10 3月, 2015 1 次提交
  5. 07 3月, 2015 10 次提交
  6. 06 3月, 2015 3 次提交
  7. 05 3月, 2015 8 次提交
  8. 28 2月, 2015 4 次提交
  9. 26 1月, 2015 7 次提交
  10. 01 1月, 2015 2 次提交
    • A
      fib_trie: Add tracking value for suffix length · 5405afd1
      Alexander Duyck 提交于
      This change adds a tracking value for the maximum suffix length of all
      prefixes stored in any given tnode.  With this value we can determine if we
      need to backtrace or not based on if the suffix is greater than the pos
      value.
      
      By doing this we can reduce the CPU overhead for lookups in the local table
      as many of the prefixes there are 32b long and have a suffix length of 0
      meaning we can immediately backtrace to the root node without needing to
      test any of the nodes between it and where we ended up.
      Signed-off-by: NAlexander Duyck <alexander.h.duyck@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5405afd1
    • A
      fib_trie: Remove checks for index >= tnode_child_length from tnode_get_child · 21d1f11d
      Alexander Duyck 提交于
      For some reason the compiler doesn't seem to understand that when we are in
      a loop that runs from tnode_child_length - 1 to 0 we don't expect the value
      of tn->bits to change.  As such every call to tnode_get_child was rerunning
      tnode_chile_length which ended up consuming quite a bit of space in the
      resultant assembly code.
      
      I have gone though and verified that in all cases where tnode_get_child
      is used we are either winding though a fixed loop from tnode_child_length -
      1 to 0, or are in a fastpath case where we are verifying the value by
      either checking for any remaining bits after shifting index by bits and
      testing for leaf, or by using tnode_child_length.
      
      size net/ipv4/fib_trie.o
      Before:
         text	   data	    bss	    dec	    hex	filename
        15506	    376	      8	  15890	   3e12	net/ipv4/fib_trie.o
      
      After:
         text	   data	    bss	    dec	    hex	filename
        14827	    376	      8	  15211	   3b6b	net/ipv4/fib_trie.o
      Signed-off-by: NAlexander Duyck <alexander.h.duyck@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      21d1f11d