提问人:Jimmy 提问时间:9/17/2021 更新时间:10/9/2022 访问量:329
DPDK:释放 MBUF 时出现编译错误
DPDK: compilation error while freeing MBUF
问:
我正在尝试从分配的池创建简单的 MBUF 并释放 MBUF,但是遇到了以下编译问题。如果我注释掉mbuf_free,程序编译良好。请问有什么指示吗?
法典:
m = rte_pktmbuf_alloc(pktmbuf_pool);
if (m == NULL)
printf("Cannot allocate mbuf");
if (rte_pktmbuf_pkt_len(m) != 0)
printf("Bad length");
data = rte_pktmbuf_append(m, packet_len);
if (data == NULL)
printf("Cannot append data");
....
rte_pktmbuf_free(packet_data_mbuf); <<<<< COMPLAINS here
错误:
/usr/local/include/dpdk/rte_memcpy.h: In function ‘__rte_pktmbuf_free_direct’:
/usr/local/include/dpdk/rte_memcpy.h:595:64: error: ‘__builtin_ia32_palignr128’ needs isa option -m32 -mssse3
_mm_storeu_si128((__m128i *)((uint8_t *)dst + 0 * 16), _mm_alignr_epi8(xmm1, xmm0, offset)); \
^
/usr/local/include/dpdk/rte_memcpy.h:644:16: note: in expansion of macro ‘MOVEUNALIGNED_LEFT47_IMM’
case 0x01: MOVEUNALIGNED_LEFT47_IMM(dst, src, n, 0x01); break; \
^~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/dpdk/rte_memcpy.h:798:2: note: in expansion of macro ‘MOVEUNALIGNED_LEFT47’
MOVEUNALIGNED_LEFT47(dst, src, n, srcofs);
^~~~~~~~~~~~~~~~~~~~
......
......
答:
2赞
Vipin Varghese
9/17/2021
#1
DPDK API 利用 SIMD 内部函数。这在内部依赖于哪些是指令集的一部分。__rte_pktmbuf_free_direct
_mm_alignr_epi8
palignr
SSSE3
根据编译器消息,编译器标志似乎在构建过程中没有传递。 error: ‘__builtin_ia32_palignr128’ needs ISA option -m32 -mssse3
-mssse3
解决方案:更新 CFLAGS,最低 DPDK 要求为 x86 平台。-mssse3
注意:如果 dpdk 版本高于 19.08,对于自定义安装或发行版发布的 libdpdk,设置正确标志的简单方法是将CFGLAGS+=$(pkg-config --cflags libdpdk)
评论
0赞
Jimmy
9/17/2021
嗨,Vipin - 非常感谢,在 CFLAGs 中添加 -mssse3,解决了这个问题!
评论