Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ccdbb6e9 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller
Browse files

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: default avatarEric 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: default avatarYuchung Cheng <ycheng@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 29b67c39
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -850,15 +850,15 @@ static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, int clone_it,

	BUG_ON(!skb || !tcp_skb_pcount(skb));

	if (clone_it) {
		const struct sk_buff *fclone = skb + 1;

		/* If congestion control is doing timestamping, we must
		 * take such a timestamp before we potentially clone/copy.
		 */
		if (icsk->icsk_ca_ops->flags & TCP_CONG_RTT_STAMP)
			__net_timestamp(skb);

	if (likely(clone_it)) {
		const struct sk_buff *fclone = skb + 1;

		if (unlikely(skb->fclone == SKB_FCLONE_ORIG &&
			     fclone->fclone == SKB_FCLONE_CLONE))
			NET_INC_STATS_BH(sock_net(sk),