mtcp-stack / mtcp

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

compiling error "core.c:1332:4: error: ‘lcore_config’ undeclared" #278

Closed zarzen closed 4 years ago

zarzen commented 4 years ago

Hi,

I got a compiling error while compiling mTCP on ubuntu 18.04 with dpdk-19.11. (The system is on the AWS, I am not sure whether it will affect the compiling or not. But I am sure dpdk is runnable on AWS, because the dpdk-helloworld app passed the test)

here is the log

make  all-recursive
make[1]: Entering directory '/home/ubuntu/mtcp'
Making all in mtcp/src
make[2]: Entering directory '/home/ubuntu/mtcp/mtcp/src'
   CC core.c
   CC tcp_stream.c
   CC config.c
   CC api.c
   CC eventpoll.c
   CC socket.c
   CC pipe.c
   CC eth_in.c
   CC tcp_util.c
   CC ip_out.c
   CC eth_out.c
   CC arp.c
   CC tcp_in.c
   CC cpu.c
   CC logger.c
   CC tcp_out.c
   CC memory_mgt.c
   CC ip_in.c
   CC tcp_ring_buffer.c
   CC fhash.c
   CC tcp_rb_frag_queue.c
   CC debug.c
   CC tcp_sb_queue.c
   CC tcp_stream_queue.c
   CC addr_pool.c
   CC rss.c
   CC timer.c
   CC tcp_send_buffer.c
   CC psio_module.c
cp ./include/mtcp_api.h ../include/mtcp_api.h
cp ./include/mtcp_epoll.h ../include/mtcp_epoll.h
   CC dpdk_module.c
   CC netmap_module.c
   CC onvm_module.c
   CC icmp.c
   CC io_module.c
core.c: In function ‘mtcp_create_context’:
core.c:1332:4: error: ‘lcore_config’ undeclared (first use in this function); did you mean ‘mtcp_config’?
    lcore_config[master].ret = 0;
    ^~~~~~~~~~~~
    mtcp_config
core.c:1332:4: note: each undeclared identifier is reported only once for each function it appears in
Makefile:155: recipe for target 'core.o' failed
make[2]: *** [core.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/home/ubuntu/mtcp/mtcp/src'
Makefile:382: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/ubuntu/mtcp'
Makefile:313: recipe for target 'all' failed
make: *** [all] Error 2

For the configuration part I used following command:

export RTE_SDK=/home/ubuntu/dpdk-19.11
export RTE_TARGET=x86_64-native-linuxapp-gcc
./configure --with-dpdk-lib=$RTE_SDK/$RTE_TARGET --disable-hwcsum CFLAGS="-DMAX_CPUS=4"

I didn't follow the step-3 of README, instead I followed the instructions of dpdk-doc to start hand the NIC to dpdk using usertools/dpdk-devbind.py. Following is the output of ./usertools/dpdk-devbind.py --status

Network devices using DPDK-compatible driver
============================================
0000:00:04.0 'Elastic Network Adapter (ENA) ec20' drv=vfio-pci unused=ena

Network devices using kernel driver
===================================
0000:00:03.0 'Elastic Network Adapter (ENA) ec20' if=ens3 drv=ena unused=vfio-pci *Active*

No 'Baseband' devices detected
==============================

While I think device status won't affect the compiling process right? I also checked the core.c file, and search with keyword lcore_config, indeed there is no other place defined the variable lcore_config.

Any suggestions?

ajamshed commented 4 years ago

@zarzen,

I haven't upgraded mTCP to work with dpdk-19.11 yet. The furthest I have gone is till dpdk-18.05. Any chance you can downgrade the dpdk stack to this version? The mTCP stack references some internal dpdk structs specific to eal threads. That part of the code (within dpdk) has changed in the latter releases of dpdk (thus causing compile-time errors).

You are more than welcome to patch mTCP for dpdk-19.11 and submit pull request. I will be happy to merge the code.

zarzen commented 4 years ago

I see I will downgrade for now. Thanks! I would be happy to help once got familiar with the codebase.