1. 10 12月, 2010 4 次提交
    • E
      filter: use size of fetched data in __load_pointer() · 4bc65dd8
      Eric Dumazet 提交于
      __load_pointer() checks data we fetch from skb is included in head
      portion, but assumes we fetch one byte, instead of up to four.
      
      This wont crash because we have extra bytes (struct skb_shared_info)
      after head, but this can read uninitialized bytes.
      
      Fix this using size of the data (1, 2, 4 bytes) in the test.
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4bc65dd8
    • J
      The new jhash implementation · 60d509c8
      Jozsef Kadlecsik 提交于
      The current jhash.h implements the lookup2() hash function by Bob Jenkins.
      However, lookup2() is outdated as Bob wrote a new hash function called
      lookup3(). The patch replaces the lookup2() implementation of the 'jhash*'
      functions with that of lookup3().
      
      You can read a longer comparison of the two and other hash functions at
      http://burtleburtle.net/bob/hash/doobs.html.
      Signed-off-by: NJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
      Acked-by: NRusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      60d509c8
    • E
      net: optimize INET input path further · 68835aba
      Eric Dumazet 提交于
      Followup of commit b178bb3d (net: reorder struct sock fields)
      
      Optimize INET input path a bit further, by :
      
      1) moving sk_refcnt close to sk_lock.
      
      This reduces number of dirtied cache lines by one on 64bit arches (and
      64 bytes cache line size).
      
      2) moving inet_daddr & inet_rcv_saddr at the beginning of sk
      
      (same cache line than hash / family / bound_dev_if / nulls_node)
      
      This reduces number of accessed cache lines in lookups by one, and dont
      increase size of inet and timewait socks.
      inet and tw sockets now share same place-holder for these fields.
      
      Before patch :
      
      offsetof(struct sock, sk_refcnt) = 0x10
      offsetof(struct sock, sk_lock) = 0x40
      offsetof(struct sock, sk_receive_queue) = 0x60
      offsetof(struct inet_sock, inet_daddr) = 0x270
      offsetof(struct inet_sock, inet_rcv_saddr) = 0x274
      
      After patch :
      
      offsetof(struct sock, sk_refcnt) = 0x44
      offsetof(struct sock, sk_lock) = 0x48
      offsetof(struct sock, sk_receive_queue) = 0x68
      offsetof(struct inet_sock, inet_daddr) = 0x0
      offsetof(struct inet_sock, inet_rcv_saddr) = 0x4
      
      compute_score() (udp or tcp) now use a single cache line per ignored
      item, instead of two.
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      68835aba
    • D
      net: Abstract away all dst_entry metrics accesses. · defb3519
      David S. Miller 提交于
      Use helper functions to hide all direct accesses, especially writes,
      to dst_entry metrics values.
      
      This will allow us to:
      
      1) More easily change how the metrics are stored.
      
      2) Implement COW for metrics.
      
      In particular this will help us put metrics into the inetpeer
      cache if that is what we end up doing.  We can make the _metrics
      member a pointer instead of an array, initially have it point
      at the read-only metrics in the FIB, and then on the first set
      grab an inetpeer entry and point the _metrics member there.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Acked-by: NEric Dumazet <eric.dumazet@gmail.com>
      defb3519
  2. 09 12月, 2010 29 次提交
  3. 08 12月, 2010 2 次提交
  4. 07 12月, 2010 5 次提交