All of lore.kernel.org
 help / color / mirror / Atom feed
* TcpOutSegs way too optimistic (netstat -s)
@ 2004-05-14 22:11 Marc Herbert
  2004-05-14 22:31 ` Marc Herbert
  0 siblings, 1 reply; 4+ messages in thread
From: Marc Herbert @ 2004-05-14 22:11 UTC (permalink / raw)
  To: netdev


TcpOutSegs is currently incremented even when
"tp->af_specific->queue_xmit(skb, 0)" fails (think about a full qdisc
for instance).

See fix below.



===== net/ipv4/tcp_output.c 1.19 vs edited =====
--- 1.19/net/ipv4/tcp_output.c	Fri May 14 22:32:18 2004
+++ edited/net/ipv4/tcp_output.c	Fri May 14 23:19:37 2004
@@ -276,13 +276,7 @@
 		if (skb->len != tcp_header_size)
 			tcp_event_data_sent(tp, skb, sk);

-		TCP_INC_STATS(TcpOutSegs);
-
 		err = tp->af_specific->queue_xmit(skb, 0);
-		if (err <= 0)
-			return err;
-
-		tcp_enter_cwr(tp);

 		/* NET_XMIT_CN is special. It does not guarantee,
 		 * that this packet is lost. It tells that device
@@ -290,7 +284,15 @@
 		 * drops some packets of the same priority and
 		 * invokes us to send less aggressively.
 		 */
-		return err == NET_XMIT_CN ? 0 : err;
+		if(err == NET_XMIT_CN)
+			err = 0;
+		if (!err)
+			TCP_INC_STATS(TcpOutSegs);
+
+		if (err > 0)
+			tcp_enter_cwr(tp);
+
+		return err;
 	}
 	return -ENOBUFS;
 #undef SYSCTL_FLAG_TSTAMPS

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-05-15  0:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-14 22:11 TcpOutSegs way too optimistic (netstat -s) Marc Herbert
2004-05-14 22:31 ` Marc Herbert
2004-05-14 22:51   ` Nivedita Singhvi
2004-05-15  0:51     ` Marc Herbert

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.