aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_output.c
diff options
context:
space:
mode:
authorTom Herbert <therbert@google.com>2010-04-22 03:00:24 -0400
committerDavid S. Miller <davem@davemloft.net>2010-04-22 19:00:00 -0400
commitaa2ea0586d9dbe56a334d835a43b45e8c2104e77 (patch)
tree1f218166bff8513858ac253e84264a4a8fe9ff0d /net/ipv4/tcp_output.c
parent3cfa856d6d43894ebffdc28d2f0587595280893b (diff)
tcp: fix outsegs stat for TSO segments
Account for TSO segments of an skb in TCP_MIB_OUTSEGS counter. Without doing this, the counter can be off by orders of magnitude from the actual number of segments sent. Signed-off-by: Tom Herbert <therbert@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_output.c')
-rw-r--r--net/ipv4/tcp_output.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 429ad9286efc..5db3a2c6cb33 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -888,7 +888,8 @@ static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, int clone_it,
888 tcp_event_data_sent(tp, skb, sk); 888 tcp_event_data_sent(tp, skb, sk);
889 889
890 if (after(tcb->end_seq, tp->snd_nxt) || tcb->seq == tcb->end_seq) 890 if (after(tcb->end_seq, tp->snd_nxt) || tcb->seq == tcb->end_seq)
891 TCP_INC_STATS(sock_net(sk), TCP_MIB_OUTSEGS); 891 TCP_ADD_STATS(sock_net(sk), TCP_MIB_OUTSEGS,
892 tcp_skb_pcount(skb));
892 893
893 err = icsk->icsk_af_ops->queue_xmit(skb); 894 err = icsk->icsk_af_ops->queue_xmit(skb);
894 if (likely(err <= 0)) 895 if (likely(err <= 0))
@@ -2503,7 +2504,7 @@ struct sk_buff *tcp_make_synack(struct sock *sk, struct dst_entry *dst,
2503 th->window = htons(min(req->rcv_wnd, 65535U)); 2504 th->window = htons(min(req->rcv_wnd, 65535U));
2504 tcp_options_write((__be32 *)(th + 1), tp, &opts); 2505 tcp_options_write((__be32 *)(th + 1), tp, &opts);
2505 th->doff = (tcp_header_size >> 2); 2506 th->doff = (tcp_header_size >> 2);
2506 TCP_INC_STATS(sock_net(sk), TCP_MIB_OUTSEGS); 2507 TCP_ADD_STATS(sock_net(sk), TCP_MIB_OUTSEGS, tcp_skb_pcount(skb));
2507 2508
2508#ifdef CONFIG_TCP_MD5SIG 2509#ifdef CONFIG_TCP_MD5SIG
2509 /* Okay, we have all we need - do the md5 hash if needed */ 2510 /* Okay, we have all we need - do the md5 hash if needed */