RDMA: Constify the argument of the work request conversion functions
When posting a send work request, the work request that is posted is not modified by any of the RDMA drivers. Make this explicit by constifying most ib_send_wr pointers in RDMA transport drivers. Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Reviewed-by: Steve Wise <swise@opengridcomputing.com> Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Šī revīzija ir iekļauta:

revīziju iesūtīja
Jason Gunthorpe

vecāks
3e081b773e
revīzija
f696bf6d64
@@ -410,7 +410,7 @@ free_sq_qid:
|
||||
}
|
||||
|
||||
static int build_immd(struct t4_sq *sq, struct fw_ri_immd *immdp,
|
||||
struct ib_send_wr *wr, int max, u32 *plenp)
|
||||
const struct ib_send_wr *wr, int max, u32 *plenp)
|
||||
{
|
||||
u8 *dstp, *srcp;
|
||||
u32 plen = 0;
|
||||
@@ -480,7 +480,7 @@ static int build_isgl(__be64 *queue_start, __be64 *queue_end,
|
||||
}
|
||||
|
||||
static int build_rdma_send(struct t4_sq *sq, union t4_wr *wqe,
|
||||
struct ib_send_wr *wr, u8 *len16)
|
||||
const struct ib_send_wr *wr, u8 *len16)
|
||||
{
|
||||
u32 plen;
|
||||
int size;
|
||||
@@ -547,7 +547,7 @@ static int build_rdma_send(struct t4_sq *sq, union t4_wr *wqe,
|
||||
}
|
||||
|
||||
static int build_rdma_write(struct t4_sq *sq, union t4_wr *wqe,
|
||||
struct ib_send_wr *wr, u8 *len16)
|
||||
const struct ib_send_wr *wr, u8 *len16)
|
||||
{
|
||||
u32 plen;
|
||||
int size;
|
||||
@@ -589,7 +589,8 @@ static int build_rdma_write(struct t4_sq *sq, union t4_wr *wqe,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int build_rdma_read(union t4_wr *wqe, struct ib_send_wr *wr, u8 *len16)
|
||||
static int build_rdma_read(union t4_wr *wqe, const struct ib_send_wr *wr,
|
||||
u8 *len16)
|
||||
{
|
||||
if (wr->num_sge > 1)
|
||||
return -EINVAL;
|
||||
@@ -648,7 +649,7 @@ static int build_srq_recv(union t4_recv_wr *wqe, struct ib_recv_wr *wr,
|
||||
}
|
||||
|
||||
static void build_tpte_memreg(struct fw_ri_fr_nsmr_tpte_wr *fr,
|
||||
struct ib_reg_wr *wr, struct c4iw_mr *mhp,
|
||||
const struct ib_reg_wr *wr, struct c4iw_mr *mhp,
|
||||
u8 *len16)
|
||||
{
|
||||
__be64 *p = (__be64 *)fr->pbl;
|
||||
@@ -680,8 +681,8 @@ static void build_tpte_memreg(struct fw_ri_fr_nsmr_tpte_wr *fr,
|
||||
}
|
||||
|
||||
static int build_memreg(struct t4_sq *sq, union t4_wr *wqe,
|
||||
struct ib_reg_wr *wr, struct c4iw_mr *mhp, u8 *len16,
|
||||
bool dsgl_supported)
|
||||
const struct ib_reg_wr *wr, struct c4iw_mr *mhp,
|
||||
u8 *len16, bool dsgl_supported)
|
||||
{
|
||||
struct fw_ri_immd *imdp;
|
||||
__be64 *p;
|
||||
@@ -743,7 +744,8 @@ static int build_memreg(struct t4_sq *sq, union t4_wr *wqe,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int build_inv_stag(union t4_wr *wqe, struct ib_send_wr *wr, u8 *len16)
|
||||
static int build_inv_stag(union t4_wr *wqe, const struct ib_send_wr *wr,
|
||||
u8 *len16)
|
||||
{
|
||||
wqe->inv.stag_inv = cpu_to_be32(wr->ex.invalidate_rkey);
|
||||
wqe->inv.r2 = 0;
|
||||
@@ -862,7 +864,8 @@ static int ib_to_fw_opcode(int ib_opcode)
|
||||
return opcode;
|
||||
}
|
||||
|
||||
static int complete_sq_drain_wr(struct c4iw_qp *qhp, struct ib_send_wr *wr)
|
||||
static int complete_sq_drain_wr(struct c4iw_qp *qhp,
|
||||
const struct ib_send_wr *wr)
|
||||
{
|
||||
struct t4_cqe cqe = {};
|
||||
struct c4iw_cq *schp;
|
||||
|
Atsaukties uz šo jaunā problēmā
Block a user