static int qemu_rdma_post_recv_control(RDMAContext *rdma, int idx)

{

    struct ibv_recv_wr *bad_wr;

    struct ibv_sge sge = {

                            .addr = (uint64_t)(rdma->wr_data[idx].control),

                            .length = RDMA_CONTROL_MAX_BUFFER,

                            .lkey = rdma->wr_data[idx].control_mr->lkey,

                         };



    struct ibv_recv_wr recv_wr = {

                                    .wr_id = RDMA_WRID_RECV_CONTROL + idx,

                                    .sg_list = &sge,

                                    .num_sge = 1,

                                 };





    if (ibv_post_recv(rdma->qp, &recv_wr, &bad_wr)) {

        return -1;

    }



    return 0;

}

static int qemu_rdma_post_recv_control(RDMAContext *rdma, int idx)

{

    struct ibv_recv_wr *bad_wr;

    struct ibv_sge sge = {

                            .addr = (uint64_t)(rdma->wr_data[idx].control),

                            .length = RDMA_CONTROL_MAX_BUFFER,

                            .lkey = rdma->wr_data[idx].control_mr->lkey,

                         };



    struct ibv_recv_wr recv_wr = {

                                    .wr_id = RDMA_WRID_RECV_CONTROL + idx,

                                    .sg_list = &sge,

                                    .num_sge = 1,

                                 };





    if (ibv_post_recv(rdma->qp, &recv_wr, &bad_wr)) {

        return -1;

    }



    return 0;

}

static int FUNC_0(RDMAContext *VAR_0, int VAR_1)

{

    struct ibv_recv_wr *VAR_2;

    struct ibv_sge VAR_3 = {

                            .addr = (uint64_t)(VAR_0->wr_data[VAR_1].control),

                            .length = RDMA_CONTROL_MAX_BUFFER,

                            .lkey = VAR_0->wr_data[VAR_1].control_mr->lkey,

                         };



    struct ibv_recv_wr VAR_4 = {

                                    .wr_id = RDMA_WRID_RECV_CONTROL + VAR_1,

                                    .sg_list = &VAR_3,

                                    .num_sge = 1,

                                 };





    if (ibv_post_recv(VAR_0->qp, &VAR_4, &VAR_2)) {

        return -1;

    }



    return 0;

}

static int FUNC_0(RDMAContext *VAR_0, int VAR_1)
{ struct ibv_recv_wr *VAR_2; struct ibv_sge VAR_3 = { .addr = (uint64_t)(VAR_0->wr_data[VAR_1].control),
.length = RDMA_CONTROL_MAX_BUFFER,
.lkey = VAR_0->wr_data[VAR_1].control_mr->lkey,
}; struct ibv_recv_wr VAR_4 = { .wr_id = RDMA_WRID_RECV_CONTROL + VAR_1,
.sg_list = &VAR_3,
.num_sge = 1,
}; if (ibv_post_recv(VAR_0->qp, &VAR_4, &VAR_2)) { return -1; } return 0; }