David Kahn wrote:

> I would like to see a minor clarification to the
> nreq argument in ddi_set_nreq(9f).
>
> It's not clear to me if nreq means I want nreq
> more interrupts than I have now, or if it means
> I want nreq total interrupts, including the n
> that are already allocated to me. I think it's
> the latter, but the man page should be more
> specific about it by stating that nreq is the
> total number of interrupt resources (including
> those already allocated to the device instance)
> that this instance of the device driver would
> like to use.

You are correct, it is the latter.  The 'nreq' value
is the total number of interrupts that the device
wants.

If a driver initially wanted 8 interrupts, it would
have called ddi_intr_alloc(9F) with a 'count' of
8 to request then.  That value becomes the initial
'nreq' parameter for the driver.  If at some later
time the driver changes its mind and decides it
only needs to use a total of 4 interrupts, it should
call ddi_intr_set_nreq(9F) with an 'nreq' value of
4.

There is a paragraph in the ddi_intr_set_nreq(9F)
manpage that tries to define what 'nreq' is.  I will
improve it, perhaps like this:

    The nreq parameter is the total number of interrupts
    that the driver requests from the system.  Initially
    it is set to be equal to the count parameter when the
    driver first calls the ddi_intr_alloc(9F) function.
    If the driver detects changes in its workload and it
    decides it needs more or less interrupt vectors, then
    it may call the function ddi_intr_set_nreq() to change
    its nreq parameter.  The function ddi_intr_set_nreq()
    replaces the current nreq value with whatever new value
    is specified.

I hope that wording is clear enough?

--
Scott


Reply via email to