天天看点

高性能网络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;

发送部分的修改与接收类似,就不重复了。

今天的学习,到此为止 (未完待续。。。)