• Paolo Abeni's avatar
    mptcp: rework mptcp_sendmsg_frag to accept optional dfrag · 3f8e0aae
    Paolo Abeni authored
    This will simplify mptcp-level retransmission implementation
    in the next patch. If dfrag is provided by the caller, skip
    kernel space memory allocation and use data and metadata
    provided by the dfrag itself.
    
    Because a peer could ack data at TCP level but refrain from
    sending mptcp-level ACKs, we could grow the mptcp socket
    backlog indefinitely.
    
    We should thus block mptcp_sendmsg until the peer has acked some of the
    sent data.
    
    In order to be able to do so, increment the mptcp socket wmem_queued
    counter on memory allocation and decrement it when releasing the memory
    on mptcp-level ack reception.
    
    Because TCP performns sndbuf auto-tuning up to tcp_wmem_max[2], make
    this the mptcp sk_sndbuf limit.
    
    In the future we could add experiment with autotuning as TCP does in
    tcp_sndbuf_expand().
    
    v2 -> v3:
     - remove 'inline' in foo.c files (David S. Miller)
    Co-developed-by: default avatarFlorian Westphal <fw@strlen.de>
    Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
    Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
    Signed-off-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    3f8e0aae
protocol.c 42.9 KB