mtcp-stack / mtcp

mTCP: A Highly Scalable User-level TCP Stack for Multicore Systems
Other
1.98k stars 436 forks source link

apache benchmark: Segmentation fault #237

Open DBLouis opened 5 years ago

DBLouis commented 5 years ago

The following error message appears when running apache benchmark:

$ ./ab http://x.x.x.x/index.html
Configuration updated by mtcp_setconf().
...
[ mtcp_init:1494] Setting mtcp_max_fds to: 1024
---------------------------------------------------------------------------------
Loading mtcp configuration from : config/mtcp.conf
Loading interface setting
Segmentation fault (core dumped)

Running with valgrind does not give more information.

The host system is Ubuntu 16.04 (Linux 4.15) with Intel i210 NIC.

Here are the exact steps taken to build AB:

git clone https://github.com/mtcp-stack/mtcp.git
cd mtcp
git checkout 0c3882107a6325d5d0479247ab1344f4eb6fcbf2
git submodule update --init

export MTCP_ROOT="$(pwd)/mtcp"
export RTE_SDK="$(pwd)/dpdk"
export RTE_TARGET=x86_64-native-linuxapp-gcc

sed -i -e 's/O_TO_EXE_STR =/\$(shell if [ \! -d \${RTE_SDK}\/\${RTE_TARGET}\/lib ]\; then mkdir \${RTE_SDK}\/\${RTE_TARGET}\/lib\; fi)\nLINKER_FLAGS = \$(call linkerprefix,\$(LDLIBS))\n\$(shell echo \${LINKER_FLAGS}
\> \${RTE_SDK}\/\${RTE_TARGET}\/lib\/ldflags\.txt)\nO_TO_EXE_STR =/g' "${RTE_SDK}/mk/rte.app.mk"

autoreconf -ivf
make -j4 -C dpdk install T="${RTE_TARGET}"
./configure --with-dpdk-lib="${RTE_SDK}/${RTE_TARGET}" CFLAGS="-DMAX_CPUS=4"
make -j4

./setup_mtcp_dpdk_env.sh
# - load UIO module
# - setup hugepages
# - register ethernet port
# - quit

ip addr add dev dpdk0 x.x.x.x/24
ip link set dev dpdk0 up

cd apps/apache_benchmark/
./configure CFLAGS="-g -O2" --with-libmtcp="${MTCP_ROOT}" --with-libdpdk="${RTE_SDK}/${RTE_TARGET}"
make -j4

# edit config/mtcp.conf
# config/mtcp.conf
io = dpdk
num_mem_ch = 4
port = dpdk0
max_concurrency = 16000
max_num_buffers = 16000
rcvbuf = 8192
sndbuf = 8192
tcp_timeout = 30
tcp_timewait = 0
stat_print = dpdk0
ajamshed commented 5 years ago

@DBLouis ,

Apologies for the delayed response. I had a look at the output log. The process crashes during NIC device initialization. Can you please check whether other mTCP applications such as lighttpd, epserver and epwget run?

Please check whether DPDK supports your NIC (Intel i210) from this page. I don't see this specific NIC in the page. Can you also check whether example dpdk applications such as testpmd detect your NIC?

ab is running fine with ixgbe/i40e compatible NICs.