summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/aacraid/aacraid.h
diff options
context:
space:
mode:
authorRaghava Aditya Renukunta2016-02-04 00:06:00 +0100
committerMartin K. Petersen2016-02-24 03:27:02 +0100
commit3f4ce057d51a9c0ed9b01ba693df685d230ffcae (patch)
treee4e80fb4a6929c94e99b47f2a2539b770b5dd8ce /drivers/scsi/aacraid/aacraid.h
parentaacraid: SCSI blk tag support (diff)
downloadkernel-qcow2-linux-3f4ce057d51a9c0ed9b01ba693df685d230ffcae.tar.gz
kernel-qcow2-linux-3f4ce057d51a9c0ed9b01ba693df685d230ffcae.tar.xz
kernel-qcow2-linux-3f4ce057d51a9c0ed9b01ba693df685d230ffcae.zip
aacraid: Fix RRQ overload
The driver utilizes an array of atomic variables to keep track of IO submissions to each vector. To submit an IO multiple threads iterate through the array to find a vector which has empty slots to send an IO. The reading and updating of the variable is not atomic, causing race conditions when a thread uses a full vector to submit an IO. Fixed by mapping each FIB to a vector, the submission path then uses said vector to submit IO thereby removing the possibly of a race condition.The vector assignment is started from 1 since vector 0 is reserved for the use of AIF management FIBS.If the number of MSIx vectors is 1 (MSI or INTx mode) then all the fibs are allocated to vector 0. Fixes: 495c0217 "aacraid: MSI-x support" Cc: stable@vger.kernel.org # v4.1 Signed-off-by: Raghava Aditya Renukunta <raghavaaditya.renukunta@pmcs.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/aacraid/aacraid.h')
-rw-r--r--drivers/scsi/aacraid/aacraid.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h
index f51f0a009574..fff13063cf71 100644
--- a/drivers/scsi/aacraid/aacraid.h
+++ b/drivers/scsi/aacraid/aacraid.h
@@ -944,6 +944,7 @@ struct fib {
*/
struct list_head fiblink;
void *data;
+ u32 vector_no;
struct hw_fib *hw_fib_va; /* Actual shared object */
dma_addr_t hw_fib_pa; /* physical address of hw_fib*/
};
@@ -2113,6 +2114,7 @@ static inline unsigned int cap_to_cyls(sector_t capacity, unsigned divisor)
int aac_acquire_irq(struct aac_dev *dev);
void aac_free_irq(struct aac_dev *dev);
const char *aac_driverinfo(struct Scsi_Host *);
+void aac_fib_vector_assign(struct aac_dev *dev);
struct fib *aac_fib_alloc(struct aac_dev *dev);
struct fib *aac_fib_alloc_tag(struct aac_dev *dev, struct scsi_cmnd *scmd);
int aac_fib_setup(struct aac_dev *dev);