mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-05 22:12:16 +00:00
[IPV4]: Use the {DEFINE|REF}_PROTO_INUSE infrastructure
Trivial patch to make "tcp,udp,udplite,raw" 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>
This commit is contained in:
parent
286ab3d460
commit
47a31a6ffc
4 changed files with 12 additions and 0 deletions
|
@ -2417,6 +2417,8 @@ void tcp4_proc_exit(void)
|
|||
}
|
||||
#endif /* CONFIG_PROC_FS */
|
||||
|
||||
DEFINE_PROTO_INUSE(tcp)
|
||||
|
||||
struct proto tcp_prot = {
|
||||
.name = "TCP",
|
||||
.owner = THIS_MODULE,
|
||||
|
@ -2451,6 +2453,7 @@ struct proto tcp_prot = {
|
|||
.compat_setsockopt = compat_tcp_setsockopt,
|
||||
.compat_getsockopt = compat_tcp_getsockopt,
|
||||
#endif
|
||||
REF_PROTO_INUSE(tcp)
|
||||
};
|
||||
|
||||
void __init tcp_v4_init(struct net_proto_family *ops)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue