[TCP]: question about counter in tcp_mark_head_lost

李易 lovelylich at gmail.com
Thu Jul 12 01:44:24 EDT 2012


hi all,
In tcp_mark_head_lost() fucntion, when sack enabled and fack disabled,
why does the packet counter variable "cnt" increase only when current skb is
marked as TCPCB_SACKED_ACKED?
code:
if (tcp_is_fack(tp) || tcp_is_reno(tp) ||
(TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_ACKED))
cnt += tcp_skb_pcount(skb);

Is this right ? I have a question when retransmition queue looks as below:

sacked=0 --> sacked=SACK_ACKED --> sacked=0 --> sacked=SACK_ACKED
then, when we call tcp_mark_head_lost(sk, 1, 0)
this will mark the two skbs, which are previously marked 0 , as TCPCB_LOST.

So, this function marks two skbs as lost, although we pass parameter
"packets"
as "1".

I do not know why this function has this semantic , which is not
consistent with
its declaration.

Can anyone explanation this, thanks in advance.




More information about the Kernelnewbies mailing list