@@ -1777,8 +1777,9 @@ static void efa_unlock_cqs(struct ibv_qp *ibvqp)
17771777 }
17781778}
17791779
1780- static void efa_qp_fill_wr_pfns (struct ibv_qp_ex * ibvqpx ,
1780+ static void efa_qp_fill_wr_pfns (struct efa_qp * qp ,
17811781 struct ibv_qp_init_attr_ex * attr_ex ,
1782+ struct efadv_qp_init_attr * efa_attr ,
17821783 uint16_t wqe_size );
17831784
17841785static int efa_check_qp_attr (struct efa_context * ctx ,
@@ -1853,6 +1854,12 @@ static int efa_check_qp_attr(struct efa_context *ctx,
18531854 }
18541855 }
18551856
1857+ if (!check_comp_mask (efa_attr -> wr_flags , EFADV_WR_EX_WITH_PROCESSING_HINTS )) {
1858+ verbs_err (& ctx -> ibvctx , "Unsupported wr_flags[%" PRIx64 "]\n" ,
1859+ efa_attr -> wr_flags );
1860+ return EOPNOTSUPP ;
1861+ }
1862+
18561863 if (!attr -> recv_cq || !attr -> send_cq ) {
18571864 verbs_err (& ctx -> ibvctx , "Send/Receive CQ not provided\n" );
18581865 return EINVAL ;
@@ -1983,7 +1990,7 @@ static struct ibv_qp *create_qp(struct ibv_context *ibvctx,
19831990 pthread_spin_unlock (& ctx -> qp_table_lock );
19841991
19851992 if (attr -> comp_mask & IBV_QP_INIT_ATTR_SEND_OPS_FLAGS ) {
1986- efa_qp_fill_wr_pfns (& qp -> verbs_qp . qp_ex , attr , qp -> sq .wqe_size );
1993+ efa_qp_fill_wr_pfns (qp , attr , efa_attr , qp -> sq .wqe_size );
19871994 qp -> verbs_qp .comp_mask |= VERBS_QP_EX ;
19881995 }
19891996
@@ -2185,6 +2192,13 @@ int efa_query_qp_data_in_order(struct ibv_qp *ibvqp, enum ibv_wr_opcode op,
21852192 return caps ;
21862193}
21872194
2195+ struct efadv_qp * efadv_qp_from_ibv_qp_ex (struct ibv_qp_ex * ibvqpx )
2196+ {
2197+ struct efa_qp * qp = to_efa_qp_ex (ibvqpx );
2198+
2199+ return & qp -> dv_qp ;
2200+ }
2201+
21882202int efa_destroy_qp (struct ibv_qp * ibvqp )
21892203{
21902204 struct efa_context * ctx = to_efa_context (ibvqp -> context );
@@ -2912,6 +2926,20 @@ static void efa_send_wr_set_addr(struct ibv_qp_ex *ibvqpx,
29122926 efa_wqe_get_data_length (qp -> sq ));
29132927}
29142928
2929+ static void efa_send_wr_set_processing_hints (struct efadv_qp * efadv_qp , uint32_t hints )
2930+ {
2931+ struct efa_qp * qp = efadv_qp_to_efa_qp (efadv_qp );
2932+ uint8_t wqe_hints = 0 ;
2933+
2934+ if (unlikely (qp -> wr_session_err ))
2935+ return ;
2936+
2937+ if (hints & EFADV_WR_PROCESSING_HINT_BURST_PPS_SENSITIVE )
2938+ wqe_hints |= EFA_IO_PROCESSING_HINT_BURST_PPS_SENSITIVE ;
2939+
2940+ EFA_SET (& qp -> sq .curr_tx_wqe .md -> ctrl3 , EFA_IO_TX_META_DESC_PROCESSING_HINTS , wqe_hints );
2941+ }
2942+
29152943static void efa_send_wr_start (struct ibv_qp_ex * ibvqpx )
29162944{
29172945 struct efa_qp * qp = to_efa_qp_ex (ibvqpx );
@@ -3012,11 +3040,13 @@ static void efa_send_wr_abort(struct ibv_qp_ex *ibvqpx)
30123040 pthread_spin_unlock (& sq -> wq .wqlock );
30133041}
30143042
3015- static void efa_qp_fill_wr_pfns (struct ibv_qp_ex * ibvqpx ,
3043+ static void efa_qp_fill_wr_pfns (struct efa_qp * qp ,
30163044 struct ibv_qp_init_attr_ex * attr_ex ,
3045+ struct efadv_qp_init_attr * efa_attr ,
30173046 uint16_t wqe_size )
30183047{
30193048 bool use_64 = wqe_size == EFA_IO_TX_DESC_SIZE_64 ;
3049+ struct ibv_qp_ex * ibvqpx = & qp -> verbs_qp .qp_ex ;
30203050
30213051 ibvqpx -> wr_start = efa_send_wr_start ;
30223052 ibvqpx -> wr_complete = efa_send_wr_complete ;
@@ -3045,6 +3075,9 @@ static void efa_qp_fill_wr_pfns(struct ibv_qp_ex *ibvqpx,
30453075 ibvqpx -> wr_set_sge = efa_send_wr_set_sge ;
30463076 ibvqpx -> wr_set_sge_list = efa_send_wr_set_sge_list ;
30473077 ibvqpx -> wr_set_ud_addr = efa_send_wr_set_addr ;
3078+
3079+ if (efa_attr -> wr_flags & EFADV_WR_EX_WITH_PROCESSING_HINTS )
3080+ qp -> dv_qp .wr_set_processing_hints = efa_send_wr_set_processing_hints ;
30483081}
30493082
30503083static int efa_post_recv_validate (struct efa_qp * qp , struct ibv_recv_wr * wr )
0 commit comments