全部博文(41)
分类: LINUX
2009-08-27 10:34:27
tcp.c文件的tcp_enqueue_partial函数
978计划工作组
/*
* Queue a partial frame
*/
void tcp_enqueue_partial(struct sk_buff * skb, struct sock * sk)
{
struct sk_buff * tmp;
unsigned long flags;
save_flags(flags);
cli();
tmp = sk->partial;
if (tmp)
del_timer(&sk->partial_timer);
sk->partial = skb;
init_timer(&sk->partial_timer);
/*
* Wait up to 1 second for the buffer to fill.
*/
sk->partial_timer.expires = HZ;
sk->partial_timer.function = (void (*)(unsigned long)) tcp_send_partial;
sk->partial_timer.data = (unsigned long) sk;
add_timer(&sk->partial_timer);
restore_flags(flags);
if (tmp)
tcp_send_skb(sk, tmp);
}
负责将入参的skb增加到partial对列中,如partial对列中已有数据则将其通过调用tcp_send_skb函数发送出去。
tcp_write
|__tcp_enqueue_partial
|__tcp_send_partial
|__tcp_dequeue_partial ->tcp_send_skb
此处语句比较简单,请参见1至18文章中的注释。