• Heiko Carstens's avatar
    [S390] Fix TCP/UDP pseudo header checksum computation. · afbc1e99
    Heiko Carstens authored
    git commit f994aae1 changed the
    function declaration of csum_tcpudp_nofold. Argument types were
    changed from unsigned long to __be32 (unsigned int). Therefore we
    lost the implicit type conversion that zeroed the upper half of the
    registers that are used to pass parameters. Since the inline assembly
    relied on this we ended up adding random values and wrong checksums
    were created.
    Showed only up on machines with more than 4GB since gcc produced code
    where the registers that are used to pass 'saddr' and 'daddr' previously
    contained addresses before calling this function.
    Fix this by using 32 bit arithmetics and convert code to C, since gcc
    produces better code than these hand-optimized versions.
    
    Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
    Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
    afbc1e99
checksum.h 4.11 KB