免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12
最近访问板块 发新帖
楼主: jinrong9056
打印 上一主题 下一主题

[网络子系统] dst_entry求教 [复制链接]

论坛徽章:
0
11 [报告]
发表于 2012-05-24 09:24 |只看该作者
回复 10# eexplorer
Exactly! Thank you very much! You've solved the problem confusing me for more than a week!

论坛徽章:
0
12 [报告]
发表于 2012-05-24 09:58 |只看该作者
至于为什么引入这个flag, 查了一下,是Eric Dumazet的commit 93f154b594fe47e4a7e5358b309add449a046cd3, 还是为了performance tuning...

net: release dst entry in dev_hard_start_xmit()
   
    One point of contention in high network loads is the dst_release() performed
    when a transmited skb is freed. This is because NIC tx completion calls
    dev_kree_skb() long after original call to dev_queue_xmit(skb).
   
    CPU cache is cold and the atomic op in dst_release() stalls. On SMP, this is
    quite visible if one CPU is 100% handling softirqs for a network device,
    since dst_clone() is done by other cpus, involving cache line ping pongs.
   
    It seems right place to release dst is in dev_hard_start_xmit(), for most
    devices but ones that are virtual, and some exceptions.
   
    David Miller suggested to define a new device flag, set in alloc_netdev_mq()
    (so that most devices set it at init time), and carefuly unset in devices
    which dont want a NULL skb->dst in their ndo_start_xmit().
   
    List of devices that must clear this flag is :
   
    - loopback device, because it calls netif_rx() and quoting Patrick :
        "ip_route_input() doesn't accept loopback addresses, so loopback packets
         already need to have a dst_entry attached."
    - appletalk/ipddp.c : needs skb->dst in its xmit function
   
    - And all devices that call again dev_queue_xmit() from their xmit function
    (as some classifiers need skb->dst) : bonding, vlan, macvlan, eql, ifb, hdlc
   
    Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

论坛徽章:
0
13 [报告]
发表于 2012-05-24 11:30 |只看该作者
回复 12# eexplorer
感谢你详尽的回答,虽然我没有太理解关于CPU的那段说明,但之后的那部分明显就包括了我这样的情况。再次表示感谢!
btw:这样的相关信息是在哪里查到的呢?

   

论坛徽章:
0
14 [报告]
发表于 2012-05-24 16:58 |只看该作者
jinrong9056 发表于 2012-05-24 11:30
回复 12# eexplorer
感谢你详尽的回答,虽然我没有太理解关于CPU的那段说明,但之后的那部分明显就包括了 ...


可以clone Linus linux-2.6 tree (http://git.kernel.org/?p=linux/k ... x-2.6.git;a=summary), 通过git log查看commit history,

论坛徽章:
0
15 [报告]
发表于 2012-05-25 10:42 |只看该作者
回复 14# eexplorer
谢谢!

   
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP