Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-1025

Lustre crc32c implementation not use final bit inversion

Details

    • Improvement
    • Resolution: Fixed
    • Blocker
    • Lustre 2.2.0
    • Lustre 2.2.0
    • None
    • 4747

    Description

      LU-241 add crc32c crypto hash algorithm to ost(osc) checksum. But this implementation differ from base crc32c at linux kernel(intel implementation on crc32 instruction and table crc32c implementation) at final bit inversion.

      Attachments

        Issue Links

          Activity

            [LU-1025] Lustre crc32c implementation not use final bit inversion

            Integrated in lustre-master » x86_64,client,el5,inkernel #459
            LU-1025 checksum: add final bit inversion for crc32c (Revision 864516e29129cb209435b4cc3ba513a9f453d383)

            Result = SUCCESS
            Oleg Drokin : 864516e29129cb209435b4cc3ba513a9f453d383
            Files :

            • lustre/include/obd_cksum.h
            • lustre/osc/osc_request.c
            • lustre/ost/ost_handler.c
            hudson Build Master (Inactive) added a comment - Integrated in lustre-master » x86_64,client,el5,inkernel #459 LU-1025 checksum: add final bit inversion for crc32c (Revision 864516e29129cb209435b4cc3ba513a9f453d383) Result = SUCCESS Oleg Drokin : 864516e29129cb209435b4cc3ba513a9f453d383 Files : lustre/include/obd_cksum.h lustre/osc/osc_request.c lustre/ost/ost_handler.c

            Integrated in lustre-master » x86_64,client,el5,ofa #459
            LU-1025 checksum: add final bit inversion for crc32c (Revision 864516e29129cb209435b4cc3ba513a9f453d383)

            Result = SUCCESS
            Oleg Drokin : 864516e29129cb209435b4cc3ba513a9f453d383
            Files :

            • lustre/ost/ost_handler.c
            • lustre/include/obd_cksum.h
            • lustre/osc/osc_request.c
            hudson Build Master (Inactive) added a comment - Integrated in lustre-master » x86_64,client,el5,ofa #459 LU-1025 checksum: add final bit inversion for crc32c (Revision 864516e29129cb209435b4cc3ba513a9f453d383) Result = SUCCESS Oleg Drokin : 864516e29129cb209435b4cc3ba513a9f453d383 Files : lustre/ost/ost_handler.c lustre/include/obd_cksum.h lustre/osc/osc_request.c
            pjones Peter Jones added a comment -

            Landed for 2.2

            pjones Peter Jones added a comment - Landed for 2.2
            pjones Peter Jones added a comment -

            Thanks Alex!

            pjones Peter Jones added a comment - Thanks Alex!

            done

            aboyko Alexander Boyko added a comment - done
            pjones Peter Jones added a comment -

            Alex

            Could you please rebase your patch on the tip of master? The landing of the fix for LU1048 should have now addressed the reason behind the autotest failure.

            Thanks

            Peter

            pjones Peter Jones added a comment - Alex Could you please rebase your patch on the tip of master? The landing of the fix for LU1048 should have now addressed the reason behind the autotest failure. Thanks Peter
            pjones Peter Jones added a comment -

            Thanks!

            pjones Peter Jones added a comment - Thanks!
            aboyko Alexander Boyko added a comment - patch submitted to http://review.whamcloud.com/2018
            pjones Peter Jones added a comment -

            Alexander

            I appreciate that this is a simple tweak to the existing code, but it would still expedite us reviewing and landing the correction if you could upload it into gerrit.

            Thanks

            Peter

            pjones Peter Jones added a comment - Alexander I appreciate that this is a simple tweak to the existing code, but it would still expedite us reviewing and landing the correction if you could upload it into gerrit. Thanks Peter
            aboyko Alexander Boyko added a comment - - edited

            Sure, the kernel implementation example is below.

            crc = crc32c(~0, part1, len1);
            crc = crc32c(crc, part2, len2);
            crc = crc32c(crc, part3, len3);
            crc = ~crc;
            

            Lustre implementation doesn`t do crc = ~crc. Simple fix is to add fini_cksum(cksum, cksum_type) at obd_cksum.h and call it after cksum calculation loop at osc_request.c and ost_handler.c.

            u32 fini_cksum(cksum, cksum_type)
            {
               if (cksum_type == OBD_CKSUM_CRC32C)
                     return ~cksum;
               return cksum;
            }
            
            aboyko Alexander Boyko added a comment - - edited Sure, the kernel implementation example is below. crc = crc32c(~0, part1, len1); crc = crc32c(crc, part2, len2); crc = crc32c(crc, part3, len3); crc = ~crc; Lustre implementation doesn`t do crc = ~crc. Simple fix is to add fini_cksum(cksum, cksum_type) at obd_cksum.h and call it after cksum calculation loop at osc_request.c and ost_handler.c. u32 fini_cksum(cksum, cksum_type) { if (cksum_type == OBD_CKSUM_CRC32C) return ~cksum; return cksum; }

            Alexander,
            thanks for the bug report. Fortunately, since the CRC32C feature was landed after the 2.1.0 release, there is still time to fix this before 2.2.0 is released.

            Can you please describe the difference in the implementation in more detail. Are you planning to submit a patch?

            adilger Andreas Dilger added a comment - Alexander, thanks for the bug report. Fortunately, since the CRC32C feature was landed after the 2.1.0 release, there is still time to fix this before 2.2.0 is released. Can you please describe the difference in the implementation in more detail. Are you planning to submit a patch?

            People

              adilger Andreas Dilger
              aboyko Alexander Boyko
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: