aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2013-10-10 11:43:00 -0400
committerDavid S. Miller <davem@davemloft.net>2013-10-11 17:48:18 -0400
commitccdbb6e96beca362db876d820ac1e560ff6d9579 (patch)
tree1ced2e6547f027d1417cb408142ce10c4f956754 /net
parent29b67c39dc6e7ec4fdf78c620675de761971cd28 (diff)
tcp: tcp_transmit_skb() optimizations
1) We need to take a timestamp only for skb that should be cloned. Other skbs are not in write queue and no rtt estimation is done on them. 2) the unlikely() hint is wrong for receivers (they send pure ACK) Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: MF Nowlan <fitz@cs.yale.edu> Cc: Yuchung Cheng <ycheng@google.com> Cc: Neal Cardwell <ncardwell@google.com> Acked-By: Yuchung Cheng <ycheng@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/ipv4/tcp_output.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 2822ad021a48..e5ce0e1d13b7 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -850,15 +850,15 @@ static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, int clone_it,
850 850
851 BUG_ON(!skb || !tcp_skb_pcount(skb)); 851 BUG_ON(!skb || !tcp_skb_pcount(skb));
852 852
853 /* If congestion control is doing timestamping, we must 853 if (clone_it) {
854 * take such a timestamp before we potentially clone/copy.
855 */
856 if (icsk->icsk_ca_ops->flags & TCP_CONG_RTT_STAMP)
857 __net_timestamp(skb);
858
859 if (likely(clone_it)) {
860 const struct sk_buff *fclone = skb + 1; 854 const struct sk_buff *fclone = skb + 1;
861 855
856 /* If congestion control is doing timestamping, we must
857 * take such a timestamp before we potentially clone/copy.
858 */
859 if (icsk->icsk_ca_ops->flags & TCP_CONG_RTT_STAMP)
860 __net_timestamp(skb);
861
862 if (unlikely(skb->fclone == SKB_FCLONE_ORIG && 862 if (unlikely(skb->fclone == SKB_FCLONE_ORIG &&
863 fclone->fclone == SKB_FCLONE_CLONE)) 863 fclone->fclone == SKB_FCLONE_CLONE))
864 NET_INC_STATS_BH(sock_net(sk), 864 NET_INC_STATS_BH(sock_net(sk),