From owner-freebsd-net@FreeBSD.ORG Fri Mar 27 14:42:27 2009 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8FD85106564A for ; Fri, 27 Mar 2009 14:42:27 +0000 (UTC) (envelope-from ash@aeria.net) Received: from aeria.net (aeria.net [205.134.176.42]) by mx1.freebsd.org (Postfix) with ESMTP id 6D1808FC20 for ; Fri, 27 Mar 2009 14:42:27 +0000 (UTC) (envelope-from ash@aeria.net) Received: from [IPv6:::1] (aeria.net [205.134.176.42]) by aeria.net (Postfix) with ESMTP id A0AEF47656 for ; Fri, 27 Mar 2009 14:47:05 +0000 (UTC) Message-Id: <4E7EE2F9-F213-4005-A915-819A2B8B6B66@aeria.net> From: Ash Gokhale To: freebsd-net@freebsd.org Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v930.3) Date: Fri, 27 Mar 2009 10:42:26 -0400 X-Mailer: Apple Mail (2.930.3) Subject: netgraph modules won't unload after use 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: Fri, 27 Mar 2009 14:42:28 -0000 > I'm developing a kernel module that will be doing inspection and > needed access to raw network frames, > > > But the module will never unload: ( but the UNLOAD and QUIESE event > handlers are invoked) > > #make unload :ro:~/tmp/ > > food.ko:3:14:28:31 > > /sbin/kldunload -vf food.ko > > Unloading food.ko, id=7 > > kldunload: can't unload file: Device busy > > *** Error code 1 > > > > Stop in /root/tmp/food.ko. > > Exit 1 > > #Mar 18 03:14:31 kernel: quiesced :ro:~/tmp/ > > food.ko:3:14:31:32 > > Mar 18 03:14:31 kernel: foodmod unloaded > > > Thanks so much for looking at it Julian, I never could get my netgraph module to unload, out of frustration I replaced the interfaces if_input routine with my own. I don't share this interface with the host's stack, so this measure seems appropriate. Now I have to grab about 10Gb of ram for a data structure.. I hope that's just tuning.