summaryrefslogtreecommitdiff
path: root/drivers/crypto/cavium/nitrox/nitrox_dev.h
diff options
context:
space:
mode:
authorSrikanth Jampala <Jampala.Srikanth@cavium.com>2018-09-29 13:49:10 +0530
committerHerbert Xu <herbert@gondor.apana.org.au>2018-10-05 10:22:48 +0800
commit5155e118dda982342c2d21ecb292c8cc8b566e8d (patch)
tree33d35fdbb3afbf4b2d0ff767e86fad8499fbcfc1 /drivers/crypto/cavium/nitrox/nitrox_dev.h
parente7892dd6d8b0c9149ac2393b27f8913fa09227b5 (diff)
crypto: cavium/nitrox - use pci_alloc_irq_vectors() while enabling MSI-X.
replace pci_enable_msix_exact() with pci_alloc_irq_vectors(). get the required vector count from pci_msix_vec_count(). use struct nitrox_q_vector as the argument to tasklets. Signed-off-by: Srikanth Jampala <Jampala.Srikanth@cavium.com> Reviewed-by: Gadam Sreerama <sgadam@cavium.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/cavium/nitrox/nitrox_dev.h')
-rw-r--r--drivers/crypto/cavium/nitrox/nitrox_dev.h44
1 files changed, 16 insertions, 28 deletions
diff --git a/drivers/crypto/cavium/nitrox/nitrox_dev.h b/drivers/crypto/cavium/nitrox/nitrox_dev.h
index 62fb75923bfe..283e252385fb 100644
--- a/drivers/crypto/cavium/nitrox/nitrox_dev.h
+++ b/drivers/crypto/cavium/nitrox/nitrox_dev.h
@@ -18,6 +18,7 @@
* @response_head: submitted request list
* @backlog_head: backlog queue
* @dbell_csr_addr: doorbell register address for this queue
+ * @compl_cnt_csr_addr: completion count register address of the slc port
* @base: command queue base address
* @dma: dma address of the base
* @pending_count: request pending at device
@@ -39,6 +40,7 @@ struct nitrox_cmdq {
struct list_head backlog_head;
u8 __iomem *dbell_csr_addr;
+ u8 __iomem *compl_cnt_csr_addr;
u8 *base;
dma_addr_t dma;
@@ -88,30 +90,17 @@ struct nitrox_stats {
atomic64_t dropped;
};
-#define MAX_MSIX_VECTOR_NAME 20
-/**
- * vectors for queues (64 AE, 64 SE and 64 ZIP) and
- * error condition/mailbox.
- */
-#define MAX_MSIX_VECTORS 192
-
-struct nitrox_msix {
- struct msix_entry *entries;
- char **names;
- DECLARE_BITMAP(irqs, MAX_MSIX_VECTORS);
- u32 nr_entries;
-};
-
-struct bh_data {
- /* slc port completion count address */
- u8 __iomem *completion_cnt_csr_addr;
-
- struct nitrox_cmdq *cmdq;
- struct tasklet_struct resp_handler;
-};
-
-struct nitrox_bh {
- struct bh_data *slc;
+#define IRQ_NAMESZ 32
+
+struct nitrox_q_vector {
+ char name[IRQ_NAMESZ];
+ bool valid;
+ int ring;
+ struct tasklet_struct resp_tasklet;
+ union {
+ struct nitrox_cmdq *cmdq;
+ struct nitrox_device *ndev;
+ };
};
/*
@@ -160,8 +149,7 @@ enum vf_mode {
* @mode: Device mode PF/VF
* @ctx_pool: DMA pool for crypto context
* @pkt_inq: Packet input rings
- * @msix: MSI-X information
- * @bh: post processing work
+ * @qvec: MSI-X queue vectors information
* @hw: hardware information
* @debugfs_dir: debugfs directory
*/
@@ -186,8 +174,8 @@ struct nitrox_device {
struct dma_pool *ctx_pool;
struct nitrox_cmdq *pkt_inq;
- struct nitrox_msix msix;
- struct nitrox_bh bh;
+ struct nitrox_q_vector *qvec;
+ int num_vecs;
struct nitrox_stats stats;
struct nitrox_hw hw;