tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: workqueue question

On Sat, 5 Apr 2008 00:16:22 +1300
Darran Hunt <> wrote:

> Hi,
> I've been working on porting a driver for a crypto-acceleration card  
> to NetBSD current (4.99.54), and I'm not quite sure that I understand  
> workqueues in NetBSD.
> Basically I've got an interrupt handler that fires when the requests  
> on the card complete, and I want to schedule a job to run outside of  
> the handler to deal with finishing the request.  The workqueue looks  
> like an easy way to do this, but it only seems to allow one job to be  
> scheduled.  To schedule more than one I'd have to manage a queue of  
> work descriptors and hand one off per job - which makes the workqueue  
> a lot less attractive as a solution.
> Have I got that wrong?  Should I be able to queue multiple jobs  
> without supplying each one with a unique work structure?
> Or is there a more appropriate mechanism that I should be using instead?

You can also use sysmon_task_queue (look in sys/dev/sysmon/sysmon_taskq).
which will run a callback function with a void * argument.

You should be able to issue sysmon_task_queue_sched(0, callback, arg) and
iterate over the linked list or so to run them.

Juan Romero Pardines - xtraeme at gmail|netbsd dot org
        The NetBSD Project

Make your own NetBSD/x86 Live CD:

Home | Main Index | Thread Index | Old Index