Correctly wrap the producer queue index when dequeuing commands. This wasn't

a problem for command responses since we rarely ever filled the queue.
However, adapter-initiated commands have a much smaller queue and could
tickle this bug.  It's possible that this might fix the recently reported
problems with the aac-2120s, though I haven't been able to reproduce the
problem locally.

MFC-After: 1 day
This commit is contained in:
Scott Long 2003-09-16 16:07:15 +00:00
parent 855deec44c
commit 7753acd255

View File

@ -1877,7 +1877,11 @@ aac_dequeue_fib(struct aac_softc *sc, int queue, u_int32_t *fib_size,
error = ENOENT;
goto out;
}
/* wrap the pi so the following test works */
if (pi >= aac_qinfo[queue].size)
pi = 0;
notify = 0;
if (ci == pi + 1)
notify++;