Use Load Multiple to Speed Storage Access for Transmission Control Protocol Check Summing
Original Publication Date: 1997-Feb-01
Included in the Prior Art Database: 2005-Apr-01
Disclosed is a method for a computer program to calculate a check sum from discontiguous segments of the computer storage (memory) by treating the discontiguous segments as if they were one contiguous area and, therefore, not having to move the data.
Use Load Multiple to Speed Storage Access for
Protocol Check Summing
a method for a computer program to calculate a
check sum from discontiguous segments of the computer storage
(memory) by treating the discontiguous segments as if they were one
contiguous area and, therefore, not having to move the data.
disclosure uses System/370* instructions and System/370
Assembler statements for illustrative purposes.
1. A check sum is circular in nature, i.e., the overflow from
bit 0 is added to bit 31. The check sum for odd boundary
segments can be rotated and the proper check sum recovered
at the end by reversing the rotation. This removes the
necessity of moving data to an intermediate area or
performing complex procedures at the segment boundaries.
This part of the disclosure does not apply if (1) the data
is contiguous or (2) each segment is known to be in full
word lengths or (3) the data must be moved to a contiguous
area for another reason.
o Describe the area(s) using a number of
o Rotate the accumulator as the boundary and length of
each area changes.
o Accumulate using a 32-bit check sum (faster) and fold
into the 16-bit check sum required by the transmission
o Macro BPXXCSUM will take any area, any length, any
boundary and produce a checksum (the key points of
this macro are described in the second part of this
xiCSum = CheckSumForHeaders; /* check sum on input *
xiBdy = 0; /* length last segmt */
xiX = 0; /* iov index */
xiShift = 0; /* count SRDLs */
xiAlet = XiovAletStg; /* Alet of storage */
Do While (xiX < XiovCount); /* cycle all IOVs *
xiX = xiX + 1; /* bump IOV index */
xiStgFLen = Iov_Len(xiX); /* length this segmt */
xiStgPtr = Iov_Base(xiX); /* ->this segment */
If (xiBdy ^= 0) Then /* last area odd len */
xiDWlh = xiCSum; /* double word for */
xiDWuh = xiCSum; /* circular shift */
Do Until (xiBdy = 0); /* shift to match */
SLDL (xiDW,8); /* shift left<-1 byte */