ChinaUnix.net
相关文章推荐:

netpoll

本帖最后由 chishanmingshen 于 2013-02-25 21:41 编辑 from 3.7.0 1.[code]static void netpoll_poll_dev(struct net_device *dev) { const struct net_device_ops *ops; struct netpoll_info *ni = rcu_dereference_bh(dev->npinfo); if (!dev || !netif_running(dev)) return; ops = dev->netdev_ops; if (!ops->ndo_poll_controller)<-------------提前跳出了?! return; /* Process pending work on NIC */...

by chishanmingshen - 内核源码 - 2013-03-01 11:00:42 阅读(2021) 回复(8)

相关讨论

现在需要在内核中直接发送些数据(用户态发送太慢),目前想到的方法是用NETPOLL API。不知道这种方法发数据是否能达到或者接近网卡发送速度的最大值?还有没有类似的更好的方法?多谢! 另外,NETPOLL好像没啥文档啊,搜了半天都没搜到。。。

by accessory - 内核源码 - 2010-06-22 22:56:09 阅读(4708) 回复(9)

Netpoll_rx的处理: 如果定义了#ifdef CONFIG_NETPOLL 则会在netif_rx中最先调用netpoll_rx处理skb。 在netif_rx中会调用__netpoll_rx(skb)继续处理,在__netpoll_rx(skb)中会给出处理的结果。 int __netpoll_rx(struct sk_buff *skb) { int proto, len, ulen; struct iphdr *iph; struct udphdr *uh; struct netpoll_info *npi = skb->dev->npinfo; struct netpoll *np = npi->rx_np; if (!np) goto out; if (skb->dev-...

by tc1989tc - 内核源码 - 2015-03-04 20:55:19 阅读(3861) 回复(16)

本帖最后由 chishanmingshen 于 2013-01-26 16:01 编辑 请教netpoll_poll_dev()的流程和机制 代码没看明白...求教~~~ from 2.6.36[code] void netpoll_poll_dev(struct net_device *dev) { const struct net_device_ops *ops; if (!dev || !netif_running(dev)) return; ops = dev->netdev_ops; if (!ops->ndo_poll_controller) return; /* Process pending work on NIC */ ops->ndo_poll_controller(dev); pol...

by chishanmingshen - 内核源码 - 2013-02-24 21:30:11 阅读(3531) 回复(11)