All of lore.kernel.org
 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: Fri, 04 Aug 2006 08:46:13 -0400	[thread overview]
Message-ID: <1154695575.8425.16.camel@LINE> (raw)

This always correct except when do active open in tcp client, which will
send a SYN, that segment will not be counted, even if it is not
restrained. Maybe I can do following to fix this:

int tcp_connect(struct sock *sk)
...
+	tp->snd_nxt = tp->write_seq;
	TCP_SKB_CB(buff)->seq = tp->write_seq++;
	TCP_SKB_CB(buff)->end_seq = tp->write_seq;
-	tp->snd_nxt = tp->write_seq;
-	tp->pushed_seq = tp->write_seq;

	tcp_transmit_skb(sk, buff, 1, GFP_KERNEL);
+	tp->snd_nxt = tp->write_seq;
+	tp->pushed_seq = tp->write_seq;
	TCP_INC_STATS(TCP_MIB_ACTIVEOPENS);

Do you agree with me? If It is correctly, I will send this patch soon.

On Thursday 03 August 2006 19:35, David Miller wrote:
> From: Wei Yongjun <yjwei@nanjing-fnst.com>
> Date: Thu, 03 Aug 2006 11:46:58 -0400
>
> > I modified my patch by add a flag to sacked when retransmit, and it
> > work well.
>
> This is the most timing critical code path of the TCP stack output
> packet processing, and you're adding a read-modify-write operation
> just to get some statistics correct.
>
> Let's look for a cheaper test, perhaps something like:
>
>  if (!before(TCP_SKB_CB(skb)->seq, tp->snd_nxt))
>   TCP_INC_STATS(TCP_MIB_OUTSEGS);
>
> Would that work?
>
> It should, because tp->snd_nxt always advances on new data
> via update_send_head().
> -
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



             reply	other threads:[~2006-08-04 10:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-04 12:46 Wei Yongjun [this message]
2006-08-04 11:23 ` [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-03 15:46 Wei Yongjun
2006-08-03 23:35 ` 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=1154695575.8425.16.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 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.