How to create a UD QP with user-defined source QP number?

Hello,

I would like to create a QP with type of IBV_QPT_UD and with a app-defined source QP number. I try to use ibv_create_qp_ex function to create it, but it return failure. The errno code is 95, which means it does not support this operation. What is the specific reason? Is the NIC driver not supported?

OS version: ubuntu22.04
MLNX OFED version: MLNX_OFED_LINUX-5.8-4.1.5.0
NIC: CX6 DX

The code is shown below:

struct ibv_qp_init_attr_ex ud_qp_init_attr;
memset(&ud_qp_init_attr, 0, sizeof(ud_qp_init_attr));
ud_qp_init_attr.send_cq = ib_cq; // ib_cq is created before
ud_qp_init_attr.recv_cq = ib_cq;
ud_qp_init_attr.cap.max_send_wr = 16;
ud_qp_init_attr.cap.max_recv_wr = 16;
ud_qp_init_attr.cap.max_send_sge = 4;
ud_qp_init_attr.cap.max_recv_sge = 4;
ud_qp_init_attr.qp_type = IBV_QPT_UD;
ud_qp_init_attr.comp_mask = IBV_QP_INIT_ATTR_PD | IBV_QP_INIT_ATTR_SEND_OPS_FLAGS | IBV_QP_INIT_ATTR_CREATE_FLAGS;
ud_qp_init_attr.pd = ib_pd; // ib_pd is also create before
ud_qp_init_attr.create_flags = IBV_QP_CREATE_SOURCE_QPN;
ud_qp_init_attr.source_qpn = 5004;
ud_qp_init_attr.send_ops_flags = IBV_QP_EX_WITH_SEND;
struct ibv_qp* ret_qp = ibv_create_qp_ex(ib_ctx, &ud_qp_init_attr); // ib_ctx is also created before

Thanks!

Hello,

Please try to install the latest MLNX_OFED version - 24.04-0.6.6.0
from: Linux InfiniBand Drivers
And see if that works.
If it still doesn’t work, please open a case at enterprisesupport@nvidia.com and it will be handled according to entitlement.

Best Regards,
Jonathan.