From: Hakon Bugge Date: Fri, 8 Jul 2016 10:39:19 +0000 (+0200) Subject: sif: eq: increase cq_eq_max to 46 X-Git-Tag: v4.1.12-92~96^2~12 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=1ef1959d58ed54e2e72556c6e07a5e8d49aa8d99;p=users%2Fjedix%2Flinux-maple.git sif: eq: increase cq_eq_max to 46 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 Reviewed-by: Knut Omang --- diff --git a/drivers/infiniband/hw/sif/sif_epsc.c b/drivers/infiniband/hw/sif/sif_epsc.c index 95a213dbd711..beefefb6fe5e 100644 --- a/drivers/infiniband/hw/sif/sif_epsc.c +++ b/drivers/infiniband/hw/sif/sif_epsc.c @@ -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) diff --git a/drivers/infiniband/hw/sif/sif_main.c b/drivers/infiniband/hw/sif/sif_main.c index f3acefa04a8c..3bcd05c278b4 100644 --- a/drivers/infiniband/hw/sif/sif_main.c +++ b/drivers/infiniband/hw/sif/sif_main.c @@ -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");