diff options
author | Eric Dumazet <dada1@cosmosbay.com> | 2007-11-06 02:39:51 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-11-07 07:08:59 -0500 |
commit | c5a432f1a18b4b2efe691dd6bbb30d86a281f783 (patch) | |
tree | fcbff269067e11c49a0fd99a568edf03036f2d55 | |
parent | 47a31a6ffcca3b55149bccd5b99763e5eea60ac4 (diff) |
[IPV6]: Use the {DEFINE|REF}_PROTO_INUSE infrastructure
Trivial patch to make "tcpv6,udpv6,udplitev6,rawv6" protocols uses the
fast "inuse sockets" infrastructure
Each protocol use then a static percpu var, instead of a dynamic one.
This saves some ram and some cpu cycles
Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/ipv6/raw.c | 3 | ||||
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 3 | ||||
-rw-r--r-- | net/ipv6/udp.c | 3 | ||||
-rw-r--r-- | net/ipv6/udplite.c | 3 |
4 files changed, 12 insertions, 0 deletions
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c index ca24ef19cd8f..807260d03586 100644 --- a/net/ipv6/raw.c +++ b/net/ipv6/raw.c | |||
@@ -1144,6 +1144,8 @@ static int rawv6_init_sk(struct sock *sk) | |||
1144 | return(0); | 1144 | return(0); |
1145 | } | 1145 | } |
1146 | 1146 | ||
1147 | DEFINE_PROTO_INUSE(rawv6) | ||
1148 | |||
1147 | struct proto rawv6_prot = { | 1149 | struct proto rawv6_prot = { |
1148 | .name = "RAWv6", | 1150 | .name = "RAWv6", |
1149 | .owner = THIS_MODULE, | 1151 | .owner = THIS_MODULE, |
@@ -1166,6 +1168,7 @@ struct proto rawv6_prot = { | |||
1166 | .compat_setsockopt = compat_rawv6_setsockopt, | 1168 | .compat_setsockopt = compat_rawv6_setsockopt, |
1167 | .compat_getsockopt = compat_rawv6_getsockopt, | 1169 | .compat_getsockopt = compat_rawv6_getsockopt, |
1168 | #endif | 1170 | #endif |
1171 | REF_PROTO_INUSE(rawv6) | ||
1169 | }; | 1172 | }; |
1170 | 1173 | ||
1171 | #ifdef CONFIG_PROC_FS | 1174 | #ifdef CONFIG_PROC_FS |
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 06be2a1f2730..3aad861975a0 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -2107,6 +2107,8 @@ void tcp6_proc_exit(void) | |||
2107 | } | 2107 | } |
2108 | #endif | 2108 | #endif |
2109 | 2109 | ||
2110 | DEFINE_PROTO_INUSE(tcpv6) | ||
2111 | |||
2110 | struct proto tcpv6_prot = { | 2112 | struct proto tcpv6_prot = { |
2111 | .name = "TCPv6", | 2113 | .name = "TCPv6", |
2112 | .owner = THIS_MODULE, | 2114 | .owner = THIS_MODULE, |
@@ -2141,6 +2143,7 @@ struct proto tcpv6_prot = { | |||
2141 | .compat_setsockopt = compat_tcp_setsockopt, | 2143 | .compat_setsockopt = compat_tcp_setsockopt, |
2142 | .compat_getsockopt = compat_tcp_getsockopt, | 2144 | .compat_getsockopt = compat_tcp_getsockopt, |
2143 | #endif | 2145 | #endif |
2146 | REF_PROTO_INUSE(tcpv6) | ||
2144 | }; | 2147 | }; |
2145 | 2148 | ||
2146 | static struct inet6_protocol tcpv6_protocol = { | 2149 | static struct inet6_protocol tcpv6_protocol = { |
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index 8344d8c87219..ee1cc3f8599f 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c | |||
@@ -970,6 +970,8 @@ void udp6_proc_exit(void) { | |||
970 | 970 | ||
971 | /* ------------------------------------------------------------------------ */ | 971 | /* ------------------------------------------------------------------------ */ |
972 | 972 | ||
973 | DEFINE_PROTO_INUSE(udpv6) | ||
974 | |||
973 | struct proto udpv6_prot = { | 975 | struct proto udpv6_prot = { |
974 | .name = "UDPv6", | 976 | .name = "UDPv6", |
975 | .owner = THIS_MODULE, | 977 | .owner = THIS_MODULE, |
@@ -991,6 +993,7 @@ struct proto udpv6_prot = { | |||
991 | .compat_setsockopt = compat_udpv6_setsockopt, | 993 | .compat_setsockopt = compat_udpv6_setsockopt, |
992 | .compat_getsockopt = compat_udpv6_getsockopt, | 994 | .compat_getsockopt = compat_udpv6_getsockopt, |
993 | #endif | 995 | #endif |
996 | REF_PROTO_INUSE(udpv6) | ||
994 | }; | 997 | }; |
995 | 998 | ||
996 | static struct inet_protosw udpv6_protosw = { | 999 | static struct inet_protosw udpv6_protosw = { |
diff --git a/net/ipv6/udplite.c b/net/ipv6/udplite.c index 766566f7de47..5a0379f71415 100644 --- a/net/ipv6/udplite.c +++ b/net/ipv6/udplite.c | |||
@@ -40,6 +40,8 @@ static int udplite_v6_get_port(struct sock *sk, unsigned short snum) | |||
40 | return udplite_get_port(sk, snum, ipv6_rcv_saddr_equal); | 40 | return udplite_get_port(sk, snum, ipv6_rcv_saddr_equal); |
41 | } | 41 | } |
42 | 42 | ||
43 | DEFINE_PROTO_INUSE(udplitev6) | ||
44 | |||
43 | struct proto udplitev6_prot = { | 45 | struct proto udplitev6_prot = { |
44 | .name = "UDPLITEv6", | 46 | .name = "UDPLITEv6", |
45 | .owner = THIS_MODULE, | 47 | .owner = THIS_MODULE, |
@@ -62,6 +64,7 @@ struct proto udplitev6_prot = { | |||
62 | .compat_setsockopt = compat_udpv6_setsockopt, | 64 | .compat_setsockopt = compat_udpv6_setsockopt, |
63 | .compat_getsockopt = compat_udpv6_getsockopt, | 65 | .compat_getsockopt = compat_udpv6_getsockopt, |
64 | #endif | 66 | #endif |
67 | REF_PROTO_INUSE(udplitev6) | ||
65 | }; | 68 | }; |
66 | 69 | ||
67 | static struct inet_protosw udplite6_protosw = { | 70 | static struct inet_protosw udplite6_protosw = { |