forked from Minki/linux
IB/mthca: Don't print debugging info until we have all values
When debugging is enabled, the mthca_QUERY_DEV_LIM() firmware command function prints out some of the device limits that it queries. However the debugging prints happen before all of the fields are extracted from the firmware response, so some of the values that get printed are uninitialized junk. Move the prints to the end of the function to fix this. Signed-off-by: Roland Dreier <rolandd@cisco.com>
This commit is contained in:
parent
7bcb974ef6
commit
f295c79b67
@ -1029,25 +1029,6 @@ int mthca_QUERY_DEV_LIM(struct mthca_dev *dev,
|
||||
MTHCA_GET(size, outbox, QUERY_DEV_LIM_UAR_ENTRY_SZ_OFFSET);
|
||||
dev_lim->uar_scratch_entry_sz = size;
|
||||
|
||||
mthca_dbg(dev, "Max QPs: %d, reserved QPs: %d, entry size: %d\n",
|
||||
dev_lim->max_qps, dev_lim->reserved_qps, dev_lim->qpc_entry_sz);
|
||||
mthca_dbg(dev, "Max SRQs: %d, reserved SRQs: %d, entry size: %d\n",
|
||||
dev_lim->max_srqs, dev_lim->reserved_srqs, dev_lim->srq_entry_sz);
|
||||
mthca_dbg(dev, "Max CQs: %d, reserved CQs: %d, entry size: %d\n",
|
||||
dev_lim->max_cqs, dev_lim->reserved_cqs, dev_lim->cqc_entry_sz);
|
||||
mthca_dbg(dev, "Max EQs: %d, reserved EQs: %d, entry size: %d\n",
|
||||
dev_lim->max_eqs, dev_lim->reserved_eqs, dev_lim->eqc_entry_sz);
|
||||
mthca_dbg(dev, "reserved MPTs: %d, reserved MTTs: %d\n",
|
||||
dev_lim->reserved_mrws, dev_lim->reserved_mtts);
|
||||
mthca_dbg(dev, "Max PDs: %d, reserved PDs: %d, reserved UARs: %d\n",
|
||||
dev_lim->max_pds, dev_lim->reserved_pds, dev_lim->reserved_uars);
|
||||
mthca_dbg(dev, "Max QP/MCG: %d, reserved MGMs: %d\n",
|
||||
dev_lim->max_pds, dev_lim->reserved_mgms);
|
||||
mthca_dbg(dev, "Max CQEs: %d, max WQEs: %d, max SRQ WQEs: %d\n",
|
||||
dev_lim->max_cq_sz, dev_lim->max_qp_sz, dev_lim->max_srq_sz);
|
||||
|
||||
mthca_dbg(dev, "Flags: %08x\n", dev_lim->flags);
|
||||
|
||||
if (mthca_is_memfree(dev)) {
|
||||
MTHCA_GET(field, outbox, QUERY_DEV_LIM_MAX_SRQ_SZ_OFFSET);
|
||||
dev_lim->max_srq_sz = 1 << field;
|
||||
@ -1093,6 +1074,25 @@ int mthca_QUERY_DEV_LIM(struct mthca_dev *dev,
|
||||
dev_lim->mpt_entry_sz = MTHCA_MPT_ENTRY_SIZE;
|
||||
}
|
||||
|
||||
mthca_dbg(dev, "Max QPs: %d, reserved QPs: %d, entry size: %d\n",
|
||||
dev_lim->max_qps, dev_lim->reserved_qps, dev_lim->qpc_entry_sz);
|
||||
mthca_dbg(dev, "Max SRQs: %d, reserved SRQs: %d, entry size: %d\n",
|
||||
dev_lim->max_srqs, dev_lim->reserved_srqs, dev_lim->srq_entry_sz);
|
||||
mthca_dbg(dev, "Max CQs: %d, reserved CQs: %d, entry size: %d\n",
|
||||
dev_lim->max_cqs, dev_lim->reserved_cqs, dev_lim->cqc_entry_sz);
|
||||
mthca_dbg(dev, "Max EQs: %d, reserved EQs: %d, entry size: %d\n",
|
||||
dev_lim->max_eqs, dev_lim->reserved_eqs, dev_lim->eqc_entry_sz);
|
||||
mthca_dbg(dev, "reserved MPTs: %d, reserved MTTs: %d\n",
|
||||
dev_lim->reserved_mrws, dev_lim->reserved_mtts);
|
||||
mthca_dbg(dev, "Max PDs: %d, reserved PDs: %d, reserved UARs: %d\n",
|
||||
dev_lim->max_pds, dev_lim->reserved_pds, dev_lim->reserved_uars);
|
||||
mthca_dbg(dev, "Max QP/MCG: %d, reserved MGMs: %d\n",
|
||||
dev_lim->max_pds, dev_lim->reserved_mgms);
|
||||
mthca_dbg(dev, "Max CQEs: %d, max WQEs: %d, max SRQ WQEs: %d\n",
|
||||
dev_lim->max_cq_sz, dev_lim->max_qp_sz, dev_lim->max_srq_sz);
|
||||
|
||||
mthca_dbg(dev, "Flags: %08x\n", dev_lim->flags);
|
||||
|
||||
out:
|
||||
mthca_free_mailbox(dev, mailbox);
|
||||
return err;
|
||||
|
Loading…
Reference in New Issue
Block a user