From: Krishna Kumar Date: Thu, 10 Dec 2009 07:16:59 +0000 (+0000) Subject: tcp: Slightly optimize tcp_sendmsg X-Git-Tag: v2.6.34-rc1~233^2~717 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=def87cf42069a6d4fd42a2ede8f19c620a292568;p=pandora-kernel.git tcp: Slightly optimize tcp_sendmsg Slightly optimize tcp_sendmsg since NETIF_F_SG is used many times iteratively in the loop. The only other modification is to change: } else if (i == MAX_SKB_FRAGS || (!i && !(sk->sk_route_caps & NETIF_F_SG))) { to: } else if (i == MAX_SKB_FRAGS || !sg) { The reason why this change is correct: this code (other than the MAX_SKB_FRAGS case) executes only due to the else part of: "if (skb_tailroom(skb) > 0) {" - i.e. there was no space in the skb to put the data inline. Hence SG is false is a sufficient condition, and there is no way a fragment can be added to the skb. Changelog: - Added the above explanation for the change Signed-off-by: Krishna Kumar Acked-by: Ilpo Järvinen Signed-off-by: David S. Miller --- Reading git-diff-tree failed