Skip to content

Commit

Permalink
ibv backend: adjust max_send, max_recv, max_cqe according to device_attr
Browse files Browse the repository at this point in the history
  • Loading branch information
JiakunYan committed Sep 20, 2024
1 parent 66d3f76 commit a0dfa7d
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions lci/backend/ibv/server_ibv.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,32 @@ void LCISD_server_init(LCIS_server_t* s)
exit(EXIT_FAILURE);
}

// adjust max_send, max_recv, max_cqe
// Note: the max value reported by device attributes might still not be the
// strict upper bound.
if (LCI_SERVER_MAX_SENDS > server->dev_attr.max_qp_wr) {
LCI_Log(LCI_LOG_INFO, "ibv",
"The configured LCI_SERVER_MAX_SENDS (%d) is adjusted as it is "
"larger than the maximum allowable value by the device (%d).\n",
LCI_SERVER_MAX_SENDS, server->dev_attr.max_qp_wr);
LCI_SERVER_MAX_SENDS = server->dev_attr.max_qp_wr;
}
if (LCI_SERVER_MAX_RECVS > server->dev_attr.max_srq_wr) {
LCI_Log(LCI_LOG_INFO, "ibv",
"The configured LCI_SERVER_MAX_RECVS (%d) is adjusted as it is "
"larger than the maximum allowable value by the device (%d).\n",
LCI_SERVER_MAX_RECVS, server->dev_attr.max_srq_wr);
LCI_SERVER_MAX_RECVS = server->dev_attr.max_srq_wr;
}
if (LCI_SERVER_MAX_CQES > server->dev_attr.max_cqe) {
LCI_Log(LCI_LOG_INFO, "ibv",
"The configured LCI_SERVER_MAX_CQES (%d) is adjusted as it is "
"larger than the maximum allowable value by the device (%d).\n",
LCI_SERVER_MAX_CQES, server->dev_attr.max_cqe);
LCI_SERVER_MAX_CQES = server->dev_attr.max_cqe;
}

// configure on-demand paging
server->odp_mr = NULL;
if (LCI_IBV_USE_ODP == 2) {
#ifdef IBV_ODP_SUPPORT_SRQ_RECV
Expand Down

0 comments on commit a0dfa7d

Please sign in to comment.