F-Stack一个基于DPDK的开源和高性能网络框架 基于DPDK23.11需要做如下操作 sed替换: sed -n '/DEV_RX_OFFLOAD_IPV4_CKSUM/p' drivers/net/macb/* sed -i 's/ETH_/RTE_ETH_/g' *.c sed -i 's/DEV_/RTE_ETH_/g' *.c f-stack适配dpdk20.11 sed -i 's/RTE_MBUF_F_RX_IP_CKSUM_BAD/PKT_RX_IP_CKSUM_BAD/g' *.c sed -i 's/RTE_MBUF_F_/PKT_/g' *.c 注释掉: pmap_change_prot 编译错误:call-clobbered register used for global register variable 文件freebsd/arm64/include/pcpu.h中x18改为x22 register struct pcpu *pcpup __asm ("x22"); 这样改虽然通过编译,但一直有段错误:freebsd/net/netisr.c:1139,所以改为非寄存器变量 f-stack/lib/include/machine/pcpu.h:50:40: error: ‘struct pcpu’ has no member named ‘pc_prvspace修改如下: -#define PCPU_SET(member,value) (pcpup->pc_ ## member = (value)) +#define PCPU_SET(member,value) (pcpup = (value)) 编译错误ffs重定义 +++ b/lib/Makefile @@ -355,7 +355,7 @@ LIBKERN_SRCS+= \ - fls.c \ + #fls.c \ flsl.c 基于dpdk20.11, f-stack master分支:5b97230c858598a10e1b82c tag: v1.23, origin/master,修改如下,可以正常编译 编译redis错误:jemalloc/jemalloc.h: No such file or directory jemalloc重载了Linux下的ANSIC的malloc和free函数,解决方法如下: 在make命令后加上参数malloc make MALLOC=libc 编译f-stack lib导出: export FF_PATH=/root/f-stack export PKG_CONFIG_PATH=/usr/lib64/pkgconfig:/usr/local/lib64/pkgconfig:/usr/lib/pkgconfig nginx with debug ./configure --prefix=/usr/local/nginx_fstack --with-ff_module --with-cc-opt=" -g3 " ./helloworld --conf /etc/f-stack.conf --proc-type=primary struct pcpu * # Close ASLR; it is necessary in multiple process echo 0 > /proc/sys/kernel/randomize_va_space uma_startup1 https://github.com/forxycc/f-stack/blob/forxy-v1/build-aarch64.sh 在aarch64平台,struct pcpu没有成员 pc_prvspace,修改如下: +++ b/freebsd/arm64/include/pcpu.h + struct pcpu *pc_prvspace; \ u_int pc_bcast_tlbi_workaround; \ u_int pc_mpidr; /* stored MPIDR value */ \ - char __pad[201] + char __pad[197] 下面是用fstack自带的dpdk21.11的arch64补丁包: 编译错误:./machine_include/machine/pcpu.h:60:23: error: call-clobbered register used for global register variable [-Werror] 60 | register struct pcpu *pcpup __asm ("x18"); | ^~~~~ 加上:-ffixed-x18,选项可以解决上面的问题 解压:f-stack_head.tar,拷其中的文件到下面目录,拷 cp -f ff_config.h /usr/local/include/ff_config.h cp -f ff_api.h /usr/local/include/ff_api.h cp -f ff_event.h /usr/local/include/ff_event.h cp -f ff_errno.h /usr/local/include/ff_errno.h cp -f ff_epoll.h /usr/local/include/ff_epoll.h 库文件操作如下: cp -f libfstack.a /usr/local/lib/libfstack.a.1.23 ln -sf /usr/local/lib/libfstack.a.1.23 /usr/local/lib/libfstack.a
标签:fstack,origin,pcpu,master,usr,ff,include,local,stack From: https://www.cnblogs.com/wangwangever/p/18112010