diff options
author | Kashyap, Desai <kashyap.desai@lsi.com> | 2009-09-14 01:32:48 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2009-10-02 10:48:26 -0400 |
commit | 595bb0bd62edb28a965993d90e0fa1285560ce53 (patch) | |
tree | 0447a980d9c99e21ab1c9bac0b7f893da75d18e3 /drivers/scsi/mpt2sas/mpt2sas_base.h | |
parent | 19d3ebe3d5c4d56c8309a64561d99e7920a35fbb (diff) |
[SCSI] mpt2sas: Added SCSIIO, Internal and high priority memory pools to support multiple TM
1) create a pool of high priority message frames in the region of memory
between message frames and chains. The modifications are in
_base_allocate_memory_pools. Also create a seperate pool of memory for
internal commands located near the same region of memory. The pool of high
priority message frames is restriced by the facts->HighPriorityCredit.
2) Create additional API for accessing request message frames. New function
mpt2sas_base_get_smid_hpr is for highpriority request. New function
mpt2sas_base_get_smid_scsiio for SCSI_IO, passing in the scsi command
pointer. The mpt2sas_base_get_smid function is for requesting internal
commands.
3) Added new function _base_get_cb_idx to obtain the callback
index from one of the three pools of request message frames.
4) Removed wrapper functions _scsih_scsi_lookup_set and
_scsih_scsi_lookup_getclear. These were removed because this handling was
moved into mpt2sas_base_get_smid_scsiio and mpt2sas_base_free_smid.
5) The function mpt2sas_base_free_smid is modified so the request message
frames are put back on one of the three pools of request message frames.
Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/mpt2sas/mpt2sas_base.h')
-rw-r--r-- | drivers/scsi/mpt2sas/mpt2sas_base.h | 49 |
1 files changed, 45 insertions, 4 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.h b/drivers/scsi/mpt2sas/mpt2sas_base.h index 3de37b702468..91132626f4c5 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_base.h +++ b/drivers/scsi/mpt2sas/mpt2sas_base.h | |||
@@ -264,6 +264,13 @@ struct _internal_cmd { | |||
264 | * SAS Topology Structures | 264 | * SAS Topology Structures |
265 | */ | 265 | */ |
266 | 266 | ||
267 | #define MPTSAS_STATE_TR_SEND 0x0001 | ||
268 | #define MPTSAS_STATE_TR_COMPLETE 0x0002 | ||
269 | #define MPTSAS_STATE_CNTRL_SEND 0x0004 | ||
270 | #define MPTSAS_STATE_CNTRL_COMPLETE 0x0008 | ||
271 | |||
272 | #define MPT2SAS_REQ_SAS_CNTRL 0x0010 | ||
273 | |||
267 | /** | 274 | /** |
268 | * struct _sas_device - attached device information | 275 | * struct _sas_device - attached device information |
269 | * @list: sas device list | 276 | * @list: sas device list |
@@ -510,8 +517,9 @@ typedef void (*MPT_ADD_SGE)(void *paddr, u32 flags_length, dma_addr_t dma_addr); | |||
510 | * @config_page_sz: config page size | 517 | * @config_page_sz: config page size |
511 | * @config_page: reserve memory for config page payload | 518 | * @config_page: reserve memory for config page payload |
512 | * @config_page_dma: | 519 | * @config_page_dma: |
520 | * @hba_queue_depth: hba request queue depth | ||
513 | * @sge_size: sg element size for either 32/64 bit | 521 | * @sge_size: sg element size for either 32/64 bit |
514 | * @request_depth: hba request queue depth | 522 | * @scsiio_depth: SCSI_IO queue depth |
515 | * @request_sz: per request frame size | 523 | * @request_sz: per request frame size |
516 | * @request: pool of request frames | 524 | * @request: pool of request frames |
517 | * @request_dma: | 525 | * @request_dma: |
@@ -528,6 +536,18 @@ typedef void (*MPT_ADD_SGE)(void *paddr, u32 flags_length, dma_addr_t dma_addr); | |||
528 | * @chains_needed_per_io: max chains per io | 536 | * @chains_needed_per_io: max chains per io |
529 | * @chain_offset_value_for_main_message: location 1st sg in main | 537 | * @chain_offset_value_for_main_message: location 1st sg in main |
530 | * @chain_depth: total chains allocated | 538 | * @chain_depth: total chains allocated |
539 | * @hi_priority_smid: | ||
540 | * @hi_priority: | ||
541 | * @hi_priority_dma: | ||
542 | * @hi_priority_depth: | ||
543 | * @hpr_lookup: | ||
544 | * @hpr_free_list: | ||
545 | * @internal_smid: | ||
546 | * @internal: | ||
547 | * @internal_dma: | ||
548 | * @internal_depth: | ||
549 | * @internal_lookup: | ||
550 | * @internal_free_list: | ||
531 | * @sense: pool of sense | 551 | * @sense: pool of sense |
532 | * @sense_dma: | 552 | * @sense_dma: |
533 | * @sense_dma_pool: | 553 | * @sense_dma_pool: |
@@ -643,9 +663,10 @@ struct MPT2SAS_ADAPTER { | |||
643 | void *config_page; | 663 | void *config_page; |
644 | dma_addr_t config_page_dma; | 664 | dma_addr_t config_page_dma; |
645 | 665 | ||
646 | /* request */ | 666 | /* scsiio request */ |
667 | u16 hba_queue_depth; | ||
647 | u16 sge_size; | 668 | u16 sge_size; |
648 | u16 request_depth; | 669 | u16 scsiio_depth; |
649 | u16 request_sz; | 670 | u16 request_sz; |
650 | u8 *request; | 671 | u8 *request; |
651 | dma_addr_t request_dma; | 672 | dma_addr_t request_dma; |
@@ -665,6 +686,22 @@ struct MPT2SAS_ADAPTER { | |||
665 | u16 chain_offset_value_for_main_message; | 686 | u16 chain_offset_value_for_main_message; |
666 | u16 chain_depth; | 687 | u16 chain_depth; |
667 | 688 | ||
689 | /* hi-priority queue */ | ||
690 | u16 hi_priority_smid; | ||
691 | u8 *hi_priority; | ||
692 | dma_addr_t hi_priority_dma; | ||
693 | u16 hi_priority_depth; | ||
694 | struct request_tracker *hpr_lookup; | ||
695 | struct list_head hpr_free_list; | ||
696 | |||
697 | /* internal queue */ | ||
698 | u16 internal_smid; | ||
699 | u8 *internal; | ||
700 | dma_addr_t internal_dma; | ||
701 | u16 internal_depth; | ||
702 | struct request_tracker *internal_lookup; | ||
703 | struct list_head internal_free_list; | ||
704 | |||
668 | /* sense */ | 705 | /* sense */ |
669 | u8 *sense; | 706 | u8 *sense; |
670 | dma_addr_t sense_dma; | 707 | dma_addr_t sense_dma; |
@@ -720,9 +757,13 @@ int mpt2sas_base_hard_reset_handler(struct MPT2SAS_ADAPTER *ioc, int sleep_flag, | |||
720 | void *mpt2sas_base_get_msg_frame(struct MPT2SAS_ADAPTER *ioc, u16 smid); | 757 | void *mpt2sas_base_get_msg_frame(struct MPT2SAS_ADAPTER *ioc, u16 smid); |
721 | void *mpt2sas_base_get_sense_buffer(struct MPT2SAS_ADAPTER *ioc, u16 smid); | 758 | void *mpt2sas_base_get_sense_buffer(struct MPT2SAS_ADAPTER *ioc, u16 smid); |
722 | void mpt2sas_base_build_zero_len_sge(struct MPT2SAS_ADAPTER *ioc, void *paddr); | 759 | void mpt2sas_base_build_zero_len_sge(struct MPT2SAS_ADAPTER *ioc, void *paddr); |
723 | dma_addr_t mpt2sas_base_get_msg_frame_dma(struct MPT2SAS_ADAPTER *ioc, u16 smid); | ||
724 | dma_addr_t mpt2sas_base_get_sense_buffer_dma(struct MPT2SAS_ADAPTER *ioc, u16 smid); | 760 | dma_addr_t mpt2sas_base_get_sense_buffer_dma(struct MPT2SAS_ADAPTER *ioc, u16 smid); |
725 | 761 | ||
762 | /* hi-priority queue */ | ||
763 | u16 mpt2sas_base_get_smid_hpr(struct MPT2SAS_ADAPTER *ioc, u8 cb_idx); | ||
764 | u16 mpt2sas_base_get_smid_scsiio(struct MPT2SAS_ADAPTER *ioc, u8 cb_idx, | ||
765 | struct scsi_cmnd *scmd); | ||
766 | |||
726 | u16 mpt2sas_base_get_smid(struct MPT2SAS_ADAPTER *ioc, u8 cb_idx); | 767 | u16 mpt2sas_base_get_smid(struct MPT2SAS_ADAPTER *ioc, u8 cb_idx); |
727 | void mpt2sas_base_free_smid(struct MPT2SAS_ADAPTER *ioc, u16 smid); | 768 | void mpt2sas_base_free_smid(struct MPT2SAS_ADAPTER *ioc, u16 smid); |
728 | void mpt2sas_base_put_smid_scsi_io(struct MPT2SAS_ADAPTER *ioc, u16 smid, | 769 | void mpt2sas_base_put_smid_scsi_io(struct MPT2SAS_ADAPTER *ioc, u16 smid, |