Lines Matching full:dif

16 #include "dif.h"
80 NvmeDifTuple *dif = (NvmeDifTuple *)(mbuf + pil); in nvme_dif_pract_generate_dif_crc16() local
87 dif->g16.guard = cpu_to_be16(crc); in nvme_dif_pract_generate_dif_crc16()
88 dif->g16.apptag = cpu_to_be16(apptag); in nvme_dif_pract_generate_dif_crc16()
89 dif->g16.reftag = cpu_to_be32(*reftag); in nvme_dif_pract_generate_dif_crc16()
114 NvmeDifTuple *dif = (NvmeDifTuple *)(mbuf + pil); in nvme_dif_pract_generate_dif_crc64() local
121 dif->g64.guard = cpu_to_be64(crc); in nvme_dif_pract_generate_dif_crc64()
122 dif->g64.apptag = cpu_to_be16(apptag); in nvme_dif_pract_generate_dif_crc64()
124 dif->g64.sr[0] = *reftag >> 40; in nvme_dif_pract_generate_dif_crc64()
125 dif->g64.sr[1] = *reftag >> 32; in nvme_dif_pract_generate_dif_crc64()
126 dif->g64.sr[2] = *reftag >> 24; in nvme_dif_pract_generate_dif_crc64()
127 dif->g64.sr[3] = *reftag >> 16; in nvme_dif_pract_generate_dif_crc64()
128 dif->g64.sr[4] = *reftag >> 8; in nvme_dif_pract_generate_dif_crc64()
129 dif->g64.sr[5] = *reftag; in nvme_dif_pract_generate_dif_crc64()
153 static uint16_t nvme_dif_prchk_crc16(NvmeNamespace *ns, NvmeDifTuple *dif, in nvme_dif_prchk_crc16() argument
160 if (be32_to_cpu(dif->g16.reftag) != 0xffffffff) { in nvme_dif_prchk_crc16()
167 if (be16_to_cpu(dif->g16.apptag) != 0xffff) { in nvme_dif_prchk_crc16()
171 trace_pci_nvme_dif_prchk_disabled_crc16(be16_to_cpu(dif->g16.apptag), in nvme_dif_prchk_crc16()
172 be32_to_cpu(dif->g16.reftag)); in nvme_dif_prchk_crc16()
184 trace_pci_nvme_dif_prchk_guard_crc16(be16_to_cpu(dif->g16.guard), crc); in nvme_dif_prchk_crc16()
186 if (be16_to_cpu(dif->g16.guard) != crc) { in nvme_dif_prchk_crc16()
192 trace_pci_nvme_dif_prchk_apptag(be16_to_cpu(dif->g16.apptag), apptag, in nvme_dif_prchk_crc16()
195 if ((be16_to_cpu(dif->g16.apptag) & appmask) != (apptag & appmask)) { in nvme_dif_prchk_crc16()
201 trace_pci_nvme_dif_prchk_reftag_crc16(be32_to_cpu(dif->g16.reftag), in nvme_dif_prchk_crc16()
204 if (be32_to_cpu(dif->g16.reftag) != reftag) { in nvme_dif_prchk_crc16()
212 static uint16_t nvme_dif_prchk_crc64(NvmeNamespace *ns, NvmeDifTuple *dif, in nvme_dif_prchk_crc64() argument
219 r |= (uint64_t)dif->g64.sr[0] << 40; in nvme_dif_prchk_crc64()
220 r |= (uint64_t)dif->g64.sr[1] << 32; in nvme_dif_prchk_crc64()
221 r |= (uint64_t)dif->g64.sr[2] << 24; in nvme_dif_prchk_crc64()
222 r |= (uint64_t)dif->g64.sr[3] << 16; in nvme_dif_prchk_crc64()
223 r |= (uint64_t)dif->g64.sr[4] << 8; in nvme_dif_prchk_crc64()
224 r |= (uint64_t)dif->g64.sr[5]; in nvme_dif_prchk_crc64()
235 if (be16_to_cpu(dif->g64.apptag) != 0xffff) { in nvme_dif_prchk_crc64()
239 trace_pci_nvme_dif_prchk_disabled_crc64(be16_to_cpu(dif->g16.apptag), in nvme_dif_prchk_crc64()
252 trace_pci_nvme_dif_prchk_guard_crc64(be64_to_cpu(dif->g64.guard), crc); in nvme_dif_prchk_crc64()
254 if (be64_to_cpu(dif->g64.guard) != crc) { in nvme_dif_prchk_crc64()
260 trace_pci_nvme_dif_prchk_apptag(be16_to_cpu(dif->g64.apptag), apptag, in nvme_dif_prchk_crc64()
263 if ((be16_to_cpu(dif->g64.apptag) & appmask) != (apptag & appmask)) { in nvme_dif_prchk_crc64()
279 static uint16_t nvme_dif_prchk(NvmeNamespace *ns, NvmeDifTuple *dif, in nvme_dif_prchk() argument
286 return nvme_dif_prchk_crc16(ns, dif, buf, mbuf, pil, prinfo, apptag, in nvme_dif_prchk()
289 return nvme_dif_prchk_crc64(ns, dif, buf, mbuf, pil, prinfo, apptag, in nvme_dif_prchk()
317 NvmeDifTuple *dif = (NvmeDifTuple *)(mbuf + pil); in nvme_dif_check() local
318 status = nvme_dif_prchk(ns, dif, bufp, mbuf, pil, prinfo, apptag, in nvme_dif_check()
593 NvmeDifTuple *dif = (NvmeDifTuple *)(mbuf + pil); in nvme_dif_rw() local
597 dif->g16.apptag = cpu_to_be16(apptag); in nvme_dif_rw()
598 dif->g16.reftag = cpu_to_be32(reftag); in nvme_dif_rw()
603 dif->g64.guard = cpu_to_be64(0x6482d367eb22b64e); in nvme_dif_rw()
604 dif->g64.apptag = cpu_to_be16(apptag); in nvme_dif_rw()
606 dif->g64.sr[0] = reftag >> 40; in nvme_dif_rw()
607 dif->g64.sr[1] = reftag >> 32; in nvme_dif_rw()
608 dif->g64.sr[2] = reftag >> 24; in nvme_dif_rw()
609 dif->g64.sr[3] = reftag >> 16; in nvme_dif_rw()
610 dif->g64.sr[4] = reftag >> 8; in nvme_dif_rw()
611 dif->g64.sr[5] = reftag; in nvme_dif_rw()