[INET]: Generalise tcp_tw_bucket, aka TIME_WAIT sockets
This paves the way to generalise the rest of the sock ID lookup routines and saves some bytes in TCPv4 TIME_WAIT sockets on distro kernels (where IPv6 is always built as a module): [root@qemu ~]# grep tw_sock /proc/slabinfo tw_sock_TCPv6 0 0 128 31 1 tw_sock_TCP 0 0 96 41 1 [root@qemu ~]# Now if a protocol wants to use the TIME_WAIT generic infrastructure it only has to set the sk_prot->twsk_obj_size field with the size of its inet_timewait_sock derived sock and proto_register will create sk_prot->twsk_slab, for now its only for INET sockets, but we can introduce timewait_sock later if some non INET transport protocolo wants to use this stuff. Next changesets will take advantage of this new infrastructure to generalise even more TCP code. [acme@toy net-2.6.14]$ grep built-in /tmp/before.size /tmp/after.size /tmp/before.size: 188646 11764 5068 205478 322a6 net/ipv4/built-in.o /tmp/after.size: 188144 11764 5068 204976 320b0 net/ipv4/built-in.o [acme@toy net-2.6.14]$ Tested with both IPv4 & IPv6 (::1 (localhost) & ::ffff:172.20.0.1 (qemu host)). Signed-off-by:Arnaldo Carvalho de Melo <acme@ghostprotocols.net> Signed-off-by:
David S. Miller <davem@davemloft.net>
Showing
- include/linux/ipv6.h 49 additions, 3 deletionsinclude/linux/ipv6.h
- include/linux/tcp.h 15 additions, 0 deletionsinclude/linux/tcp.h
- include/net/inet_hashtables.h 41 additions, 0 deletionsinclude/net/inet_hashtables.h
- include/net/inet_timewait_sock.h 142 additions, 0 deletionsinclude/net/inet_timewait_sock.h
- include/net/sock.h 11 additions, 6 deletionsinclude/net/sock.h
- include/net/tcp.h 4 additions, 198 deletionsinclude/net/tcp.h
- net/core/sock.c 34 additions, 1 deletionnet/core/sock.c
- net/ipv4/tcp.c 0 additions, 10 deletionsnet/ipv4/tcp.c
- net/ipv4/tcp_diag.c 6 additions, 4 deletionsnet/ipv4/tcp_diag.c
- net/ipv4/tcp_ipv4.c 55 additions, 52 deletionsnet/ipv4/tcp_ipv4.c
- net/ipv4/tcp_minisocks.c 73 additions, 69 deletionsnet/ipv4/tcp_minisocks.c
- net/ipv6/addrconf.c 1 addition, 1 deletionnet/ipv6/addrconf.c
- net/ipv6/tcp_ipv6.c 53 additions, 47 deletionsnet/ipv6/tcp_ipv6.c
Loading
Please register or sign in to comment