A101 Checksum Calculation

Calculating checksums for packets is a key aspect of communication via IP networks and takes considerable time. If possible, each architecture should therefore employ manually optimized assembler code to calculate the checksums. The code needed to do this is declared in <asm-arch/checksum.h>. Two functions are of prime importance:

□ unsigned short ip_fast_csum calculates the requisite checksum based on the IP header and the header length.

□ csum_partial calculates the checksum for a packet from the fragments that are received one by one.

Continue reading here: A102 Context Switch

Was this article helpful?

0 0