aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/isci/request.h
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2011-06-17 17:18:39 -0400
committerDan Williams <dan.j.williams@intel.com>2011-07-03 07:04:51 -0400
commitdb0562509800a2d4cb5cb14a66413c30484f165c (patch)
treed05cc34b78a8f2a6b9024b8d45e5e8e50786ee64 /drivers/scsi/isci/request.h
parent38d8879baeb61b6946052739e7c03fa79b3a57f0 (diff)
isci: preallocate requests
the dma_pool interface is optimized for object_size << page_size which is not the case with isci_request objects and the dma_pool routines show up in the top of the profile. The old io_request_table which tracked whether tci slots were in-flight or not is replaced with an IREQ_ACTIVE flag per request. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/scsi/isci/request.h')
-rw-r--r--drivers/scsi/isci/request.h26
1 files changed, 5 insertions, 21 deletions
diff --git a/drivers/scsi/isci/request.h b/drivers/scsi/isci/request.h
index f440e421ea0e..7628decbd535 100644
--- a/drivers/scsi/isci/request.h
+++ b/drivers/scsi/isci/request.h
@@ -257,6 +257,7 @@ struct isci_request {
257 #define IREQ_COMPLETE_IN_TARGET 0 257 #define IREQ_COMPLETE_IN_TARGET 0
258 #define IREQ_TERMINATED 1 258 #define IREQ_TERMINATED 1
259 #define IREQ_TMF 2 259 #define IREQ_TMF 2
260 #define IREQ_ACTIVE 3
260 unsigned long flags; 261 unsigned long flags;
261 262
262 union ttype_ptr_union { 263 union ttype_ptr_union {
@@ -590,33 +591,16 @@ isci_request_change_started_to_aborted(struct isci_request *isci_request,
590 completion_ptr, 591 completion_ptr,
591 aborted); 592 aborted);
592} 593}
593/**
594 * isci_request_free() - This function frees the request object.
595 * @isci_host: This parameter specifies the ISCI host object
596 * @isci_request: This parameter points to the isci_request object
597 *
598 */
599static inline void isci_request_free(struct isci_host *isci_host,
600 struct isci_request *isci_request)
601{
602 if (!isci_request)
603 return;
604
605 /* release the dma memory if we fail. */
606 dma_pool_free(isci_host->dma_pool,
607 isci_request,
608 isci_request->request_daddr);
609}
610 594
611#define isci_request_access_task(req) ((req)->ttype_ptr.io_task_ptr) 595#define isci_request_access_task(req) ((req)->ttype_ptr.io_task_ptr)
612 596
613#define isci_request_access_tmf(req) ((req)->ttype_ptr.tmf_task_ptr) 597#define isci_request_access_tmf(req) ((req)->ttype_ptr.tmf_task_ptr)
614 598
615struct isci_request *isci_request_alloc_tmf(struct isci_host *ihost, 599struct isci_request *isci_tmf_request_from_tag(struct isci_host *ihost,
616 struct isci_tmf *isci_tmf, 600 struct isci_tmf *isci_tmf,
617 gfp_t gfp_flags); 601 u16 tag);
618int isci_request_execute(struct isci_host *ihost, struct isci_remote_device *idev, 602int isci_request_execute(struct isci_host *ihost, struct isci_remote_device *idev,
619 struct sas_task *task, u16 tag, gfp_t gfp_flags); 603 struct sas_task *task, u16 tag);
620void isci_terminate_pending_requests(struct isci_host *ihost, 604void isci_terminate_pending_requests(struct isci_host *ihost,
621 struct isci_remote_device *idev); 605 struct isci_remote_device *idev);
622enum sci_status 606enum sci_status