Re: Sender-side SWS avoidance in tcp_sendmsg()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dave,
     Thanx for the reply. You are right about tp->write_seq (and hence 
tp->pushed_seq) being updated to point to the end of the last skb (skb1 in 
the following example). Please have a look at the following example. 

	
    +--------+    +--------+
    |        | A  |        | B
    |  skb1  |--->|  skb2  |
    |        |    |        |
    +--------+    +--------+
   
    X        Y   Y+1       Z
+---------------------------------- seq line

We consider two points A and B as follows.

A: The skbuff at the tail (skb1) gets packed fully and so we call
   tcp_mark_push(), which sets tp->pushed_seq=tp->write_seq 
   so at A 
   tp->write_seq   == Y+1
   tp->pushed_seq  == Y+1

B: All user data is copied so we call "if(forced_push())", to check 
   if we should actually send now (as per sender side SWS check)
   which will check if the tp->write_seq is more than 
   tp->pushed_seq+1/2(maximum window advt)
   at B
   tp->write_seq  == Z+1
   tp->pushed_seq == Y+1 (unchanged after last call to tcp_mark_push()) !!

   Now the forced_push() check effectively is
   if((tp->write_seq - tp->pushed_seq) > (tp->max_window>>1))
   In this case (tp->write_seq - tp->pushed_seq) == Z-Y, which the length 
   of skb2, though we still have skb1 waiting to be sent.

So, are we not doing this check incorrectly, since we are just considering 
the length of skb2 to calculate the amount of to-be-sent data, while we 
infact we have skb1->len+skb2->len worth of data to be sent.


Thanx,
tomar




On Mon, 5 Jul 2004, David S. Miller wrote:

> On Sat, 3 Jul 2004 03:09:23 +0100 (BST)
> Nagendra Tomar <tomer_iisc@yahoo.com> wrote:
> 
> > IOW we don't have tp->write_seq-tp->pushed_seq worth
> > of data to send, but,
> > tp->write_seq-tp->pushed_seq+skb->len, where skb is
> > the last skb for which we called tcp_mark_push.
> > 
> > Have I misunderstood something ?
> 
> In the previous run of the loop, skb->len was accounted for
> (this is when we filled it up) by the line:
> 
> 	tp->write_seq += copy;
> 
> Therefore the tcp_mark_push() invocation you mention sets
> tp->pushed_seq to the sequence space at the end of that skb.
> 
> -
> : send the line "unsubscribe linux-net" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

-- 



-- You have moved the mouse. Windows must be restarted for the 
   changes to take effect.

-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux