mlx5dv_qp_cancel_posted_send_wrs(3)
π NAME π
okay so this is the mlx5dv_qp_cancel_posted_send_wrs(3) page, bestie β itβs all about cancel all pending send work requests with supplied WRID in a QP in SQD state. Periodt. π
β¨ SYNOPSIS β¨
#include <infiniband/mlx5dv.h>
int mlx5dv_qp_cancel_posted_send_wrs(struct mlx5dv_qp_ex *mqp, uint64_t wr_id);
π¦ DESCRIPTION π¦
okay so when you cancel stuff here, the canceled work requests get replaced with NOPs (no operation), and theyβll generate good completions according to the signaling that was originally requested in the send flags β or βflushedβ completions if the QP goes to error. The one big vibe check: a work request can only be canceled when the QP is in SQD state. π
The cancel function is a part of the signature pipelining feature. This feature lets you post a signature related transfer operation together with a SEND with a good response to the client. Normally, the application has to wait for the transfer to end, check the MKEY for errors, and only then send a good or bad response β and yeah, that increases the latency of the good flow of a transaction. π
To enable this feature, a QP must be created with the MLX5DV_QP_CREATE_SIG_PIPELINING creation flag. Such a QP will stop after a transfer operation that failed signature validation in SQD state. IBV_EVENT_SQ_DRAINED is generated to inform about the new state. π¦
The SEND operation that might need to be canceled due to a bad signature of a previous operation must be posted with the IBV_SEND_FENCE option in ibv_qp_ex->wr_flags field. π₯
When the QP stopped at SQD, it means at least one WR caused a 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 IBV_SEND_FENCE on it. No cap. π
Software must handle the SQD event as described below:
- Poll everything (polling until 0 once) on the respective CQ, allowing the discovery of all possible signature errors.
- Look through all βopenβ transactions, check related signature MKEYs using
mlx5dv_mkey_check(3), find the one with the signature error, get a WRID from the operation software context and handle the failed operation. - Cancel the SEND WR by the WRID using
mlx5dv_qp_cancel_posted_send_wrs(). - Modify the QP back to RTS state.
π ARGUMENTS π
mqpβ the QP to investigate, and it must be in SQD state. πwr_idβ the WRID to cancel. π
πΈ RETURN VALUE πΈ
Number of work requests that were canceled, or -errno on error. Slay. β¨
π₯ NOTES π₯
- A DEVX context should be opened by using
mlx5dv_open_device(3). π«Ά - Must be called with a QP in SQD state. That part is not optional, bestie.
- QP should be created with
MLX5DV_QP_CREATE_SIG_PIPELININGcreation flag. Application must listen on QP events, and expect a SQD event. π
π SEE ALSO π
mlx5dv_mkey_check(3)mlx5dv_wr_mkey_configure(3)mlx5dv_wr_set_mkey_sig_block(3)mlx5dv_create_mkey(3)mlx5dv_destroy_mkey(3)
π«Ά AUTHORS π«Ά
Oren Duer <oren@nvidia.com>Sergey Gorenko <sergeygo@nvidia.com>
okay thatβs the whole mlx5dv_qp_cancel_posted_send_wrs(3) page, bestie. The footer just repeats the title, so no separate source/version and date info to spill β bye and go handle those SQD events like a main character! π
ππ
π¦ where this page comes from
- alpine 3.24: rdma-core-doc 61.0-r0 Β· GPL-2.0-only OR BSD-2-Clause
- centos-stream 10: rdma-core-devel 62.0-3.el10 Β· GPLv2 or BSD
- centos-stream 9: rdma-core-devel 61.0-3.el9 Β· GPLv2 or BSD
- centos-stream 9: rdma-core-devel 61.0-3.el9 Β· GPLv2 or BSD
- ubuntu jammy: libibverbs-dev 39.0-1 Β· BSD-MIT OR GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms