]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
sif: eq: increase cq_eq_max to 46
authorHakon Bugge <Haakon.Bugge@oracle.com>
Fri, 8 Jul 2016 10:39:19 +0000 (12:39 +0200)
committerSantosh Shilimkar <santosh.shilimkar@oracle.com>
Wed, 27 Jul 2016 17:24:21 +0000 (10:24 -0700)
PSIF supports 48 msi-x interrupts. We associate one msi-x per event
queue (EQ). Further, PSIF need one eq for epsc and one for async
events from the hardware. That leaves 46 for completion notification
events or completion vectors.

This commit also reduces the number of completion notification event
queues to the lesser of the number of cpus present and the default.

Note, this requires fw 1.0.0.1 or newer...

Orabug: 23705843

Change-Id: Iea9101bf09203dff86403453a7e0690cb31b3756
Signed-off-by: Hakon Bugge <Haakon.Bugge@oracle.com>
Reviewed-by: Knut Omang <knut.omang@oracle.com>
drivers/infiniband/hw/sif/sif_epsc.c
drivers/infiniband/hw/sif/sif_main.c

index 95a213dbd71126922b4367ddfd77af7eca374236..beefefb6fe5e0aa189810840000ab9b10fb2feba 100644 (file)
@@ -641,6 +641,7 @@ int sif_eps_init(struct sif_dev *sdev, enum sif_tab_type type)
        size_t bsz;
        size_t config_cycle_count = sizeof(struct psif_epsc_csr_config)/sizeof(u32);
        bool restarted_reset = false;
+       ulong cpu_eqs;
 
        /* Max mailbox exchange protocol version supported by this driver */
        u16 mailbox_seq_version_to_use = 2;
@@ -935,8 +936,11 @@ proto_probing_done:
        if (sif_cq_eq_max < 1)
                sif_cq_eq_max = 1; /* Adjust - need at least 1 completion event queue */
 
-       /* We only allocate resources for these */
-       es->eqs.cnt = min_t(ulong, es->eqs.max_cnt, sif_cq_eq_max + 2);
+       /* Limit the number of eqs we allocate resources for to the
+        * cq_eq_max module parameter setting and the number of CPUs in the system:
+        */
+       cpu_eqs = min_t(ulong, sif_cq_eq_max, num_present_cpus());
+       es->eqs.cnt = min_t(ulong, es->eqs.max_cnt, cpu_eqs + 2);
 
        ret = sif_eps_api_version_ok(sdev, eps_num);
        if (ret)
index f3acefa04a8ca53e971a43d00a45e7678a35fc52..3bcd05c278b4a7812e4aaf0fdfa604a997eea873 100644 (file)
@@ -100,7 +100,7 @@ module_param_named(ki_spqp_size, sif_ki_spqp_size, uint, S_IRUGO);
 MODULE_PARM_DESC(ki_spqp_size, "Number of privileged QPs for key invalidate stencils to set up");
 
 /* pqp_size ==  cq_eq_max */
-uint sif_cq_eq_max = 12;
+uint sif_cq_eq_max = 46;
 module_param_named(cq_eq_max, sif_cq_eq_max, uint, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(cq_eq_max, "Upper limit on no. of EQs to distribute completion events among");