From owner-freebsd-net@FreeBSD.ORG Fri Jul 15 20:09:46 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 6F73F16A41C for ; Fri, 15 Jul 2005 20:09:46 +0000 (GMT) (envelope-from julian@elischer.org) Received: from postoffice.vicor-nb.com (postoffice.vicor.com [69.26.56.52]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1B38843D48 for ; Fri, 15 Jul 2005 20:09:45 +0000 (GMT) (envelope-from julian@elischer.org) Received: from localhost (localhost [127.0.0.1]) by postoffice.vicor-nb.com (Postfix) with ESMTP id 911844CE7BC; Fri, 15 Jul 2005 13:09:45 -0700 (PDT) Received: from postoffice.vicor-nb.com ([127.0.0.1]) by localhost (postoffice.vicor-nb.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 42788-10; Fri, 15 Jul 2005 13:09:45 -0700 (PDT) Received: from bigwoop.vicor-nb.com (bigwoop.vicor-nb.com [208.206.78.2]) by postoffice.vicor-nb.com (Postfix) with ESMTP id EB4F04CE7BB; Fri, 15 Jul 2005 13:09:44 -0700 (PDT) Received: from [208.206.78.97] (julian.vicor-nb.com [208.206.78.97]) by bigwoop.vicor-nb.com (Postfix) with ESMTP id DAAF17A403; Fri, 15 Jul 2005 13:09:44 -0700 (PDT) Message-ID: <42D81808.3000702@elischer.org> Date: Fri, 15 Jul 2005 13:09:44 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.8) Gecko/20050629 X-Accept-Language: en, hu MIME-Version: 1.0 To: vanvorst@ieee.org References: <57865.157.127.124.134.1121445163.squirrel@www.stupendousness.org> In-Reply-To: <57865.157.127.124.134.1121445163.squirrel@www.stupendousness.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at postoffice.vicor.com Cc: freebsd-net@freebsd.org Subject: Re: netgraph question 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, 15 Jul 2005 20:09:46 -0000 Nathanael M Van Vorst wrote: >I have some questions about netgraph. I have been using the framework for >project for a little while. I am at the point where I want to hand-off >netgraph items to a kernel thread or a kernel module. Then I want the >module or thread to do some processing and hand this back to netgraph. > > I guess I should answer you on this one.. We do not have a specific facility to allow a netgraph node to create or run as a separate kernel thread. The code should be able to pass stuff to a kernel thread in much the same way that it can pass stuff to a userland thread. i.e. get some lock, put it in a queue, drop the lock again and do a wakeup on the thread to tell it there is something to get. I guess it could create the thread during node startup or type addition.. there are several examples of threads being created in /sys/kern look for instances of kthread_create(). >I looked through a little bit, and did not find an easy way. Did I miss it? > > tell us more about what you'd like to do.. >Marching on, I wrote up a little module that had two functions that a node >could call. One to register the hook to pass items back on, and one to pass >items to to the module. Inside the module I call NG_FWD_ITEM to send the >item back on the passed in hook. It always crashes in the ITEM_DEBUG >macro. Help? Where should I go? When I get a kernel core, the stack is >corrupt so it is f no use. > > I don't quite understand what you mean by "register the hook" >If anyone is curious I can send the little test code I have cobbled >together to see how I might do this. > > send to me directly. >Thanks!! > >--Nate > > >--------------------------------------- >Nathanael Van Vorst >Home: > vanvorst@ieee.org > > >“It is intuitively obvious to even the > most casual of observers!” >_______________________________________________ >freebsd-net@freebsd.org mailing list >http://lists.freebsd.org/mailman/listinfo/freebsd-net >To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" > >