All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 4/4] NET : makes sctp use the  {DEFINE|REF}_PROTO_INUSE infrastructure
@ 2007-11-05 18:03 Eric Dumazet
  0 siblings, 0 replies; only message in thread
From: Eric Dumazet @ 2007-11-05 18:03 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev

[-- Attachment #1: Type: text/plain, Size: 259 bytes --]

Trivial patch to make "sctcp,sctpv6" 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>



[-- Attachment #2: prot_inuse_sctp.patch --]
[-- Type: text/plain, Size: 1053 bytes --]

diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index bd6f42a..a7ecf31 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -6455,6 +6455,8 @@ static void sctp_sock_migrate(struct sock *oldsk, struct sock *newsk,
 }
 
 
+DEFINE_PROTO_INUSE(sctp)
+
 /* This proto struct describes the ULP interface for SCTP.  */
 struct proto sctp_prot = {
 	.name        =	"SCTP",
@@ -6483,9 +6485,12 @@ struct proto sctp_prot = {
 	.memory_pressure = &sctp_memory_pressure,
 	.enter_memory_pressure = sctp_enter_memory_pressure,
 	.memory_allocated = &sctp_memory_allocated,
+	REF_PROTO_INUSE(sctp)
 };
 
 #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
+DEFINE_PROTO_INUSE(sctpv6)
+
 struct proto sctpv6_prot = {
 	.name		= "SCTPv6",
 	.owner		= THIS_MODULE,
@@ -6513,5 +6518,6 @@ struct proto sctpv6_prot = {
 	.memory_pressure = &sctp_memory_pressure,
 	.enter_memory_pressure = sctp_enter_memory_pressure,
 	.memory_allocated = &sctp_memory_allocated,
+	REF_PROTO_INUSE(sctpv6)
 };
 #endif /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2007-11-05 18:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-05 18:03 [PATCH 4/4] NET : makes sctp use the {DEFINE|REF}_PROTO_INUSE infrastructure Eric Dumazet

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.