lkml.org 
[lkml]   [2003]   [Aug]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectQuestions on tcp_send
hello,
i have some problems understanding the tcp_send routine in
net/ipv4/tcp.c:

1)
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! Help appreciated...

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


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:47    [W:0.024 / U:11.556 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site