@@ -4294,10 +4294,10 @@ static void dump_wqe(struct mlx5_ib_qp *qp, int idx, int size_16)
4294
4294
}
4295
4295
}
4296
4296
4297
- static int begin_wqe (struct mlx5_ib_qp * qp , void * * seg ,
4297
+ static int __begin_wqe (struct mlx5_ib_qp * qp , void * * seg ,
4298
4298
struct mlx5_wqe_ctrl_seg * * ctrl ,
4299
4299
const struct ib_send_wr * wr , unsigned * idx ,
4300
- int * size , int nreq )
4300
+ int * size , int nreq , bool send_signaled , bool solicited )
4301
4301
{
4302
4302
if (unlikely (mlx5_wq_overflow (& qp -> sq , nreq , qp -> ibqp .send_cq )))
4303
4303
return - ENOMEM ;
@@ -4308,17 +4308,25 @@ static int begin_wqe(struct mlx5_ib_qp *qp, void **seg,
4308
4308
* (uint32_t * )(* seg + 8 ) = 0 ;
4309
4309
(* ctrl )-> imm = send_ieth (wr );
4310
4310
(* ctrl )-> fm_ce_se = qp -> sq_signal_bits |
4311
- (wr -> send_flags & IB_SEND_SIGNALED ?
4312
- MLX5_WQE_CTRL_CQ_UPDATE : 0 ) |
4313
- (wr -> send_flags & IB_SEND_SOLICITED ?
4314
- MLX5_WQE_CTRL_SOLICITED : 0 );
4311
+ (send_signaled ? MLX5_WQE_CTRL_CQ_UPDATE : 0 ) |
4312
+ (solicited ? MLX5_WQE_CTRL_SOLICITED : 0 );
4315
4313
4316
4314
* seg += sizeof (* * ctrl );
4317
4315
* size = sizeof (* * ctrl ) / 16 ;
4318
4316
4319
4317
return 0 ;
4320
4318
}
4321
4319
4320
+ static int begin_wqe (struct mlx5_ib_qp * qp , void * * seg ,
4321
+ struct mlx5_wqe_ctrl_seg * * ctrl ,
4322
+ const struct ib_send_wr * wr , unsigned * idx ,
4323
+ int * size , int nreq )
4324
+ {
4325
+ return __begin_wqe (qp , seg , ctrl , wr , idx , size , nreq ,
4326
+ wr -> send_flags & IB_SEND_SIGNALED ,
4327
+ wr -> send_flags & IB_SEND_SOLICITED );
4328
+ }
4329
+
4322
4330
static void finish_wqe (struct mlx5_ib_qp * qp ,
4323
4331
struct mlx5_wqe_ctrl_seg * ctrl ,
4324
4332
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,
4477
4485
* SET_PSV WQEs are not signaled and solicited
4478
4486
* on error
4479
4487
*/
4480
- wr -> send_flags &= ~IB_SEND_SIGNALED ;
4481
- wr -> send_flags |= IB_SEND_SOLICITED ;
4482
- err = begin_wqe (qp , & seg , & ctrl , wr ,
4483
- & idx , & size , nreq );
4488
+ err = __begin_wqe (qp , & seg , & ctrl , wr , & idx ,
4489
+ & size , nreq , false, true);
4484
4490
if (err ) {
4485
4491
mlx5_ib_warn (dev , "\n" );
4486
4492
err = - ENOMEM ;
@@ -4499,8 +4505,8 @@ static int _mlx5_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
4499
4505
4500
4506
finish_wqe (qp , ctrl , size , idx , wr -> wr_id , nreq ,
4501
4507
fence , MLX5_OPCODE_SET_PSV );
4502
- err = begin_wqe (qp , & seg , & ctrl , wr ,
4503
- & idx , & size , nreq );
4508
+ err = __begin_wqe (qp , & seg , & ctrl , wr , & idx ,
4509
+ & size , nreq , false, true );
4504
4510
if (err ) {
4505
4511
mlx5_ib_warn (dev , "\n" );
4506
4512
err = - ENOMEM ;
0 commit comments