mpls-linux移植后,出现的问题如下:
移植iproute2和新点的kernel后的结果
Starting program: /home/z/dce/source/ns-3-dce/build/bin/dce-linux --linkType=c --reliable=true
[Thread debugging using libthread_db enabled]
(gdb) bt
#0 0x00007ffff479e807 in dev_init_scheduler_queue (dev_queue=0x0, dev=<optimized out>, _qdisc=0x7ffff4b071e0 <noop_qdisc>)
at /home/z/dce/source/net-next-sim-2.6.36/net/sched/sch_generic.c:833
#1 0x00007ffff479f041 in netdev_for_each_tx_queue (arg=0x7ffff4b071e0 <noop_qdisc>, f=<optimized out>, dev=0x7ffff469b740)
at /home/z/dce/source/net-next-sim-2.6.36/include/linux/netdevice.h:1099
#2 dev_init_scheduler (dev=dev@entry=0x7ffff469b740) at /home/z/dce/source/net-next-sim-2.6.36/net/sched/sch_generic.c:840
#3 0x00007ffff478cd4a in register_netdevice (dev=dev@entry=0x7ffff469b740) at /home/z/dce/source/net-next-sim-2.6.36/net/core/dev.c:5056
#4 0x00007ffff478ce86 in register_netdev (dev=dev@entry=0x7ffff469b740) at /home/z/dce/source/net-next-sim-2.6.36/net/core/dev.c:5153
#5 0x00007ffff4878923 in loopback_net_init (net=0x7ffff4b1d280 <init_net>) at /home/z/dce/source/net-next-sim-2.6.36/drivers/net/loopback.c:212
#6 0x00007ffff47872ed in __register_pernet_operations (ops=ops@entry=0x7ffff4b196e0 <loopback_net_ops>, list=0x7ffff4b05a30 <pernet_list>)
at /home/z/dce/source/net-next-sim-2.6.36/net/core/net_namespace.c:425
#7 0x00007ffff478736f in register_pernet_operations (ops=ops@entry=0x7ffff4b196e0 <loopback_net_ops>, list=0x7ffff4b05a30 <pernet_list>)
at /home/z/dce/source/net-next-sim-2.6.36/net/core/net_namespace.c:460
#8 0x00007ffff47873fd in register_pernet_device (ops=0x7ffff4b196e0 <loopback_net_ops>) at /home/z/dce/source/net-next-sim-2.6.36/net/core/net_namespace.c:548
#9 0x00007ffff4878dd2 in net_dev_init () at /home/z/dce/source/net-next-sim-2.6.36/net/core/dev.c:6061
#10 0x00007ffff475ba02 in sim_init (exported=<optimized out>, imported=<optimized out>, kernel=<optimized out>) at arch/sim/sim.c:174
#11 0x00007ffff7d5dad8 in ns3::KernelSocketFdFactory::InitializeStack (this=0x69b4c0) at ../model/kernel-socket-fd-factory.cc:613
#12 0x00007ffff7d69476 in ns3::LinuxSocketFdFactory::InitializeStack (this=0x69b4c0) at ../model/linux-socket-fd-factory.cc:156
#13 0x00007ffff7d69e59 in ns3::EventImpl* ns3::MakeEvent<void (ns3::LinuxSocketFdFactory::*)(), ns3::LinuxSocketFdFactory*>(void (ns3::LinuxSocketFdFactory::*)(), ns3::LinuxSocketFdFactory*)::EventMemberImpl0::Notify() (this=0x694310) at /home/z/dce/build/include/ns3.23/ns3/make-event.h:323
#14 0x00007ffff75845e7 in ns3::EventImpl::Invoke (this=0x694310) at ../src/core/model/event-impl.cc:51
#15 0x00007ffff7d5c9b8 in ns3::KernelSocketFdFactory::ScheduleTaskTrampoline (context=0x694310) at ../model/kernel-socket-fd-factory.cc:488
#16 0x00007ffff7ccf7fc in ns3::TaskManager::Trampoline (context=0x6a33d0) at ../model/task-manager.cc:274
#17 0x00007ffff7ccb7d7 in ns3::PthreadFiberManager::Run (arg=0x6a3ac0) at ../model/pthread-fiber-manager.cc:402
#18 0x000000318b2079d1 in start_thread () from /lib64/libpthread.so.0
#19 0x000000318a6e88fd in clone () from /lib64/libc.so.6
(gdb)
觉得没有道理,而且dev被优化掉了
于是去掉优化,重新编译kernel,出现错误如下,
Program received signal SIGUSR1, User defined signal 1.
[New Thread 0x7ffff74a9700 (LWP 648)]
/home/z/dce/source/ns-3-dce/build/bin/dce-linux: symbol lookup error: elf-cache/0/liblinux.so: undefined symbol: radix_tree_lookup
[Thread 0x7ffff74a9700 (LWP 648) exited]
[Inferior 1 (process 633) exited with code 0177]
(gdb) q
解决方法:
1 重新编译kernel部分
2 将radix-tree加入到lib的编译中,加入的位置类似int-sqrt, 在arch/sim/Makefile中。
查mpls中用到了大量radix_tree_lookup操作