1mlx5dv_qp_cancel_posted_send_wrs(3)        mlx5dv_qp_cancel_posted_send_wrs(3)
2
3
4

NAME

6       mlx5dv_qp_cancel_posted_send_wrs  -  Cancel  all  pending send work re‐
7       quests with supplied WRID in a QP in SQD state
8

SYNOPSIS

10              #include <infiniband/mlx5dv.h>
11
12              int mlx5dv_qp_cancel_posted_send_wrs(struct mlx5dv_qp_ex *mqp, uint64_t wr_id);
13

DESCRIPTION

15       The canceled work requests are replaced with NOPs (no  operation),  and
16       will  generate  good  completions according to the signaling originally
17       requested in the send flags, or “flushed” completions in  case  the  QP
18       goes  to  error.  A work request can only be canceled when the QP is in
19       SQD state.
20
21       The cancel function is a part of the signature pipelining feature.  The
22       feature  allows posting a signature related transfer operation together
23       with a SEND with a good response to the client.  Normally, the applica‐
24       tion  must wait for the transfer to end, check the MKEY for errors, and
25       only then send a good or bad response.  However this increases the  la‐
26       tency of the good flow of a transaction.
27
28       To  enable  this  feature, a QP must be created with the MLX5DV_QP_CRE‐
29       ATE_SIG_PIPELINING creation flag.  Such QP will stop after  a  transfer
30       operation    that   failed   signature   validation   in   SQD   state.
31       IBV_EVENT_SQ_DRAINED is generated to inform about the new state.
32
33       The SEND operation that might need to be canceled due to a  bad  signa‐
34       ture of a previous operation must be posted with the IBV_SEND_FENCE op‐
35       tion in ibv_qp_ex->wr_flags field.
36
37       When QP stopped at SQD, it means that at least one WR caused  signature
38       error.   It  may  not be the last WR.  It may be that more than one WRs
39       cause signature errors by the time the QP finally stopped.  It is guar‐
40       anteed that the QP has stopped somewhere between the WQE that generated
41       the signature error, and the next WQE that has IBV_SEND_FENCE on it.
42
43       Software must handle the SQD event as described below:
44
45       1. Poll everything (polling until 0 once) on the respective CQ,  allow‐
46          ing the discovery of all possible signature errors.
47
48       2. Look  through all “open” transactions, check related signature MKEYs
49          using mlx5dv_mkey_check(3), find the one with the  signature  error,
50          get a WRID from the operation software context and handle the failed
51          operation.
52
53       3. Cancel  the  SEND  WR  by  the  WRID  using   mlx5dv_qp_cancel_post‐
54          ed_send_wrs().
55
56       4. Modify the QP back to RTS state.
57

ARGUMENTS

59       mqp    The QP to investigate, which must be in SQD state.
60
61       wr_id  The WRID to cancel.
62

RETURN VALUE

64       Number of work requests that were canceled, or -errno on error.
65

NOTES

67       A DEVX context should be opened by using mlx5dv_open_device(3).
68
69       Must be called with a QP in SQD state.
70
71       QP  should  be  created  with  MLX5DV_QP_CREATE_SIG_PIPELINING creation
72       flag.  Application must listen on QP events, and expect a SQD event.
73

SEE ALSO

75       mlx5dv_mkey_check(3),                      mlx5dv_wr_mkey_configure(3),
76       mlx5dv_wr_set_mkey_sig_block(3),    mlx5dv_create_mkey(3),   mlx5dv_de‐
77       stroy_mkey(3)
78

AUTHORS

80       Oren Duer <oren@nvidia.com>
81
82       Sergey Gorenko <sergeygo@nvidia.com>
83
84
85
86                                           mlx5dv_qp_cancel_posted_send_wrs(3)
Impressum