diff options
author | mav <mav@FreeBSD.org> | 2013-04-14 09:28:14 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2013-04-14 09:28:14 +0000 |
commit | f73c311ca37f75cf30157cd16614f936361e956b (patch) | |
tree | 1d81a4da7dc0d4b83ea7f806877e819a87a097c0 /sys/cam/cam_queue.c | |
parent | c44db570146ee657cb698f0049082eff80c229a0 (diff) | |
download | FreeBSD-src-f73c311ca37f75cf30157cd16614f936361e956b.zip FreeBSD-src-f73c311ca37f75cf30157cd16614f936361e956b.tar.gz |
MFprojects/camlock r248890, r248897, r248898, r248900, r248903, r248905,
r248917, r248918, r248978, r249001, r249014, r249030:
Remove multilevel freezing mechanism, implemented to handle specifics of
the ATA/SATA error recovery, when post-reset recovery commands should be
allocated when queues are already full of payload requests. Instead of
removing frozen CCBs with specified range of priorities from the queue
to provide free openings, use simple hack, allowing explicit CCBs over-
allocation for requests with priority higher (numerically lower) then
CAM_PRIORITY_OOB threshold.
Simplify CCB allocation logic by removing SIM-level allocation queue.
After that SIM-level queue manages only CCBs execution, while allocation
logic is localized within each single device.
Suggested by: gibbs
Diffstat (limited to 'sys/cam/cam_queue.c')
-rw-r--r-- | sys/cam/cam_queue.c | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/sys/cam/cam_queue.c b/sys/cam/cam_queue.c index 359e7f4..41d0167 100644 --- a/sys/cam/cam_queue.c +++ b/sys/cam/cam_queue.c @@ -230,15 +230,8 @@ int cam_devq_init(struct cam_devq *devq, int devices, int openings) { bzero(devq, sizeof(*devq)); - if (camq_init(&devq->alloc_queue, devices) != 0) { + if (camq_init(&devq->send_queue, devices) != 0) return (1); - } - if (camq_init(&devq->send_queue, devices) != 0) { - camq_fini(&devq->alloc_queue); - return (1); - } - devq->alloc_openings = openings; - devq->alloc_active = 0; devq->send_openings = openings; devq->send_active = 0; return (0); @@ -247,7 +240,6 @@ cam_devq_init(struct cam_devq *devq, int devices, int openings) void cam_devq_free(struct cam_devq *devq) { - camq_fini(&devq->alloc_queue); camq_fini(&devq->send_queue); free(devq, M_CAMDEVQ); } @@ -257,11 +249,7 @@ cam_devq_resize(struct cam_devq *camq, int devices) { u_int32_t retval; - retval = camq_resize(&camq->alloc_queue, devices); - - if (retval == CAM_REQ_CMP) - retval = camq_resize(&camq->send_queue, devices); - + retval = camq_resize(&camq->send_queue, devices); return (retval); } @@ -328,11 +316,10 @@ int cam_ccbq_init(struct cam_ccbq *ccbq, int openings) { bzero(ccbq, sizeof(*ccbq)); - if (camq_init(&ccbq->queue, openings + (CAM_RL_VALUES - 1)) != 0) { + if (camq_init(&ccbq->queue, openings + (CAM_RL_VALUES - 1)) != 0) return (1); - } ccbq->devq_openings = openings; - ccbq->dev_openings = openings; + ccbq->dev_openings = openings; return (0); } |