mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 11:18:45 +07:00
IB/mlx5, ib_post_send(), IB_WR_REG_SIG_MR: Do not modify the 'wr' argument
Since the next patch will constify the wr pointer, do not modify the data that pointer points at. Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Cc: Saeed Mahameed <saeedm@mellanox.com> Acked-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
This commit is contained in:
parent
f696bf6d64
commit
7bb1fafc2f
@ -4294,10 +4294,10 @@ static void dump_wqe(struct mlx5_ib_qp *qp, int idx, int size_16)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int begin_wqe(struct mlx5_ib_qp *qp, void **seg,
|
static int __begin_wqe(struct mlx5_ib_qp *qp, void **seg,
|
||||||
struct mlx5_wqe_ctrl_seg **ctrl,
|
struct mlx5_wqe_ctrl_seg **ctrl,
|
||||||
const struct ib_send_wr *wr, unsigned *idx,
|
const struct ib_send_wr *wr, unsigned *idx,
|
||||||
int *size, int nreq)
|
int *size, int nreq, bool send_signaled, bool solicited)
|
||||||
{
|
{
|
||||||
if (unlikely(mlx5_wq_overflow(&qp->sq, nreq, qp->ibqp.send_cq)))
|
if (unlikely(mlx5_wq_overflow(&qp->sq, nreq, qp->ibqp.send_cq)))
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
@ -4308,10 +4308,8 @@ static int begin_wqe(struct mlx5_ib_qp *qp, void **seg,
|
|||||||
*(uint32_t *)(*seg + 8) = 0;
|
*(uint32_t *)(*seg + 8) = 0;
|
||||||
(*ctrl)->imm = send_ieth(wr);
|
(*ctrl)->imm = send_ieth(wr);
|
||||||
(*ctrl)->fm_ce_se = qp->sq_signal_bits |
|
(*ctrl)->fm_ce_se = qp->sq_signal_bits |
|
||||||
(wr->send_flags & IB_SEND_SIGNALED ?
|
(send_signaled ? MLX5_WQE_CTRL_CQ_UPDATE : 0) |
|
||||||
MLX5_WQE_CTRL_CQ_UPDATE : 0) |
|
(solicited ? MLX5_WQE_CTRL_SOLICITED : 0);
|
||||||
(wr->send_flags & IB_SEND_SOLICITED ?
|
|
||||||
MLX5_WQE_CTRL_SOLICITED : 0);
|
|
||||||
|
|
||||||
*seg += sizeof(**ctrl);
|
*seg += sizeof(**ctrl);
|
||||||
*size = sizeof(**ctrl) / 16;
|
*size = sizeof(**ctrl) / 16;
|
||||||
@ -4319,6 +4317,16 @@ static int begin_wqe(struct mlx5_ib_qp *qp, void **seg,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int begin_wqe(struct mlx5_ib_qp *qp, void **seg,
|
||||||
|
struct mlx5_wqe_ctrl_seg **ctrl,
|
||||||
|
const struct ib_send_wr *wr, unsigned *idx,
|
||||||
|
int *size, int nreq)
|
||||||
|
{
|
||||||
|
return __begin_wqe(qp, seg, ctrl, wr, idx, size, nreq,
|
||||||
|
wr->send_flags & IB_SEND_SIGNALED,
|
||||||
|
wr->send_flags & IB_SEND_SOLICITED);
|
||||||
|
}
|
||||||
|
|
||||||
static void finish_wqe(struct mlx5_ib_qp *qp,
|
static void finish_wqe(struct mlx5_ib_qp *qp,
|
||||||
struct mlx5_wqe_ctrl_seg *ctrl,
|
struct mlx5_wqe_ctrl_seg *ctrl,
|
||||||
u8 size, unsigned idx, u64 wr_id,
|
u8 size, unsigned idx, u64 wr_id,
|
||||||
@ -4477,10 +4485,8 @@ static int _mlx5_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
|
|||||||
* SET_PSV WQEs are not signaled and solicited
|
* SET_PSV WQEs are not signaled and solicited
|
||||||
* on error
|
* on error
|
||||||
*/
|
*/
|
||||||
wr->send_flags &= ~IB_SEND_SIGNALED;
|
err = __begin_wqe(qp, &seg, &ctrl, wr, &idx,
|
||||||
wr->send_flags |= IB_SEND_SOLICITED;
|
&size, nreq, false, true);
|
||||||
err = begin_wqe(qp, &seg, &ctrl, wr,
|
|
||||||
&idx, &size, nreq);
|
|
||||||
if (err) {
|
if (err) {
|
||||||
mlx5_ib_warn(dev, "\n");
|
mlx5_ib_warn(dev, "\n");
|
||||||
err = -ENOMEM;
|
err = -ENOMEM;
|
||||||
@ -4499,8 +4505,8 @@ static int _mlx5_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
|
|||||||
|
|
||||||
finish_wqe(qp, ctrl, size, idx, wr->wr_id, nreq,
|
finish_wqe(qp, ctrl, size, idx, wr->wr_id, nreq,
|
||||||
fence, MLX5_OPCODE_SET_PSV);
|
fence, MLX5_OPCODE_SET_PSV);
|
||||||
err = begin_wqe(qp, &seg, &ctrl, wr,
|
err = __begin_wqe(qp, &seg, &ctrl, wr, &idx,
|
||||||
&idx, &size, nreq);
|
&size, nreq, false, true);
|
||||||
if (err) {
|
if (err) {
|
||||||
mlx5_ib_warn(dev, "\n");
|
mlx5_ib_warn(dev, "\n");
|
||||||
err = -ENOMEM;
|
err = -ENOMEM;
|
||||||
|
Loading…
Reference in New Issue
Block a user