From owner-freebsd-net@FreeBSD.ORG Sat Jul 9 17:17:54 2005 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B475116A41C for ; Sat, 9 Jul 2005 17:17:54 +0000 (GMT) (envelope-from sam@errno.com) Received: from ebb.errno.com (ebb.errno.com [66.127.85.87]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7682543D46 for ; Sat, 9 Jul 2005 17:17:54 +0000 (GMT) (envelope-from sam@errno.com) Received: from [66.127.85.94] ([66.127.85.94]) (authenticated bits=0) by ebb.errno.com (8.12.9/8.12.6) with ESMTP id j69HHpms064199 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 9 Jul 2005 10:17:52 -0700 (PDT) (envelope-from sam@errno.com) Message-ID: <42D006DB.8080108@errno.com> Date: Sat, 09 Jul 2005 10:18:19 -0700 From: Sam Leffler Organization: Errno Consulting User-Agent: Mozilla Thunderbird 1.0.2 (Macintosh/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: ming fu References: <42CEF0EB.4000107@borderware.com> In-Reply-To: <42CEF0EB.4000107@borderware.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-net@freebsd.org Subject: Re: what to replace splnet in FreeBSD 5.x? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jul 2005 17:17:54 -0000 ming fu wrote: > Hi, > > With splnet() became a no-op in sys/systm.h > > static __inline intrmask_t splnet(void) { return 0; } > > What should I use to replace the splnet? > > I have a module receiving input from both ip_input() and a device that > userland can write to. I guess I was cover from the ip_input() as it > should have the proper lock. However, I am on my own to figure out what > to replace the splnet() when receive from the device from the userland. > It uses splnet() in FreeBSD 4.x. spl's lock execution threads. 5.x and later systems mostly lock data structures using mtx's (there are a very few exceptions). Thus there isn't necessarily a direct replacement, you usually need to rethink your locking/synchronization strategy. Sam