RDMA/irdma: Allow accurate reporting on QP max send/recv WR
authorSindhu Devale <sindhu.devale@intel.com>
Tue, 25 Jul 2023 15:55:24 +0000 (10:55 -0500)
committerLeon Romanovsky <leon@kernel.org>
Sun, 30 Jul 2023 12:43:00 +0000 (15:43 +0300)
commit3a8498720450174b8db450d3375a04dca81b3534
tree57ec891ff8849482750eebcf0192df82fc86fb9d
parentcb06b6b3f6cbc56c534587db2aac3e0958a4a314
RDMA/irdma: Allow accurate reporting on QP max send/recv WR

Currently the attribute cap.max_send_wr and cap.max_recv_wr
sent from user-space during create QP are the provider computed
SQ/RQ depth as opposed to raw values passed from application.
This inhibits computation of an accurate value for max_send_wr
and max_recv_wr for this QP in the kernel which matches the value
returned in user create QP. Also these capabilities needs to be
reported from the driver in query QP.

Add support by extending the ABI to allow the raw cap.max_send_wr and
cap.max_recv_wr to be passed from user-space, while keeping compatibility
for the older scheme.

The internal HW depth and shift needed for the WQs needs to be computed
now for both kernel and user-mode QPs. Add new helpers to assist with this:
irdma_uk_calc_depth_shift_sq, irdma_uk_calc_depth_shift_rq and
irdma_uk_calc_depth_shift_wq.

Consolidate all the user mode QP setup into a new function
irdma_setup_umode_qp which keeps it with its counterpart
irdma_setup_kmode_qp.

Signed-off-by: Youvaraj Sagar <youvaraj.sagar@intel.com>
Signed-off-by: Sindhu Devale <sindhu.devale@intel.com>
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
Link: https://lore.kernel.org/r/20230725155525.1081-2-shiraz.saleem@intel.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/hw/irdma/uk.c
drivers/infiniband/hw/irdma/user.h
drivers/infiniband/hw/irdma/verbs.c
drivers/infiniband/hw/irdma/verbs.h
include/uapi/rdma/irdma-abi.h