From owner-freebsd-net@FreeBSD.ORG Mon Mar 24 05:42:44 2008 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 CFD6B1065670 for ; Mon, 24 Mar 2008 05:42:44 +0000 (UTC) (envelope-from chengjin@FASTSOFT.COM) Received: from HQ-ES.FASTSOFT.COM (static-71-160-206-130.lsanca.dsl-w.verizon.net [71.160.206.130]) by mx1.freebsd.org (Postfix) with ESMTP id AA0FD8FC12 for ; Mon, 24 Mar 2008 05:42:44 +0000 (UTC) (envelope-from chengjin@FASTSOFT.COM) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Date: Sun, 23 Mar 2008 22:29:12 -0700 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: novice question: unable to kldunload netgraph.ko Thread-Index: AciNb/4xJRRQLUV/SNuCHYY0DE1LqA== From: "Cheng Jin" To: Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: novice question: unable to kldunload netgraph.ko 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: Mon, 24 Mar 2008 05:42:44 -0000 Hi, =20 I have started to play around with netgraph this weekend, and I am = finding a very strange problem of not being able to kldunload any of the = ng*.ko modules, as well as netgraph.ko itself. =20 I tried on two systems running 5.4-RELEASE and 7.0-RELEASE, and the = result is the same. On both systems, I compiled netgraph after the main = kernel compilation by specifying netgraph on the MODULES_OVERRIDE line = in /etc/make.conf. Not sure if I left some component that netgraph = depends on inside the kernel? =20 I have tried the following with regard to netgraph.ko on both systems. =20 1. plain kldload and following by kldunload. The error message is = device busy. =20 2. sitting in front of the console with no active network connections, i = brought down all ethernet interfaces, tried kldunload, same device busy = error. I tried on a freshly booted system, same problem. =20 3. in front of the console, brought down all ethernet interfaces, tried = kldload followed by kldunload. Same problem. =20 I think at some point, I didnt get the device-busy error message with = kldunload, but netgraph.ko wasnt unloaded either. =20 I tried googling around and looked through all the netgraph related man = pages and netgraph related examples, and it seems that I am the only one = having this problem so I wonder if there was something really simple = thing that I overlooked? =20 Thanks, =20 Cheng =20 --- =20 On the 5.4 system, kldstat shows the following once netgraph.ko is = loaded. It has three ethernet interfaces bge0, bge1, and em0 =20 Id Refs Address Size Name 1 4 0xc0400000 4dd4a8 kernel 2 1 0xc08de000 6d90 dummynet.ko 3 1 0xc2a79000 12000 netgraph.ko =20 On the 7.0 system with fxp0 and em0 =20 Id Refs Address Size Name 1 2 0xffffffff80100000 5e4560 kernel 2 1 0xffffffffc221c000 87d4 netgraph.ko =20 If I try to look at details with ngctl, it loads ng_socket.ko, which = only makes the unloading problem harder! Not sure why the ref count is = 1 almost right away.