* tcp retransmission
@ 2004-12-21 19:08 Eric Barton
0 siblings, 0 replies; only message in thread
From: Eric Barton @ 2004-12-21 19:08 UTC (permalink / raw)
To: netdev
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...
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-12-21 19:08 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-21 19:08 tcp retransmission Eric Barton
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).