1mlx5dv_mkey_check(3)                                      mlx5dv_mkey_check(3)
2
3
4

NAME

6       mlx5dv_mkey_check - Check a MKEY for errors
7

SYNOPSIS

9              #include <infiniband/mlx5dv.h>
10
11              int mlx5dv_mkey_check(struct mlx5dv_mkey *mkey,
12                            struct mlx5dv_mkey_err *err_info);
13

DESCRIPTION

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

ARGUMENTS

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 are
46                     found, only a single error is reported in this  priority:
47                     MLX5DV_MKEY_SIG_BLOCK_BAD_GUARD,
48                     MLX5DV_MKEY_SIG_BLOCK_BAD_APPTAG,
49                     MLX5DV_MKEY_SIG_BLOCK_BAD_REFTAG.
50
51                     MLX5DV_MKEY_NO_ERR
52                            No error is detected for the MKEY.
53
54                     MLX5DV_MKEY_SIG_BLOCK_BAD_GUARD
55                            A signature error was detected in CRC/CHECKSUM for
56                            T10-DIF or CRC32/CRC32C/CRC64_XP10 (depends on the
57                            configured  signature  type).  Additional informa‐
58                            tion  about  the  error  is  provided  in   struct
59                            mlx5dv_sig_err of err.
60
61                     MLX5DV_MKEY_SIG_BLOCK_BAD_REFTAG
62                            A  signature  error  was detected in the reference
63                            tag.  This kind of signature error is relevant for
64                            T10-DIF  only.   Additional  information about the
65                            error is provided in struct mlx5dv_sig_err of err.
66
67                     MLX5DV_MKEY_SIG_BLOCK_BAD_APPTAG
68                            A signature error was detected in the  application
69                            tag.  This kind of signature error is relevant for
70                            T10-DIF only.  Additional  information  about  the
71                            error is provided in struct mlx5dv_sig_err of err.
72
73              err    Information  about  the detected error if err_type is not
74                     MLX5DV_MKEY_NO_ERR.  Otherwise, its value is not defined.
75
76   Signature error
77              struct mlx5dv_sig_err {
78                  uint64_t actual_value;
79                  uint64_t expected_value;
80                  uint64_t offset;
81              };
82
83       actual_value
84              The actual value that was calculated from the transferred data.
85
86       expected_value
87              The expected value based on what appears in  the  signature  re‐
88              spected field.
89
90       offset The  offset  within  the  transfer where the error happened.  In
91              block signature, this is guaranteed to be a block boundary  off‐
92              set.
93

RETURN VALUE

95       0  on  success  or  the  value of errno on failure (which indicates the
96       failure reason).
97

NOTES

99       A DEVX context should be opened by using mlx5dv_open_device(3).
100
101       Checking the MKEY for errors should be done after the application knows
102       the  data  transfer  that was using the MKEY has finished.  Application
103       should wait for the respected completion (if this was a local MKEY)  or
104       wait for a received message from a peer (if this was a remote MKEY).
105

SEE ALSO

107       mlx5dv_wr_mkey_configure(3),           mlx5dv_wr_set_mkey_sig_block(3),
108       mlx5dv_create_mkey(3), mlx5dv_destroy_mkey(3)
109

AUTHORS

111       Oren Duer <oren@nvidia.com>
112
113       Sergey Gorenko <sergeygo@nvidia.com>
114
115
116
117                                                          mlx5dv_mkey_check(3)
Impressum