.\" Automatically generated by Pandoc 3.1.3 .\" .\" Define V font for inline verbatim, using C font in formats .\" that render this, and otherwise B font. .ie "\f[CB]x\f[]"x" \{\ . ftr V B . ftr VI BI . ftr VB B . ftr VBI BI .\} .el \{\ . ftr V CR . ftr VI CI . ftr VB CB . ftr VBI CBI .\} .TH "mlx5dv_qp_cancel_posted_send_wrs" "3" "" "" "" .hy .SH NAME .PP mlx5dv_qp_cancel_posted_send_wrs - Cancel all pending send work requests with supplied WRID in a QP in SQD state .SH SYNOPSIS .IP .nf \f[C] #include int mlx5dv_qp_cancel_posted_send_wrs(struct mlx5dv_qp_ex *mqp, uint64_t wr_id); \f[R] .fi .SH DESCRIPTION .PP The canceled work requests are replaced with NOPs (no operation), and will generate good completions according to the signaling originally requested in the send flags, or \[lq]flushed\[rq] completions in case the QP goes to error. A work request can only be canceled when the QP is in SQD state. .PP The cancel function is a part of the signature pipelining feature. The feature allows posting a signature related transfer operation together with a SEND with a good response to the client. Normally, the application must wait for the transfer to end, check the MKEY for errors, and only then send a good or bad response. However this increases the latency of the good flow of a transaction. .PP To enable this feature, a QP must be created with the \f[B]MLX5DV_QP_CREATE_SIG_PIPELINING\f[R] creation flag. Such QP will stop after a transfer operation that failed signature validation in SQD state. \f[B]IBV_EVENT_SQ_DRAINED\f[R] is generated to inform about the new state. .PP The SEND operation that might need to be canceled due to a bad signature of a previous operation must be posted with the \f[B]IBV_SEND_FENCE\f[R] option in \f[B]ibv_qp_ex->wr_flags\f[R] field. .PP When QP stopped at SQD, it means that at least one WR caused signature error. It may not be the last WR. It may be that more than one WRs cause signature errors by the time the QP finally stopped. It is guaranteed that the QP has stopped somewhere between the WQE that generated the signature error, and the next WQE that has \f[B]IBV_SEND_FENCE\f[R] on it. .PP Software must handle the SQD event as described below: .IP "1." 3 Poll everything (polling until 0 once) on the respective CQ, allowing the discovery of all possible signature errors. .IP "2." 3 Look through all \[lq]open\[rq] transactions, check related signature MKEYs using \f[B]mlx5dv_mkey_check\f[R](3), find the one with the signature error, get a \f[B]WRID\f[R] from the operation software context and handle the failed operation. .IP "3." 3 Cancel the SEND WR by the WRID using \f[B]mlx5dv_qp_cancel_posted_send_wrs\f[R](). .IP "4." 3 Modify the QP back to RTS state. .SH ARGUMENTS .TP \f[I]mqp\f[R] The QP to investigate, which must be in SQD state. .TP \f[I]wr_id\f[R] The WRID to cancel. .SH RETURN VALUE .PP Number of work requests that were canceled, or -errno on error. .SH NOTES .PP A DEVX context should be opened by using \f[B]mlx5dv_open_device\f[R](3). .PP Must be called with a QP in SQD state. .PP QP should be created with \f[B]MLX5DV_QP_CREATE_SIG_PIPELINING\f[R] creation flag. Application must listen on QP events, and expect a SQD event. .SH SEE ALSO .PP \f[B]mlx5dv_mkey_check\f[R](3), \f[B]mlx5dv_wr_mkey_configure\f[R](3), \f[B]mlx5dv_wr_set_mkey_sig_block\f[R](3), \f[B]mlx5dv_create_mkey\f[R](3), \f[B]mlx5dv_destroy_mkey\f[R](3) .SH AUTHORS .PP Oren Duer .PP Sergey Gorenko