• Chuck Lever's avatar
    svcrdma: Report Write/Reply chunk overruns · 4757d90b
    Chuck Lever authored
    Observed at Connectathon 2017.
    
    If a client has underestimated the size of a Write or Reply chunk,
    the Linux server writes as much payload data as it can, then it
    recognizes there was a problem and closes the connection without
    sending the transport header.
    
    This creates a couple of problems:
    
    <> The client never receives indication of the server-side failure,
       so it continues to retransmit the bad RPC. Forward progress on
       the transport is blocked.
    
    <> The reply payload pages are not moved out of the svc_rqst, thus
       they can be released by the RPC server before the RDMA Writes
       have completed.
    
    The new rdma_rw-ized helpers return a distinct error code when a
    Write/Reply chunk overrun occurs, so it's now easy for the caller
    (svc_rdma_sendto) to recognize this case.
    
    Instead of dropping the connection, post an RDMA_ERROR message. The
    client now sees an RDMA_ERROR and can properly terminate the RPC
    transaction.
    
    As part of the new logic, set up the same delayed release for these
    payload pages as would have occurred in the normal case.
    Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
    Reviewed-by: default avatarSagi Grimberg <sagi@grimberg.me>
    Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
    4757d90b
svc_rdma_sendto.c 21.1 KB