1. 編譯DPDK 帶上debuginfo調試信(xin)息, 修改頂層(ceng)的meson.build
| project('DPDK', 'C',     # Get version number from file.     # Fallback to "more" for Windows compatibility.     version: run_command(find_program('cat', 'more'),         files('VERSION')).stdout().strip(),     license: 'BSD',     default_options: ['buildtype=debugoptimized', 'default_library=static'],     meson_version: '>= 0.47.1' ) | 
2. 15年以(yi)前機器(qi)的(de)不支持(chi)RDSEED指令(ling)
在config/x86/meson.build 看到如下配置(zhi):
| optional_flags = [         'RDSEED', | 
刪除這個flag,不需要(yao)CPU指令支持后即可(ke)。
3. 編譯bpf 出現報錯xsk 相關(guan)錯誤
| In file included from ../drivers/net/af_xdp/rte_eth_af_xdp.c:19:0: /usr/include/bpf/xsk.h: In function ‘xsk_ring_prod__needs_wakeup’: /usr/include/bpf/xsk.h:82:21: error: ‘XDP_RING_NEED_WAKEUP’ undeclared (first use in this function) return *r->flags & XDP_RING_NEED_WAKEUP; ^~~~~~~~~~~~~~~~~~~~ /usr/include/bpf/xsk.h:82:21: note: each undeclared identifier is reported only once for each function it appears in /usr/include/bpf/xsk.h: In function ‘xsk_umem__extract_addr’: /usr/include/bpf/xsk.h:173:16: error: ‘XSK_UNALIGNED_BUF_ADDR_MASK’ undeclared (first use in this function) return addr & XSK_UNALIGNED_BUF_ADDR_MASK; ^~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/bpf/xsk.h: In function ‘xsk_umem__extract_offset’: /usr/include/bpf/xsk.h:178:17: error: ‘XSK_UNALIGNED_BUF_OFFSET_SHIFT’ undeclared (first use in this function) return addr >> XSK_UNALIGNED_BUF_OFFSET_SHIFT; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [14/857] Generating pipeline.sym_chk with a meson_exe.py custom command | 
修復patch 如下:
| diff --git a/tools/lib/bpf/xsk.h b/tools/lib/bpf/xsk.h index 584f6820a639..954d66e85208 100644 --- a/tools/lib/bpf/xsk.h +++ b/tools/lib/bpf/xsk.h @@ -79,7 +79,11 @@ xsk_ring_cons__rx_desc(const struct xsk_ring_cons *rx, __u32 idx) static inline int xsk_ring_prod__needs_wakeup(const struct xsk_ring_prod *r) { +#ifdef XDP_RING_NEED_WAKEUP return *r->flags & XDP_RING_NEED_WAKEUP; +#else + return 0; +#endif } static inline __u32 xsk_prod_nb_free(struct xsk_ring_prod *r, __u32 nb) @@ -170,12 +174,20 @@ static inline void *xsk_umem__get_data(void *umem_area, __u64 addr) static inline __u64 xsk_umem__extract_addr(__u64 addr) { +#ifdef XSK_UNALIGNED_BUF_ADDR_MASK return addr & XSK_UNALIGNED_BUF_ADDR_MASK; +#else + return addr; +#endif } static inline __u64 xsk_umem__extract_offset(__u64 addr) { +#ifdef XSK_UNALIGNED_BUF_OFFSET_SHIFT return addr >> XSK_UNALIGNED_BUF_OFFSET_SHIFT; +#else + return 0; +#endif } static inline __u64 xsk_umem__add_offset_to_addr(__u64 addr) |