TCP/IP checksum vectorization using AltiVec, Part 1

    Date06 Nov 2004
    4370
    Posted ByAnthony Pell
    This two-part article demonstrates the kinds of performance gains AltiVec can produce on the TCP/IP checksum, or on code similar to it. It gives special attention both to instructions that help improve performance, and to general unrolling and scheduling techniques. The net result? Performance increased by a factor of four. . . . This two-part article demonstrates the kinds of performance gains AltiVec can produce on the TCP/IP checksum, or on code similar to it. It gives special attention both to instructions that help improve performance, and to general unrolling and scheduling techniques. The net result? Performance increased by a factor of four.

    One of the key components in the TCP/IP protocol stack is the checksum computation, which ensures the integrity of the transferred data. This computation can be greatly accelerated with the use of single instruction, multiple data (SIMD) units prevalent in state-of-the-art processors. In particular, the AltiVec unit of the IBM® PowerPC® architecture is well-suited for this type of computation. This article analyzes a former vectorization effort, shows how it can be improved upon, and then enhances it further. For packets of up to 64KB, an average speedup of around 4.0 is obtained. The second part of this series also examines the performance gains obtained by hand coding the algorithm and discusses the issues that must be resolved for it to be autovectorized by the compiler.

    The checksum field is part of the TCP header structure, and when a packet arrives at any final, or intermediate, destination a new checksum is calculated and compared to the checksum field. Any discrepancies indicate that the transferred data has been violated in some way. The checksum field is the 16-bit one's complement of the one's complement sum of all 16-bit words in the header and text. This lends itself to data level parallelization (DLP) that can be supported by the AltiVec unit in the IBM PowerPC processor line.

    You are not authorised to post comments.

    LinuxSecurity Poll

    Has your email account ever been pwned in a data breach?

    No answer selected. Please try again.
    Please select either existing option or enter your own, however not both.
    Please select minimum 0 answer(s) and maximum 2 answer(s).
    /component/communitypolls/?task=poll.vote
    12
    radio
    [{"id":"53","title":"Yes","votes":"8","type":"x","order":"1","pct":88.89,"resources":[]},{"id":"54","title":"No","votes":"1","type":"x","order":"2","pct":11.11,"resources":[]}]["#ff5b00","#4ac0f2","#b80028","#eef66c","#60bb22","#b96a9a","#62c2cc"]["rgba(255,91,0,0.7)","rgba(74,192,242,0.7)","rgba(184,0,40,0.7)","rgba(238,246,108,0.7)","rgba(96,187,34,0.7)","rgba(185,106,154,0.7)","rgba(98,194,204,0.7)"]350
    bottom200

    We use cookies to provide and improve our services. By using our site, you consent to our Cookie Policy.