IB/ehca: Fix reported max number of QPs and CQs in systems with >1 adapter
Because ehca adapters can differ in the maximum number of QPs and CQs we have to save the maximum number of these ressources per adapter and not globally per ehca driver. This fix introduces 2 new members to the shca structure to store the maximum value for QPs and CQs per adapter. The module parameters are now used as initial values for those variables. If a user selects an invalid number of CQs or QPs we don't print an error any longer, instead we will inform the user with a warning and set the values to the respective maximum supported by the HW. Signed-off-by: Stefan Roscher <stefan.roscher@de.ibm.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
This commit is contained in:

committed by
Roland Dreier

parent
0540bbbe45
commit
19f4282149
@@ -465,9 +465,9 @@ static struct ehca_qp *internal_create_qp(
|
||||
u32 swqe_size = 0, rwqe_size = 0, ib_qp_num;
|
||||
unsigned long flags;
|
||||
|
||||
if (!atomic_add_unless(&shca->num_qps, 1, ehca_max_qp)) {
|
||||
if (!atomic_add_unless(&shca->num_qps, 1, shca->max_num_qps)) {
|
||||
ehca_err(pd->device, "Unable to create QP, max number of %i "
|
||||
"QPs reached.", ehca_max_qp);
|
||||
"QPs reached.", shca->max_num_qps);
|
||||
ehca_err(pd->device, "To increase the maximum number of QPs "
|
||||
"use the number_of_qps module parameter.\n");
|
||||
return ERR_PTR(-ENOSPC);
|
||||
|
Reference in New Issue
Block a user