Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panic when calling anssock_init() from c++ #24

Closed
st-ud-hu opened this issue Jul 1, 2016 · 5 comments
Closed

Panic when calling anssock_init() from c++ #24

st-ud-hu opened this issue Jul 1, 2016 · 5 comments

Comments

@st-ud-hu
Copy link

st-ud-hu commented Jul 1, 2016

I would like to use ANS (as of 2016-06-29 from github) from a C++ program. I could compile and link against the program successfully:

[100%] Building CXX object CMakeFiles/binxfer.dir/binxfer.cpp.o
/usr/bin/c++ -std=c++11 -I/work/dpdk-ans/librte_anssock/include -I/work/dpdk-ans/librte_ans/include -o CMakeFiles/binxfer.dir/binxfer.cpp.o -c /work/linktest/binxfer.cpp
Linking CXX executable binxfer
/usr/bin/cmake -E cmake_link_script CMakeFiles/binxfer.dir/link.txt --verbose=1
/usr/bin/c++ -std=c++11 CMakeFiles/binxfer.dir/binxfer.cpp.o -o binxfer -rdynamic /work/dpdk-ans/librte_ans/librte_ans.a /work/dpdk-ans/librte_anssock/librte_anssock.a /usr/local/share/dpdk/x86_64-native-linuxapp-gcc/lib/librte_mbuf.a /usr/local/share/dpdk/x86_64-native-linuxapp-gcc/lib/librte_eal.a /usr/local/share/dpdk/x86_64-native-linuxapp-gcc/lib/librte_mempool.a /usr/local/share/dpdk/x86_64-native-linuxapp-gcc/lib/librte_ring.a -lrt -lpthread -ldl

But the program terminates at calling anssock_init() right after the start:

./binxfer

EAL: Detected lcore 0 as core 0 on socket 0
EAL: Detected lcore 1 as core 1 on socket 0
EAL: Detected lcore 2 as core 0 on socket 0
EAL: Detected lcore 3 as core 1 on socket 0
EAL: Support maximum 128 logical core(s) by configuration.
EAL: Detected 4 lcore(s)
PANIC in rte_eal_config_reattach():
Cannot mmap memory for rte_config
: [./binxfer() [0x40723b]]
6: [/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7ffff6becf45]]
5: [./binxfer(main+0x164) [0x407464]]
4: [./binxfer(anssock_init+0x17a) [0x40c16a]]
3: [./binxfer(rte_eal_init+0xf69) [0x418629]]
2: [./binxfer(__rte_panic+0xc9) [0x406c85]]
1: [./binxfer(rte_dump_stack+0x1a) [0x41f7fa]]
Aborted (core dumped)

The example webserver included with dpdk-ans is working correctly on the same system.

Is it possible to use ANS from C++ applications? Do I need some specific compile/link options to do that? (Sorry if placing issue to the wrong place.)

@bluenet13
Copy link
Member

You shall startup ANS(tcp/ip stack) process before run your application.
Please read the wiki carefully.

@st-ud-hu
Copy link
Author

st-ud-hu commented Jul 1, 2016

Yes, I know. It is started with the following options:
./ans -c 0x1 -- -p 0x1 --config="(0,0,0)(0,1,0)"
And it is running constantly.

@bluenet13
Copy link
Member

Your application (binxfer) can't mapping same virtual memory address. you may reboot your linux pc, and try it again.

@bluenet13
Copy link
Member

Or you may run ans as below, input a base virtual address.
./ans -c 0x1 --base-virtaddr=0x2aaa4a90000 -- -p 0x1 --config="(0,0,0)(0,1,0)"

@st-ud-hu
Copy link
Author

st-ud-hu commented Jul 1, 2016

Rebooting host not helped but specifying virtual address works. The init is now successful. :-)
Thank you! :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants