mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-18 15:09:53 +00:00
efe4208f47
TCP listener refactoring, part 4 : To speed up inet lookups, we moved IPv4 addresses from inet to struct sock_common Now is time to do the same for IPv6, because it permits us to have fast lookups for all kind of sockets, including upcoming SYN_RECV. Getting IPv6 addresses in TCP lookups currently requires two extra cache lines, plus a dereference (and memory stall). inet6_sk(sk) does the dereference of inet_sk(__sk)->pinet6 This patch is way bigger than its IPv4 counter part, because for IPv4, we could add aliases (inet_daddr, inet_rcv_saddr), while on IPv6, it's not doable easily. inet6_sk(sk)->daddr becomes sk->sk_v6_daddr inet6_sk(sk)->rcv_saddr becomes sk->sk_v6_rcv_saddr And timewait socket also have tw->tw_v6_daddr & tw->tw_v6_rcv_saddr at the same offset. We get rid of INET6_TW_MATCH() as INET6_MATCH() is now the generic macro. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
36 lines
788 B
C
36 lines
788 B
C
#ifndef _DCCP_IPV6_H
|
|
#define _DCCP_IPV6_H
|
|
/*
|
|
* net/dccp/ipv6.h
|
|
*
|
|
* An implementation of the DCCP protocol
|
|
* Copyright (c) 2005 Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
* under the terms of the GNU General Public License version 2 as
|
|
* published by the Free Software Foundation.
|
|
*/
|
|
|
|
#include <linux/dccp.h>
|
|
#include <linux/ipv6.h>
|
|
|
|
struct dccp6_sock {
|
|
struct dccp_sock dccp;
|
|
/*
|
|
* ipv6_pinfo has to be the last member of dccp6_sock,
|
|
* see inet6_sk_generic.
|
|
*/
|
|
struct ipv6_pinfo inet6;
|
|
};
|
|
|
|
struct dccp6_request_sock {
|
|
struct dccp_request_sock dccp;
|
|
struct inet6_request_sock inet6;
|
|
};
|
|
|
|
struct dccp6_timewait_sock {
|
|
struct inet_timewait_sock inet;
|
|
};
|
|
|
|
#endif /* _DCCP_IPV6_H */
|