• M
    tcp: Handle eor bit when coalescing skb · a643b5d4
    Martin KaFai Lau 提交于
    This patch:
    1. Prevent next_skb from coalescing to the prev_skb if
       TCP_SKB_CB(prev_skb)->eor is set
    2. Update the TCP_SKB_CB(prev_skb)->eor if coalescing is
       allowed
    
    Packetdrill script for testing:
    ~~~~~~
    +0 `sysctl -q -w net.ipv4.tcp_min_tso_segs=10`
    +0 `sysctl -q -w net.ipv4.tcp_no_metrics_save=1`
    +0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3
    +0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
    +0 bind(3, ..., ...) = 0
    +0 listen(3, 1) = 0
    
    0.100 < S 0:0(0) win 32792 <mss 1460,sackOK,nop,nop,nop,wscale 7>
    0.100 > S. 0:0(0) ack 1 <mss 1460,nop,nop,sackOK,nop,wscale 7>
    0.200 < . 1:1(0) ack 1 win 257
    0.200 accept(3, ..., ...) = 4
    +0 setsockopt(4, SOL_TCP, TCP_NODELAY, [1], 4) = 0
    
    0.200 sendto(4, ..., 730, MSG_EOR, ..., ...) = 730
    0.200 sendto(4, ..., 730, MSG_EOR, ..., ...) = 730
    0.200 write(4, ..., 11680) = 11680
    
    0.200 > P. 1:731(730) ack 1
    0.200 > P. 731:1461(730) ack 1
    0.200 > . 1461:8761(7300) ack 1
    0.200 > P. 8761:13141(4380) ack 1
    
    0.300 < . 1:1(0) ack 1 win 257 <sack 1461:13141,nop,nop>
    0.300 > P. 1:731(730) ack 1
    0.300 > P. 731:1461(730) ack 1
    0.400 < . 1:1(0) ack 13141 win 257
    
    0.400 close(4) = 0
    0.400 > F. 13141:13141(0) ack 1
    0.500 < F. 1:1(0) ack 13142 win 257
    0.500 > . 13142:13142(0) ack 2
    Signed-off-by: NMartin KaFai Lau <kafai@fb.com>
    Cc: Eric Dumazet <edumazet@google.com>
    Cc: Neal Cardwell <ncardwell@google.com>
    Cc: Soheil Hassas Yeganeh <soheil@google.com>
    Cc: Willem de Bruijn <willemb@google.com>
    Cc: Yuchung Cheng <ycheng@google.com>
    Acked-by: NEric Dumazet <edumazet@google.com>
    Acked-by: NSoheil Hassas Yeganeh <soheil@google.com>
    Signed-off-by: NDavid S. Miller <davem@davemloft.net>
    a643b5d4
tcp_input.c 180.4 KB