Re: netgraph question

From: Julian Elischer (julian_at_elischer.org)
Date: 07/15/05

  • Next message: Chris Dionissopoulos: "Traffic quota features in IPFW"
    Date: Fri, 15 Jul 2005 13:09:44 -0700
    To: vanvorst@ieee.org
    
    

    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"
    >
    >
    _______________________________________________
    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"


  • Next message: Chris Dionissopoulos: "Traffic quota features in IPFW"

    Relevant Pages

    • netgraph question
      ... I have some questions about netgraph. ... netgraph items to a kernel thread or a kernel module. ... One to regiter the hook to pass items back on, ...
      (freebsd-net)
    • (no subject)
      ... I have some questions about netgraph. ... netgraph items to a kernel thread or a kernel module. ... One to regiter the hook to pass items back on, ...
      (freebsd-net)