~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/rdma/signature.h

Version: ~ [ linux-5.19-rc8 ] ~ [ linux-5.18.14 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.57 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.133 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.207 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.253 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.289 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.324 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.302 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: (GPL-2.0 OR Linux-OpenIB) */
  2 /*
  3  * Copyright (c) 2017-2018 Mellanox Technologies. All rights reserved.
  4  */
  5 
  6 #ifndef _RDMA_SIGNATURE_H_
  7 #define _RDMA_SIGNATURE_H_
  8 
  9 #include <linux/types.h>
 10 
 11 enum ib_signature_prot_cap {
 12         IB_PROT_T10DIF_TYPE_1 = 1,
 13         IB_PROT_T10DIF_TYPE_2 = 1 << 1,
 14         IB_PROT_T10DIF_TYPE_3 = 1 << 2,
 15 };
 16 
 17 enum ib_signature_guard_cap {
 18         IB_GUARD_T10DIF_CRC     = 1,
 19         IB_GUARD_T10DIF_CSUM    = 1 << 1,
 20 };
 21 
 22 /**
 23  * enum ib_signature_type - Signature types
 24  * @IB_SIG_TYPE_NONE: Unprotected.
 25  * @IB_SIG_TYPE_T10_DIF: Type T10-DIF
 26  */
 27 enum ib_signature_type {
 28         IB_SIG_TYPE_NONE,
 29         IB_SIG_TYPE_T10_DIF,
 30 };
 31 
 32 /**
 33  * enum ib_t10_dif_bg_type - Signature T10-DIF block-guard types
 34  * @IB_T10DIF_CRC: Corresponds to T10-PI mandated CRC checksum rules.
 35  * @IB_T10DIF_CSUM: Corresponds to IP checksum rules.
 36  */
 37 enum ib_t10_dif_bg_type {
 38         IB_T10DIF_CRC,
 39         IB_T10DIF_CSUM,
 40 };
 41 
 42 /**
 43  * struct ib_t10_dif_domain - Parameters specific for T10-DIF
 44  *     domain.
 45  * @bg_type: T10-DIF block guard type (CRC|CSUM)
 46  * @pi_interval: protection information interval.
 47  * @bg: seed of guard computation.
 48  * @app_tag: application tag of guard block
 49  * @ref_tag: initial guard block reference tag.
 50  * @ref_remap: Indicate wethear the reftag increments each block
 51  * @app_escape: Indicate to skip block check if apptag=0xffff
 52  * @ref_escape: Indicate to skip block check if reftag=0xffffffff
 53  * @apptag_check_mask: check bitmask of application tag.
 54  */
 55 struct ib_t10_dif_domain {
 56         enum ib_t10_dif_bg_type bg_type;
 57         u16                     pi_interval;
 58         u16                     bg;
 59         u16                     app_tag;
 60         u32                     ref_tag;
 61         bool                    ref_remap;
 62         bool                    app_escape;
 63         bool                    ref_escape;
 64         u16                     apptag_check_mask;
 65 };
 66 
 67 /**
 68  * struct ib_sig_domain - Parameters for signature domain
 69  * @sig_type: specific signauture type
 70  * @sig: union of all signature domain attributes that may
 71  *     be used to set domain layout.
 72  */
 73 struct ib_sig_domain {
 74         enum ib_signature_type sig_type;
 75         union {
 76                 struct ib_t10_dif_domain dif;
 77         } sig;
 78 };
 79 
 80 /**
 81  * struct ib_sig_attrs - Parameters for signature handover operation
 82  * @check_mask: bitmask for signature byte check (8 bytes)
 83  * @mem: memory domain layout descriptor.
 84  * @wire: wire domain layout descriptor.
 85  * @meta_length: metadata length
 86  */
 87 struct ib_sig_attrs {
 88         u8                      check_mask;
 89         struct ib_sig_domain    mem;
 90         struct ib_sig_domain    wire;
 91         int                     meta_length;
 92 };
 93 
 94 enum ib_sig_err_type {
 95         IB_SIG_BAD_GUARD,
 96         IB_SIG_BAD_REFTAG,
 97         IB_SIG_BAD_APPTAG,
 98 };
 99 
100 /*
101  * Signature check masks (8 bytes in total) according to the T10-PI standard:
102  *  -------- -------- ------------
103  * | GUARD  | APPTAG |   REFTAG   |
104  * |  2B    |  2B    |    4B      |
105  *  -------- -------- ------------
106  */
107 enum {
108         IB_SIG_CHECK_GUARD = 0xc0,
109         IB_SIG_CHECK_APPTAG = 0x30,
110         IB_SIG_CHECK_REFTAG = 0x0f,
111 };
112 
113 /*
114  * struct ib_sig_err - signature error descriptor
115  */
116 struct ib_sig_err {
117         enum ib_sig_err_type    err_type;
118         u32                     expected;
119         u32                     actual;
120         u64                     sig_err_offset;
121         u32                     key;
122 };
123 
124 #endif /* _RDMA_SIGNATURE_H_ */
125 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp