[openib-general] [PATCH] request/response matching in MAD code

Roland Dreier roland at topspin.com
Fri Oct 1 20:05:50 PDT 2004


    Sean> Would there be any issues processing a local MAD on the HCA
    Sean> in a tasklet?  (I'm not close to the code at the moment.)
    Sean> If not, then that sounds good to me.

Hmm, that's a good point.  Making that work is probably going to take
a redesign of the MAD layer internals, and I don't think we should
tackle that right now.  For now it's probably better to have something
like a workqueue per mad_port (singlethreaded I guess, the full
per-CPU shebang feels like overkill).

Both completion handling and timeouts can be processed with
queue_work(); I think you need only two work_structs per mad_port (one
for completions and one for timeouts).  You can keep a list of timed
out sends -- when a timeout happens, just add the send to the list and
then call queue_work().

In addition to being neater (fewer kernel threads), using the
workqueue for completions makes it easier to avoid lost wakeups:
work_struct->func is guaranteed to be called after queue_work().

In the long run we probably do want to move all the MAD processing out
of process context, to avoid the SMA starvation problems that were
brought up on the list a few months ago.  So maybe the rule should be
that consumers can't sleep in callbacks, even though it's OK in the
current implementation.

 - Roland



More information about the general mailing list