aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/bnxt_re/qplib_sp.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/hw/bnxt_re/qplib_sp.c')
-rw-r--r--drivers/infiniband/hw/bnxt_re/qplib_sp.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/bnxt_re/qplib_sp.c b/drivers/infiniband/hw/bnxt_re/qplib_sp.c
index fde18cf0e406..ef91ab786dd4 100644
--- a/drivers/infiniband/hw/bnxt_re/qplib_sp.c
+++ b/drivers/infiniband/hw/bnxt_re/qplib_sp.c
@@ -51,6 +51,19 @@ const struct bnxt_qplib_gid bnxt_qplib_gid_zero = {{ 0, 0, 0, 0, 0, 0, 0, 0,
51 0, 0, 0, 0, 0, 0, 0, 0 } }; 51 0, 0, 0, 0, 0, 0, 0, 0 } };
52 52
53/* Device */ 53/* Device */
54
55static bool bnxt_qplib_is_atomic_cap(struct bnxt_qplib_rcfw *rcfw)
56{
57 int rc;
58 u16 pcie_ctl2;
59
60 rc = pcie_capability_read_word(rcfw->pdev, PCI_EXP_DEVCTL2,
61 &pcie_ctl2);
62 if (rc)
63 return false;
64 return !!(pcie_ctl2 & PCI_EXP_DEVCTL2_ATOMIC_REQ);
65}
66
54int bnxt_qplib_get_dev_attr(struct bnxt_qplib_rcfw *rcfw, 67int bnxt_qplib_get_dev_attr(struct bnxt_qplib_rcfw *rcfw,
55 struct bnxt_qplib_dev_attr *attr) 68 struct bnxt_qplib_dev_attr *attr)
56{ 69{
@@ -81,6 +94,8 @@ int bnxt_qplib_get_dev_attr(struct bnxt_qplib_rcfw *rcfw,
81 94
82 /* Extract the context from the side buffer */ 95 /* Extract the context from the side buffer */
83 attr->max_qp = le32_to_cpu(sb->max_qp); 96 attr->max_qp = le32_to_cpu(sb->max_qp);
97 /* max_qp value reported by FW for PF doesn't include the QP1 for PF */
98 attr->max_qp += 1;
84 attr->max_qp_rd_atom = 99 attr->max_qp_rd_atom =
85 sb->max_qp_rd_atom > BNXT_QPLIB_MAX_OUT_RD_ATOM ? 100 sb->max_qp_rd_atom > BNXT_QPLIB_MAX_OUT_RD_ATOM ?
86 BNXT_QPLIB_MAX_OUT_RD_ATOM : sb->max_qp_rd_atom; 101 BNXT_QPLIB_MAX_OUT_RD_ATOM : sb->max_qp_rd_atom;
@@ -129,6 +144,7 @@ int bnxt_qplib_get_dev_attr(struct bnxt_qplib_rcfw *rcfw,
129 attr->tqm_alloc_reqs[i * 4 + 3] = *(++tqm_alloc); 144 attr->tqm_alloc_reqs[i * 4 + 3] = *(++tqm_alloc);
130 } 145 }
131 146
147 attr->is_atomic = bnxt_qplib_is_atomic_cap(rcfw);
132bail: 148bail:
133 bnxt_qplib_rcfw_free_sbuf(rcfw, sbuf); 149 bnxt_qplib_rcfw_free_sbuf(rcfw, sbuf);
134 return rc; 150 return rc;