Skip to content

Commit

Permalink
rpma: simplify server_cmpl_process()
Browse files Browse the repository at this point in the history
Simplify the code of the server_cmpl_process() function.

Signed-off-by: Lukasz Dorau <[email protected]>
  • Loading branch information
ldorau committed Sep 6, 2022
1 parent 021ce71 commit d3061c1
Showing 1 changed file with 18 additions and 22 deletions.
40 changes: 18 additions & 22 deletions engines/librpma_gpspm.c
Original file line number Diff line number Diff line change
Expand Up @@ -685,29 +685,25 @@ static int server_cmpl_process(struct thread_data *td)

ret = rpma_cq_get_wc(csd->cq, 1, wc, NULL);
if (ret == RPMA_E_NO_COMPLETION) {
if (o->busy_wait_polling == 0) {
ret = rpma_cq_wait(csd->cq);
if (ret == RPMA_E_NO_COMPLETION) {
/* lack of completion is not an error */
return 0;
} else if (ret != 0) {
librpma_td_verror(td, ret, "rpma_cq_wait");
goto err_terminate;
}

ret = rpma_cq_get_wc(csd->cq, 1, wc, NULL);
if (ret == RPMA_E_NO_COMPLETION) {
/* lack of completion is not an error */
return 0;
} else if (ret != 0) {
librpma_td_verror(td, ret, "rpma_cq_get_wc");
goto err_terminate;
}
} else {
/* lack of completion is not an error */
return 0;
if (o->busy_wait_polling)
return 0; /* lack of completion is not an error */

ret = rpma_cq_wait(csd->cq);
if (ret == RPMA_E_NO_COMPLETION)
return 0; /* lack of completion is not an error */
if (ret) {
librpma_td_verror(td, ret, "rpma_cq_wait");
goto err_terminate;
}

ret = rpma_cq_get_wc(csd->cq, 1, wc, NULL);
if (ret == RPMA_E_NO_COMPLETION)
return 0; /* lack of completion is not an error */
if (ret) {
librpma_td_verror(td, ret, "rpma_cq_get_wc");
goto err_terminate;
}
} else if (ret != 0) {
} else if (ret) {
librpma_td_verror(td, ret, "rpma_cq_get_wc");
goto err_terminate;
}
Expand Down

0 comments on commit d3061c1

Please sign in to comment.