• Erik Hugne's avatar
    tipc: prevent dropped connections due to rcvbuf overflow · e57edf6b
    Erik Hugne authored
    When large buffers are sent over connected TIPC sockets, it
    is likely that the sk_backlog will be filled up on the
    receiver side, but the TIPC flow control mechanism is happily
    unaware of this since that is based on message count.
    
    The sender will receive a TIPC_ERR_OVERLOAD message when this occurs
    and drop it's side of the connection, leaving it stale on
    the receiver end.
    
    By increasing the sk_rcvbuf to a 'worst case' value, we avoid the
    overload caused by a full backlog queue and the flow control
    will work properly.
    
    This worst case value is the max TIPC message size times
    the flow control window, multiplied by two because a sender
    will transmit up to double the window size before a port is marked
    congested.
    We multiply this by 2 to account for the sk_buff and other overheads.
    Signed-off-by: default avatarErik Hugne <erik.hugne@ericsson.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    e57edf6b
socket.c 45.9 KB