__skb_dequeue() -- ��sk_buff�表的第一����c�年�列中摘除,�K返回���c
process_backlog() --> __skb_dequeue()
/usr/src/linux-2.6.19/include/linux/skbuff.h
static inline struct sk_buff *__skb_dequeue(struct sk_buff_head *list)
{
struct sk_buff *next, *prev, *result;
prev = (struct sk_buff *) list;
next = prev->next;
result = NULL;
if (next != prev) {
result = next; //(1)
next = next->next;
list->qlen--;
next->prev = prev; //(2)
prev->next = next;
result->next = result->prev = NULL; //(3)
}
return result;
}
(1)
------------------------------------------------------------------
result --+
|
prev -+ next --+
| |
| struct sk_buff_head | struct sk_buff struct sk_buff
list -+-->|--------------------| -| -|--------------------| |--------------------|
|struct sk_buff *next|--+->|struct sk_buff *next|--->|struct sk_buff *next|
|--------------------| |--------------------| |--------------------|
|struct sk_buff *prev|<----|struct sk_buff *prev|<---|struct sk_buff *prev|
|--------------------| |--------------------| |--------------------|
|__u32 qlen | | | | |
|--------------------| |--------------------| |--------------------|
(2)
------------------------------------------------------------------
result --+
|
prev -+ | next --+
| | |
| struct sk_buff_head | struct sk_buff | struct sk_buff
list -+-->|--------------------| -| -|--------------------| | -|--------------------|
|struct sk_buff *next|--+->|struct sk_buff *next|-+->|struct sk_buff *next|
|--------------------| |--------------------| |--------------------|
|struct sk_buff *prev|<-+--|struct sk_buff *prev| +--|struct sk_buff *prev|
|--------------------| -| -|--------------------| | -|--------------------|
|__u32 qlen | -| -| | | -| |
|--------------------| -| -|--------------------| | -|--------------------|
| |
+-------------------------+
(3)
------------------------------------------------------------------
prev -+ next --+
| |
| struct sk_buff_head | struct sk_buff
list -+-->|--------------------| | -|--------------------|
|struct sk_buff *next|----------------------------+->|struct sk_buff *next|
|--------------------| |--------------------|
|struct sk_buff *prev|<-+ +--|struct sk_buff *prev|
|--------------------| -| | -|--------------------|
|__u32 qlen | -| | -| |
|--------------------| -| | -|--------------------|
| |
+-------------------------+
result ---+
|
| struct sk_buff
| -|--------------------|
+->|struct sk_buff *next|NULL
|--------------------|
|struct sk_buff *prev|NULL
|--------------------|
| |
|--------------------|