.\" Automatically generated by Pandoc 1.16.0.2
.\"
.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\ <infiniband/mlx5dv.h>

int\ mlx5dv_qp_cancel_posted_send_wrs(struct\ mlx5dv_qp_ex\ *mqp,\ uint64_t\ wr_id);
\f[]
.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 "flushed" 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[] creation flag.
Such QP will stop after a transfer operation that failed signature
validation in SQD state.
\f[B]IBV_EVENT_SQ_DRAINED\f[] 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[]
option in \f[B]ibv_qp_ex\->wr_flags\f[] 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[] 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 "open" transactions, check related signature MKEYs
using \f[B]mlx5dv_mkey_check\f[](3), find the one with the signature
error, get a \f[B]WRID\f[] 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[]().
.IP "4." 3
Modify the QP back to RTS state.
.SH ARGUMENTS
.TP
.B \f[I]mqp\f[]
The QP to investigate, which must be in SQD state.
.RS
.RE
.TP
.B \f[I]wr_id\f[]
The WRID to cancel.
.RS
.RE
.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[](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[]
creation flag.
Application must listen on QP events, and expect a SQD event.
.SH SEE ALSO
.PP
\f[B]mlx5dv_mkey_check\f[](3), \f[B]mlx5dv_wr_mkey_configure\f[](3),
\f[B]mlx5dv_wr_set_mkey_sig_block\f[](3),
\f[B]mlx5dv_create_mkey\f[](3), \f[B]mlx5dv_destroy_mkey\f[](3)
.SH AUTHORS
.PP
Oren Duer <oren@nvidia.com>
.PP
Sergey Gorenko <sergeygo@nvidia.com>
