Commit 9b05c91a authored by Sreekanth Reddy's avatar Sreekanth Reddy Committed by Christoph Hellwig

mpt3sas: Added Reply Descriptor Post Queue (RDPQ) Array support

Up to now, Driver allocates a single contiguous block of memory
pool for all reply queues and passes down a single address in the
ReplyDescriptorPostQueueAddress field of the IOC Init Request
Message to the firmware.

When firmware receives this address, it will program each of the
Reply Descriptor Post Queue registers, as each reply queue has its
own register. Thus the firmware, starting from a base address it
determines the starting address of the subsequent reply queues
through some simple arithmetic calculations.

The size of this contiguous block of memory pool is directly proportional
to number of MSI-X vectors and the HBA queue depth. For example higher
MSIX vectors requires larger contiguous block of memory pool.

But some of the OS kernels are unable to allocate this larger
contiguous block of memory pool.

So, the proposal is to allocate memory independently for each
Reply Queue and pass down all of the addresses to the firmware.
Then the firmware will just take each address and program the value
into the correct register.

When HBAs with older firmware(i.e. without RDPQ capability) is used
with this new driver then the max_msix_vectors value would be set
to 8 by default.

Change set in v1:

1. Declared the _base_get_ioc_facts() functions at the beginning of the mpt3sas_base.c file
instead of moving all these functions before mpt3sas_base_map_resources() function
        a. _base_wait_for_doorbell_int()
        b. _base_wait_for_doorbell_ack()
        c. _base_wait_for_doorbell_not_used()
        d. _base_handshake_req_reply_wait()
        e. _base_get_ioc_facts()

2. Initially set the consistent DMA mask to 32 bit and then change it to 64 bit mask
after allocating RDPQ pools by calling the function _base_change_consistent_dma_mask.
This is to ensure that all the upper 32 bits of RDPQ entries's base address to be same.

3. Reduced the redundancy between the RDPQ and non-RDPQ support in these following functions
        a. _base_release_memory_pools()
        b. _base_allocate_memory_pools()
        c. _base_send_ioc_init()
        d. _base_make_ioc_operational()
Signed-off-by: default avatarSreekanth Reddy <Sreekanth.Reddy@avagotech.com>
Reviewed-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent 1117b31a
This diff is collapsed.
...@@ -569,6 +569,11 @@ struct mpt3sas_port_facts { ...@@ -569,6 +569,11 @@ struct mpt3sas_port_facts {
u16 MaxPostedCmdBuffers; u16 MaxPostedCmdBuffers;
}; };
struct reply_post_struct {
Mpi2ReplyDescriptorsUnion_t *reply_post_free;
dma_addr_t reply_post_free_dma;
};
/** /**
* enum mutex_type - task management mutex type * enum mutex_type - task management mutex type
* @TM_MUTEX_OFF: mutex is not required becuase calling function is acquiring it * @TM_MUTEX_OFF: mutex is not required becuase calling function is acquiring it
...@@ -597,6 +602,7 @@ typedef void (*MPT3SAS_FLUSH_RUNNING_CMDS)(struct MPT3SAS_ADAPTER *ioc); ...@@ -597,6 +602,7 @@ typedef void (*MPT3SAS_FLUSH_RUNNING_CMDS)(struct MPT3SAS_ADAPTER *ioc);
* @ir_firmware: IR firmware present * @ir_firmware: IR firmware present
* @bars: bitmask of BAR's that must be configured * @bars: bitmask of BAR's that must be configured
* @mask_interrupts: ignore interrupt * @mask_interrupts: ignore interrupt
* @dma_mask: used to set the consistent dma mask
* @fault_reset_work_q_name: fw fault work queue * @fault_reset_work_q_name: fw fault work queue
* @fault_reset_work_q: "" * @fault_reset_work_q: ""
* @fault_reset_work: "" * @fault_reset_work: ""
...@@ -712,8 +718,11 @@ typedef void (*MPT3SAS_FLUSH_RUNNING_CMDS)(struct MPT3SAS_ADAPTER *ioc); ...@@ -712,8 +718,11 @@ typedef void (*MPT3SAS_FLUSH_RUNNING_CMDS)(struct MPT3SAS_ADAPTER *ioc);
* @reply_free_dma_pool: * @reply_free_dma_pool:
* @reply_free_host_index: tail index in pool to insert free replys * @reply_free_host_index: tail index in pool to insert free replys
* @reply_post_queue_depth: reply post queue depth * @reply_post_queue_depth: reply post queue depth
* @reply_post_free: pool for reply post (64bit descriptor) * @reply_post_struct: struct for reply_post_free physical & virt address
* @reply_post_free_dma: * @rdpq_array_capable: FW supports multiple reply queue addresses in ioc_init
* @rdpq_array_enable: rdpq_array support is enabled in the driver
* @rdpq_array_enable_assigned: this ensures that rdpq_array_enable flag
* is assigned only ones
* @reply_queue_count: number of reply queue's * @reply_queue_count: number of reply queue's
* @reply_queue_list: link list contaning the reply queue info * @reply_queue_list: link list contaning the reply queue info
* @reply_post_host_index: head index in the pool where FW completes IO * @reply_post_host_index: head index in the pool where FW completes IO
...@@ -735,6 +744,7 @@ struct MPT3SAS_ADAPTER { ...@@ -735,6 +744,7 @@ struct MPT3SAS_ADAPTER {
u8 ir_firmware; u8 ir_firmware;
int bars; int bars;
u8 mask_interrupts; u8 mask_interrupts;
int dma_mask;
/* fw fault handler */ /* fw fault handler */
char fault_reset_work_q_name[20]; char fault_reset_work_q_name[20];
...@@ -914,8 +924,10 @@ struct MPT3SAS_ADAPTER { ...@@ -914,8 +924,10 @@ struct MPT3SAS_ADAPTER {
/* reply post queue */ /* reply post queue */
u16 reply_post_queue_depth; u16 reply_post_queue_depth;
Mpi2ReplyDescriptorsUnion_t *reply_post_free; struct reply_post_struct *reply_post;
dma_addr_t reply_post_free_dma; u8 rdpq_array_capable;
u8 rdpq_array_enable;
u8 rdpq_array_enable_assigned;
struct dma_pool *reply_post_free_dma_pool; struct dma_pool *reply_post_free_dma_pool;
u8 reply_queue_count; u8 reply_queue_count;
struct list_head reply_queue_list; struct list_head reply_queue_list;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment