static int process_backlog(struct napi_struct *napi, int quota)
{
int work = 0;
//获得当前cpu私有数据softnet_data
struct softnet_data *queue = &__get_cpu_var(softnet_data);
unsigned long start_time = jiffies;
napi->weight = weight_p;
do {
struct sk_buff *skb;
//禁止本地cpu中断
local_irq_disable();
//从当前cpu私有数据队列input_pkt_queue中取出数据skb
skb = __skb_dequeue(&queue->input_pkt_queue);
//队列为空
if (!skb)
{
//从softnet_data{}设备链表中删除此设备,清除NAPI_STATE_SCHED标识
__napi_complete(napi);
//开启本地cpu中断
local_irq_enable();
break;
}
//开启本地cpu中断
local_irq_enable();
netif_receive_skb(skb);//将数据包传上协议栈
} while (++work < quota && jiffies == start_time); //如果处理的skb数目大于事先预定的最大值,或者处理的时间超过一个
//时间片,则结束处理
return work;//返回处理的帧的个数
}