[init][3c59x.c]
module_init -> pci_register_driver(&vortex_driver) -> vortex_init_one -> ortex_probe1 -> [alloc_etherdev] -> vortex_open -> vortex_interrupt -> vortex_rx(alloc_skb) -> netif_rx
[netif_rx]
0. netpoll_rx(for what ?).
a. add timestamp for skb & plus netstamp_needed
b. save_irq & stat_total & get cpu queue (softnet_data per cpu)
c. qlen > netdev_max_backlog to drop skb
d. qlen == 0, netif_rx_schedule(rasie soft_irq)
-- soft_rx_action 是有限制执行(时间段),因此并不能执行完所有enqueue的skb, queue未执行完会在软中断函数中rasie_rx_softirq, 以此期待下一个软中断周期执行本次未完成的处理,然后queue为空时netif_rx需要先触发一个rx_softirq. 这样就可以让软中断的触发合理。
e. dev_hold & enqueue & restore_irq
-[netif_rx_schedule]
* list_add softnet_data.backlog_dev.poll_list(process_backlog) to softnet_data.poll_list
* __raise_softirq_irqoff(NET_RX_SOFTIRQ);
[net_rx_action]
a. list_entry soft_data.queue => backlog_dev
b. dev->poll => process_backlog
c. quota & weight & jiffies
d. ! list_empty poll_list => raise_rx_softirq
[process_backlog]
a. get cpu queue & jiffies & weight
b. for (dequeue & netif_recvive_skb)
c. queue ==0; list_del backlog_dev->poll_list return 0;
d. else return -1; list_move_tail.
阅读(2208) | 评论(0) | 转发(0) |