1. 07 10月, 2005 2 次提交
  2. 06 10月, 2005 1 次提交
  3. 05 10月, 2005 4 次提交
  4. 04 10月, 2005 1 次提交
    • E
      [INET]: speedup inet (tcp/dccp) lookups · 81c3d547
      Eric Dumazet 提交于
      Arnaldo and I agreed it could be applied now, because I have other
      pending patches depending on this one (Thank you Arnaldo)
      
      (The other important patch moves skc_refcnt in a separate cache line,
      so that the SMP/NUMA performance doesnt suffer from cache line ping pongs)
      
      1) First some performance data :
      --------------------------------
      
      tcp_v4_rcv() wastes a *lot* of time in __inet_lookup_established()
      
      The most time critical code is :
      
      sk_for_each(sk, node, &head->chain) {
           if (INET_MATCH(sk, acookie, saddr, daddr, ports, dif))
               goto hit; /* You sunk my battleship! */
      }
      
      The sk_for_each() does use prefetch() hints but only the begining of
      "struct sock" is prefetched.
      
      As INET_MATCH first comparison uses inet_sk(__sk)->daddr, wich is far
      away from the begining of "struct sock", it has to bring into CPU
      cache cold cache line. Each iteration has to use at least 2 cache
      lines.
      
      This can be problematic if some chains are very long.
      
      2) The goal
      -----------
      
      The idea I had is to change things so that INET_MATCH() may return
      FALSE in 99% of cases only using the data already in the CPU cache,
      using one cache line per iteration.
      
      3) Description of the patch
      ---------------------------
      
      Adds a new 'unsigned int skc_hash' field in 'struct sock_common',
      filling a 32 bits hole on 64 bits platform.
      
      struct sock_common {
      	unsigned short		skc_family;
      	volatile unsigned char	skc_state;
      	unsigned char		skc_reuse;
      	int			skc_bound_dev_if;
      	struct hlist_node	skc_node;
      	struct hlist_node	skc_bind_node;
      	atomic_t		skc_refcnt;
      +	unsigned int		skc_hash;
      	struct proto		*skc_prot;
      };
      
      Store in this 32 bits field the full hash, not masked by (ehash_size -
      1) Using this full hash as the first comparison done in INET_MATCH
      permits us immediatly skip the element without touching a second cache
      line in case of a miss.
      
      Suppress the sk_hashent/tw_hashent fields since skc_hash (aliased to
      sk_hash and tw_hash) already contains the slot number if we mask with
      (ehash_size - 1)
      
      File include/net/inet_hashtables.h
      
      64 bits platforms :
      #define INET_MATCH(__sk, __hash, __cookie, __saddr, __daddr, __ports, __dif)\
           (((__sk)->sk_hash == (__hash))
           ((*((__u64 *)&(inet_sk(__sk)->daddr)))== (__cookie))   &&  \
           ((*((__u32 *)&(inet_sk(__sk)->dport))) == (__ports))   &&  \
           (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif))))
      
      32bits platforms:
      #define TCP_IPV4_MATCH(__sk, __hash, __cookie, __saddr, __daddr, __ports, __dif)\
           (((__sk)->sk_hash == (__hash))                 &&  \
           (inet_sk(__sk)->daddr          == (__saddr))   &&  \
           (inet_sk(__sk)->rcv_saddr      == (__daddr))   &&  \
           (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif))))
      
      
      - Adds a prefetch(head->chain.first) in 
      __inet_lookup_established()/__tcp_v4_check_established() and 
      __inet6_lookup_established()/__tcp_v6_check_established() and 
      __dccp_v4_check_established() to bring into cache the first element of the 
      list, before the {read|write}_lock(&head->lock);
      Signed-off-by: NEric Dumazet <dada1@cosmosbay.com>
      Acked-by: NArnaldo Carvalho de Melo <acme@ghostprotocols.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      81c3d547
  5. 22 9月, 2005 7 次提交
  6. 15 9月, 2005 1 次提交
    • J
      [IPVS]: ip_vs_ftp breaks connections using persistence · 87375ab4
      Julian Anastasov 提交于
      ip_vs_ftp when loaded can create NAT connections with unknown client
      port for passive FTP. For such expectations we lookup with cport=0 on
      incoming packet but it matches the format of the persistence templates
      causing packets to other persistent virtual servers to be forwarded to
      real server without creating connection. Later the reply packets are
      treated as foreign and not SNAT-ed.
      
      This patch changes the connection lookup for packets from clients:
      
      * introduce IP_VS_CONN_F_TEMPLATE connection flag to mark the
        connection as template
      
      * create new connection lookup function just for templates -
        ip_vs_ct_in_get
      
      * make sure ip_vs_conn_in_get hits only connections with
        IP_VS_CONN_F_NO_CPORT flag set when s_port is 0. By this way
        we avoid returning template when looking for cport=0 (ftp)
      Signed-off-by: NJulian Anastasov <ja@ssi.bg>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      87375ab4
  7. 13 9月, 2005 6 次提交
  8. 09 9月, 2005 2 次提交
  9. 08 9月, 2005 3 次提交
  10. 07 9月, 2005 2 次提交
    • J
      [PATCH] WE-19 for kernel 2.6.13 · 6582c164
      Jean Tourrilhes 提交于
      	Hi Jeff,
      
      	This is version 19 of the Wireless Extensions. It was supposed
      to be the fallback of the WPA API changes, but people seem quite happy
      about it (especially Jouni), so the patch is rather small.
      	The patch has been fully tested with 2.6.13 and various
      wireless drivers, and is in its final version. Would you mind pushing
      that into Linus's kernel so that the driver and the apps can take
      advantage ot it ?
      
      	It includes :
      	o iwstat improvement (explicit dBm). This is the result of
      long discussions with Dan Williams, the authors of
      NetworkManager. Thanks to him for all the fruitful feedback.
      	o remove pointer from event stream. I was not totally sure if
      this pointer was 32-64 bits clean, so I'd rather remove it and be at
      peace with it.
      	o remove linux header from wireless.h. This has long been
      requested by people writting user space apps, now it's done, and it
      was not even painful.
      	o final deprecation of spy_offset. You did not like it, it's
      now gone for good.
      	o Start deprecating dev->get_wireless_stats -> debloat netdev
      	o Add "check" version of event macros for ieee802.11
      stack. Jiri Benc doesn't like the current macros, we aim to please ;-)
      	All those changes, except the last one, have been bit-roting on
      my web pages for a while...
      
      	Patches for most kernel drivers will follow. Patches for the
      Orinoco and the HostAP drivers have been sent to their respective
      maintainers.
      
      	Have fun...
      
      	Jean
      Signed-off-by: NJeff Garzik <jgarzik@pobox.com>
      6582c164
    • R
      [AX25]: Make ax2asc thread-proof · f75268cd
      Ralf Baechle 提交于
      Ax2asc was still using a static buffer for all invocations which isn't
      exactly SMP-safe.  Change ax2asc to take an additional result buffer as
      the argument.  Change all callers to provide such a buffer.
      Signed-off-by: NRalf Baechle DL5RB <ralf@linux-mips.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f75268cd
  11. 06 9月, 2005 2 次提交
  12. 02 9月, 2005 4 次提交
  13. 30 8月, 2005 5 次提交