Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/netinet/ip_input.c,v retrieving revision 1.268 retrieving revision 1.268.2.1 diff -u -p -r1.268 -r1.268.2.1 --- src/sys/netinet/ip_input.c 2008/04/24 11:38:37 1.268 +++ src/sys/netinet/ip_input.c 2008/05/16 02:25:41 1.268.2.1 @@ -1,4 +1,4 @@ -/* $NetBSD: ip_input.c,v 1.268 2008/04/24 11:38:37 ad Exp $ */ +/* $NetBSD: ip_input.c,v 1.268.2.1 2008/05/16 02:25:41 yamt Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -45,13 +45,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED @@ -98,7 +91,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ip_input.c,v 1.268 2008/04/24 11:38:37 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ip_input.c,v 1.268.2.1 2008/05/16 02:25:41 yamt Exp $"); #include "opt_inet.h" #include "opt_gateway.h" @@ -427,10 +420,10 @@ ip_init(void) ip_nmbclusters_changed(); TAILQ_INIT(&in_ifaddrhead); - in_ifaddrhashtbl = hashinit(IN_IFADDR_HASH_SIZE, HASH_LIST, M_IFADDR, - M_WAITOK, &in_ifaddrhash); - in_multihashtbl = hashinit(IN_IFADDR_HASH_SIZE, HASH_LIST, M_IPMADDR, - M_WAITOK, &in_multihash); + in_ifaddrhashtbl = hashinit(IN_IFADDR_HASH_SIZE, HASH_LIST, true, + &in_ifaddrhash); + in_multihashtbl = hashinit(IN_IFADDR_HASH_SIZE, HASH_LIST, true, + &in_multihash); ip_mtudisc_timeout_q = rt_timer_queue_create(ip_mtudisc_timeout); #ifdef GATEWAY ipflow_init(ip_hashsize); @@ -1443,13 +1436,13 @@ ip_slowtimo(void) } /* - * Drain off all datagram fragments. + * Drain off all datagram fragments. Don't acquire softnet_lock as + * can be called from hardware interrupt context. */ void ip_drain(void) { - mutex_enter(softnet_lock); KERNEL_LOCK(1, NULL); /* @@ -1466,7 +1459,6 @@ ip_drain(void) } KERNEL_UNLOCK_ONE(NULL); - mutex_exit(softnet_lock); } /* @@ -2210,13 +2202,8 @@ sysctl_net_inet_ip_hashsize(SYSCTLFN_ARG static int sysctl_net_inet_ip_stats(SYSCTLFN_ARGS) { - netstat_sysctl_context ctx; - uint64_t ips[IP_NSTATS]; - ctx.ctx_stat = ipstat_percpu; - ctx.ctx_counters = ips; - ctx.ctx_ncounters = IP_NSTATS; - return (NETSTAT_SYSCTL(&ctx)); + return (NETSTAT_SYSCTL(ipstat_percpu, IP_NSTATS)); } SYSCTL_SETUP(sysctl_net_inet_ip_setup, "sysctl net.inet.ip subtree setup")