1mlx5dv_mkey_check(3) mlx5dv_mkey_check(3)
2
3
4
6 mlx5dv_mkey_check - Check a MKEY for errors
7
9 #include <infiniband/mlx5dv.h>
10
11 int mlx5dv_mkey_check(struct mlx5dv_mkey *mkey,
12 struct mlx5dv_mkey_err *err_info);
13
15 Checks mkey for errors and provides the result in err_info on success.
16
17 This should be called after using a MKEY configured with signature val‐
18 idation in a transfer operation. While the transfer operation itself
19 may be completed successfully (i.e. no transport related errors oc‐
20 curred), there still may be errors related to the integrity of the da‐
21 ta. The first of these errors is reported to the MKEY and kept there
22 until application software queries it by calling this API.
23
24 The type of error indicates which part of the signature was bad (guard,
25 reftag or apptag). Also provided is the actual calculated value based
26 on the transferred data, and the expected value based on the signature
27 fields. Last part provided is the offset in the transfer that caused
28 the error.
29
31 mkey The MKEY to check for errors.
32
33 err_info
34 The result of the MKEY check, information about the errors de‐
35 tected, if any.
36
37 struct mlx5dv_mkey_err {
38 enum mlx5dv_mkey_err_type err_type;
39 union {
40 struct mlx5dv_sig_err sig;
41 } err;
42 };
43
44 err_type
45 What kind of error happened. If several errors exist in
46 one block verified by the device, only the first of them
47 is reported, according to the order specified in T10DIF
48 specification, which is: MLX5DV_MKEY_SIG_BLOCK_BAD_GUARD,
49 MLX5DV_MKEY_SIG_BLOCK_BAD_APPTAG,
50 MLX5DV_MKEY_SIG_BLOCK_BAD_REFTAG.
51
52 MLX5DV_MKEY_NO_ERR
53 No error is detected for the MKEY.
54
55 MLX5DV_MKEY_SIG_BLOCK_BAD_GUARD
56 A signature error was detected in CRC/CHECKSUM for
57 T10-DIF or CRC32/CRC32C/CRC64_XP10 (depends on the
58 configured signature type). Additional informa‐
59 tion about the error is provided in struct
60 mlx5dv_sig_err of err.
61
62 MLX5DV_MKEY_SIG_BLOCK_BAD_REFTAG
63 A signature error was detected in the reference
64 tag. This kind of signature error is relevant for
65 T10-DIF only. Additional information about the
66 error is provided in struct mlx5dv_sig_err of err.
67
68 MLX5DV_MKEY_SIG_BLOCK_BAD_APPTAG
69 A signature error was detected in the application
70 tag. This kind of signature error is relevant for
71 T10-DIF only. Additional information about the
72 error is provided in struct mlx5dv_sig_err of err.
73
74 err Information about the detected error if err_type is not
75 MLX5DV_MKEY_NO_ERR. Otherwise, its value is not defined.
76
77 Signature error
78 struct mlx5dv_sig_err {
79 uint64_t actual_value;
80 uint64_t expected_value;
81 uint64_t offset;
82 };
83
84 actual_value
85 The actual value that was calculated from the transferred data.
86
87 expected_value
88 The expected value based on what appears in the signature re‐
89 spected field.
90
91 offset The offset within the transfer where the error happened. In
92 block signature, this is guaranteed to be a block boundary off‐
93 set.
94
96 0 on success or the value of errno on failure (which indicates the
97 failure reason).
98
100 A DEVX context should be opened by using mlx5dv_open_device(3).
101
102 Checking the MKEY for errors should be done after the application knows
103 the data transfer that was using the MKEY has finished. Application
104 should wait for the respected completion (if this was a local MKEY) or
105 wait for a received message from a peer (if this was a remote MKEY).
106
108 mlx5dv_wr_mkey_configure(3), mlx5dv_wr_set_mkey_sig_block(3),
109 mlx5dv_create_mkey(3), mlx5dv_destroy_mkey(3)
110
112 Oren Duer <oren@nvidia.com>
113
114 Sergey Gorenko <sergeygo@nvidia.com>
115
116
117
118 mlx5dv_mkey_check(3)