Skip to content

Commit ba75fe7

Browse files
selvintxavierjgunthorpe
authored andcommitted
RDMA/bnxt_re: Query function capabilities from firmware
Query Function capabilities to enable advanced features. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Selvin Xavier <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 7d3115e commit ba75fe7

File tree

1 file changed

+21
-0
lines changed
  • drivers/infiniband/hw/bnxt_re

1 file changed

+21
-0
lines changed

drivers/infiniband/hw/bnxt_re/main.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ static int bnxt_re_netdev_event(struct notifier_block *notifier,
8383
unsigned long event, void *ptr);
8484
static struct bnxt_re_dev *bnxt_re_from_netdev(struct net_device *netdev);
8585
static void bnxt_re_dev_uninit(struct bnxt_re_dev *rdev);
86+
static int bnxt_re_hwrm_qcaps(struct bnxt_re_dev *rdev);
8687

8788
static void bnxt_re_set_drv_mode(struct bnxt_re_dev *rdev, u8 mode)
8889
{
@@ -91,6 +92,9 @@ static void bnxt_re_set_drv_mode(struct bnxt_re_dev *rdev, u8 mode)
9192
cctx = rdev->chip_ctx;
9293
cctx->modes.wqe_mode = bnxt_qplib_is_chip_gen_p5(rdev->chip_ctx) ?
9394
mode : BNXT_QPLIB_WQE_MODE_STATIC;
95+
if (bnxt_re_hwrm_qcaps(rdev))
96+
dev_err(rdev_to_dev(rdev),
97+
"Failed to query hwrm qcaps\n");
9498
}
9599

96100
static void bnxt_re_destroy_chip_ctx(struct bnxt_re_dev *rdev)
@@ -339,6 +343,23 @@ static void bnxt_re_fill_fw_msg(struct bnxt_fw_msg *fw_msg, void *msg,
339343
fw_msg->timeout = timeout;
340344
}
341345

346+
/* Query function capabilities using common hwrm */
347+
int bnxt_re_hwrm_qcaps(struct bnxt_re_dev *rdev)
348+
{
349+
struct bnxt_en_dev *en_dev = rdev->en_dev;
350+
struct hwrm_func_qcaps_output resp = {};
351+
struct hwrm_func_qcaps_input req = {};
352+
struct bnxt_qplib_chip_ctx *cctx;
353+
struct bnxt_fw_msg fw_msg = {};
354+
355+
cctx = rdev->chip_ctx;
356+
bnxt_re_init_hwrm_hdr((void *)&req, HWRM_FUNC_QCAPS);
357+
req.fid = cpu_to_le16(0xffff);
358+
bnxt_re_fill_fw_msg(&fw_msg, (void *)&req, sizeof(req), (void *)&resp,
359+
sizeof(resp), DFLT_HWRM_CMD_TIMEOUT);
360+
return bnxt_send_msg(en_dev, &fw_msg);
361+
}
362+
342363
static int bnxt_re_net_ring_free(struct bnxt_re_dev *rdev,
343364
u16 fw_ring_id, int type)
344365
{

0 commit comments

Comments
 (0)