aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/ip.h
diff options
context:
space:
mode:
authorEric Dumazet <dada1@cosmosbay.com>2008-10-08 17:18:04 -0400
committerDavid S. Miller <davem@davemloft.net>2008-10-08 17:18:04 -0400
commit3c689b7320ae6f20dba6a8b71806a6c6fd604ee8 (patch)
treef9417dbd9f4aca952a1aba3e9a0f2a5a6e088dcd /include/net/ip.h
parent9088c5609584684149f3fb5b065aa7f18dcb03ff (diff)
inet: cleanup of local_port_range
I noticed sysctl_local_port_range[] and its associated seqlock sysctl_local_port_range_lock were on separate cache lines. Moreover, sysctl_local_port_range[] was close to unrelated variables, highly modified, leading to cache misses. Moving these two variables in a structure can help data locality and moving this structure to read_mostly section helps sharing of this data among cpus. Cleanup of extern declarations (moved in include file where they belong), and use of inet_get_local_port_range() accessor instead of direct access to ports values. Signed-off-by: Eric Dumazet <dada1@cosmosbay.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/ip.h')
-rw-r--r--include/net/ip.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/net/ip.h b/include/net/ip.h
index d678ea3d474a..1cbccaf0de3f 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -178,6 +178,10 @@ extern unsigned long snmp_fold_field(void *mib[], int offt);
178extern int snmp_mib_init(void *ptr[2], size_t mibsize); 178extern int snmp_mib_init(void *ptr[2], size_t mibsize);
179extern void snmp_mib_free(void *ptr[2]); 179extern void snmp_mib_free(void *ptr[2]);
180 180
181extern struct local_ports {
182 seqlock_t lock;
183 int range[2];
184} sysctl_local_ports;
181extern void inet_get_local_port_range(int *low, int *high); 185extern void inet_get_local_port_range(int *low, int *high);
182 186
183extern int sysctl_ip_default_ttl; 187extern int sysctl_ip_default_ttl;