天天看點

高性能網絡I/O架構-netmap源碼分析(2)

作者:[email protected]

部落格:blog.focus-linux.net linuxfocus.blog.chinaunix.net

微網誌:weibo.com/glinuxer

QQ技術群:4367710

前面e1000_probe的分析,按照Linux驅動架構,接下來就該e1000_open。netmap并沒有對e1000_open進行任何修改,而是改動了e1000_configure,其會被e1000_open及e1000_up調用。

按照慣例,還是先看diff檔案

從diff檔案可以看出,netmap替代了原有的e1000申請ring buffer的代碼。如果e1000_netmap_init_buffers成功傳回,e1000_configure就直接退出了。

接下來進入e1000_netmap_init_buffers:

進入netmap_rx_irq, int netmaprxirq(struct ifnet *ifp, int q, int *workdone) { struct netmapadapter *na; struct netmap_kring *r; NMSELINFOT *main_wq;

發送部分的修改與接收類似,就不重複了。

今天的學習,到此為止 (未完待續。。。)