Skip to content

Commit

Permalink
rxe: use ibv_inc_rkey helper for generating type 1 bind rkey
Browse files Browse the repository at this point in the history
The rkeys are being calculated the same way, so just use
the helper instead.

Signed-off-by: Jacob Moroni <jmoroni@google.com>
  • Loading branch information
jakemoroni committed Oct 21, 2024
1 parent f5475dd commit 0cbc484
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions providers/rxe/rxe.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,6 @@ static int rxe_dealloc_mw(struct ibv_mw *ibmw)
return 0;
}

static int next_rkey(int rkey)
{
return (rkey & 0xffffff00) | ((rkey + 1) & 0x000000ff);
}

static int rxe_post_send(struct ibv_qp *ibqp, struct ibv_send_wr *wr_list,
struct ibv_send_wr **bad_wr);

Expand All @@ -191,7 +186,7 @@ static int rxe_bind_mw(struct ibv_qp *ibqp, struct ibv_mw *ibmw,
ibwr.send_flags = mw_bind->send_flags;
ibwr.bind_mw.bind_info = mw_bind->bind_info;
ibwr.bind_mw.mw = ibmw;
ibwr.bind_mw.rkey = next_rkey(ibmw->rkey);
ibwr.bind_mw.rkey = ibv_inc_rkey(ibmw->rkey);

ret = rxe_post_send(ibqp, &ibwr, &bad_wr);
if (ret)
Expand Down

0 comments on commit 0cbc484

Please # to comment.