• E
    tcp: minor optimizations around tcp_hdr() usage · ea1627c2
    Eric Dumazet 提交于
    tcp_hdr() is slightly more expensive than using skb->data in contexts
    where we know they point to the same byte.
    
    In receive path, tcp_v4_rcv() and tcp_v6_rcv() are in this situation,
    as tcp header has not been pulled yet.
    
    In output path, the same can be said when we just pushed the tcp header
    in the skb, in tcp_transmit_skb() and tcp_make_synack()
    
    Also factorize the two checks for tcb->tcp_flags & TCPHDR_SYN in
    tcp_transmit_skb() and pass tcp header pointer to tcp_ecn_send(),
    so that compiler can further optimize and avoid a reload.
    Signed-off-by: NEric Dumazet <edumazet@google.com>
    Signed-off-by: NDavid S. Miller <davem@davemloft.net>
    ea1627c2
tcp_output.c 102.3 KB