• Chuck Lever's avatar
    svcrdma: Clean up RPC-over-RDMA Reply header encoder · 98fc21d3
    Chuck Lever authored
    Replace C structure-based XDR decoding with pointer arithmetic.
    Pointer arithmetic is considered more portable, and is used
    throughout the kernel's existing XDR encoders. The gcc optimizer
    generates similar assembler code either way.
    
    Byte-swapping before a memory store on x86 typically results in an
    instruction pipeline stall. Avoid byte-swapping when encoding a new
    header.
    
    svcrdma currently doesn't alter a connection's credit grant value
    after the connection has been accepted, so it is effectively a
    constant. Cache the byte-swapped value in a separate field.
    
    Christoph suggested pulling the header encoding logic into the only
    function that uses it.
    Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
    Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
    Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
    98fc21d3
svc_rdma_sendto.c 19.4 KB