Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\crc32test.c Create Date:2022-07-28 06:55:57
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:crc32_test

Proto:static int __init crc32_test(void)

Type:int

Parameter:Nothing

749  errors = 0
750  bytes = 0
759  When i < 100 cycle
760  bytes += 2 * andom 11 bit length of test
762  crc ^= crc32_le(andom starting crc , 4096 random bytes + andom 6 bit offset in buf , andom 11 bit length of test )
765  crc ^= crc32_be(andom starting crc , 4096 random bytes + andom 6 bit offset in buf , andom 11 bit length of test )
770  local_irq_save(flags)
771  local_irq_disable()
773  nsec = ktime_get_ns()
774  When i < 100 cycle
775  If xpected crc32_le result != crc32_le(andom starting crc , 4096 random bytes + andom 6 bit offset in buf , andom 11 bit length of test ) Then errors++
779  If xpected crc32_be result != crc32_be(andom starting crc , 4096 random bytes + andom 6 bit offset in buf , andom 11 bit length of test ) Then errors++
783  nsec = ktime_get_ns() - nsec
785  local_irq_restore(flags)
786  The local_irq_*() APIs are equal to the raw_local_irq*()* if !TRACE_IRQFLAGS.()
788  pr_info("crc32: CRC_LE_BITS = %d, CRC_BE BITS = %d\n", CRC_LE_BITS, CRC_BE_BITS)
791  If errors Then pr_warn("crc32: %d self tests failed\n", errors)
793  Else
794  pr_info("crc32: self tests passed, processed %d bytes in %lld nsec\n", bytes, nsec)
798  Return 0
Caller
NameDescribe
crc32test_init