netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wei Yongjun <yjwei@nanjing-fnst.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] SNMPv2 tcpOutSegs counter error
Date: Thu, 03 Aug 2006 11:46:58 -0400	[thread overview]
Message-ID: <1154620019.9095.5.camel@LINE> (raw)

I modified my patch by add a flag to sacked when retransmit, and it work
well.


On Monday 24 July 2006 17:44, David Miller wrote:
> From: Wei Yongjun <yjwei@nanjing-fnst.com>
> Date: Thu, 06 Jul 2006 04:01:18 -0400
>
> This test is not accurate enough.  For example, timer based
> retransmits will not set the TCPCB_LOST bit.
>
> I'm tempted to say to pass a flag to tcp_transmit_skb()
> which says whether it is a retransmit or not, but that
> function already takes way too many arguments.

Signed-off-by: Wei Yongjun <yjwei@nanjing-fnst.com>

--- a/include/net/tcp.h	2006-07-28 16:19:14.000000000 -0400
+++ b/include/net/tcp.h	2006-08-03 17:56:35.686158424 -0400
@@ -550,6 +550,8 @@ struct tcp_skb_cb {
 
 #define TCPCB_URG		0x20	/* Urgent pointer advanced here	*/
 
+#define TCPCB_TRANS		0x40
+
 #define TCPCB_AT_TAIL		(TCPCB_URG)
 
 	__u16		urg_ptr;	/* Valid w/URG flags is set.	*/
 
--- a/net/ipv4/tcp_output.c	2006-08-03 18:05:22.425081936 -0400
+++ b/net/ipv4/tcp_output.c	2006-08-03 17:59:16.462716672 -0400
@@ -462,7 +462,8 @@ static int tcp_transmit_skb(struct sock 
 	if (skb->len != tcp_header_size)
 		tcp_event_data_sent(tp, skb, sk);
 
-	TCP_INC_STATS(TCP_MIB_OUTSEGS);
+	if(!(tcb->sacked & TCPCB_TRANS))
+		TCP_INC_STATS(TCP_MIB_OUTSEGS);
 
 	err = icsk->icsk_af_ops->queue_xmit(skb, 0);
 	if (likely(err <= 0))
@@ -1732,6 +1733,8 @@ int tcp_retransmit_skb(struct sock *sk, 
 	 */
 	TCP_SKB_CB(skb)->when = tcp_time_stamp;
 
+	TCP_SKB_CB(skb)->sacked |= TCPCB_TRANS;
+
 	err = tcp_transmit_skb(sk, skb, 1, GFP_ATOMIC);
 
 	if (err == 0) {



             reply	other threads:[~2006-08-03 11:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-03 15:46 Wei Yongjun [this message]
2006-08-03 23:35 ` [PATCH] SNMPv2 tcpOutSegs counter error David Miller
  -- strict thread matches above, loose matches on Subject: below --
2006-08-07  8:45 Wei Yongjun
2006-08-08  4:04 ` David Miller
2006-08-07  3:17 Wei Yongjun
2006-08-07  2:40 ` Herbert Xu
2006-08-07  2:44   ` David Miller
2006-08-07  2:48     ` Herbert Xu
2006-08-04 12:46 Wei Yongjun
2006-08-04 11:23 ` David Miller
2006-07-06  8:01 Wei Yongjun
2006-07-24 21:44 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1154620019.9095.5.camel@LINE \
    --to=yjwei@nanjing-fnst.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).