questions on tcp_send

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

 



hello,
i have some problems understanding the tcp_send routine in net/ipv4/tcp.c:


1) In the following code:

if (skb_tailroom(skb) > 0) {
/* We have some space in skb head. Superb! */
...
}
else {
int merge = 0;
int i = skb_shinfo(skb)->nr_frags;
struct page *page = TCP_PAGE(sk);
int off = TCP_OFF(sk);
if (can_coalesce(skb, i, page, off) && off != PAGE_SIZE) {merge=1;}
...
}


My understanding of the skb_tailroom condition is that it's for the case when the previous sk_buff can accomodate the new buffer to be sent, and it checks if this can be done in the space allocated to
it, or if it should stuff it into the page where the space is allocated.


Is this correct?

2) If so, then why does "can_coalesce" check if:
(page == frag->page && off == frag->page_offset+frag->size) to decide if the data can be merged with that in the previous sk_buff?


Thanks in advance!
Steve

___________________________________________________
Meet your old school or college friends from
1 Million + database...
Click here to reunite www.batchmates.com/rediff.asp


- : 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