intel / DML

Intel® Data Mover Library (Intel® DML)
https://intel.github.io/DML/
MIT License
85 stars 17 forks source link

Incorrect handling of CRC #30

Open jposwiata opened 1 year ago

jposwiata commented 1 year ago

In CRC and COPY_WITH_CRC commands it is not allowed to set initial CRC values after PAGE_FAULT with no bytes processed. update_crc_for_continuation() and update_copy_crc_for_continuation() should include the conditon:

if (crc_record.bytes_completed() != 0) {
    crc_dsc.crc_seed() = crc_record.crc_value();
}
abdelrahim-hentabli commented 11 months ago

Hey @jposwiata, crc_record.crc_value() would be initialized with the crc_seed, even in the case of crc_record.bytes_completed() == 0.

So in the case of crc_record.bytes_completed() == 0 the line crc_dsc.crc_seed() = crc_record.crc_value(); would be equivalent to crc_dsc.crc_seed() = crc_dsc.crc_seed();

jposwiata commented 11 months ago

the documentation says: if Bytes Completed is 0, the CRC Value in the completion record is undefined and software should reuse the CRC Seed or CRC Seed Address from the descriptor.

According our experiments "output" CRC is in most cases zeroed.