netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Eric Barton" <eeb@bartonsoftware.com>
To: <netdev@oss.sgi.com>
Subject: tcp retransmission
Date: Tue, 21 Dec 2004 19:08:33 -0000	[thread overview]
Message-ID: <005d01c4e790$78030ff0$0281a8c0@ebpc> (raw)

Hi,

Can someone please help me understand this code in tcp_output.c...

int tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb)
{
	struct tcp_opt *tp = tcp_sk(sk);
 	unsigned int cur_mss = tcp_current_mss(sk, 0);
	int err;

	/* Do not sent more than we queued. 1/4 is reserved for possible
	 * copying overhead: frgagmentation, tunneling, mangling etc.
	 */
	if (atomic_read(&sk->sk_wmem_alloc) >
	    min(sk->sk_wmem_queued + (sk->sk_wmem_queued >> 2), sk->sk_sndbuf))
		return -EAGAIN;


...it's the decision to return -EAGAIN that has me baffled.  AFAIK
sk_wmem_queued is the number of unacknowledged bytes buffered for sending,
wherease sk_wmwm_alloc is the total number of bytes allocated for buffering
sends.  How does this comparison make sense?

I ask because I'm trying to investigate a TCP hangup, where (for some reason)
the NIC fails to send an skb, but all the retransmit attempts fail because this
condition traps them.


Also, when trawling through the code to trying to understand some context, I
came across the following in tcp_retransmit_timer()...

	if (tcp_retransmit_skb(sk, skb_peek(&sk->sk_write_queue)) > 0) {
		/* Retransmission failed because of local congestion,
		 * do not backoff.
		 */

...maybe I'm being blind but I don't quite get under which circumstances
tcp_retransmit_skb() can return > 0.

Thanks in advance...

                 reply	other threads:[~2004-12-21 19:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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='005d01c4e790$78030ff0$0281a8c0@ebpc' \
    --to=eeb@bartonsoftware.com \
    --cc=netdev@oss.sgi.com \
    /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).