亚欧色一区w666天堂,色情一区二区三区免费看,少妇特黄A片一区二区三区,亚洲人成网站999久久久综合,国产av熟女一区二区三区

  • 發布文章
  • 消息中心
點贊
收藏
評論
分享
原創

DPDK使用踩坑小記

2023-11-28 01:16:03
89
0

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 = [
        'AES',
        'AVX',
        'AVX2',
        'AVX512BW',
        'AVX512CD',
        'AVX512DQ',
        'AVX512F',
        'AVX512VL',
        'PCLMUL',
        'RDRND',

        'RDSEED',
        'VPCLMULQDQ',
]

刪除這個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)
0條評論
0 / 1000
l****n
6文(wen)章(zhang)數
0粉絲數(shu)
l****n
6 文章 | 0 粉絲
原創

DPDK使用踩坑小記

2023-11-28 01:16:03
89
0

1. 編譯(yi)DPDK 帶上debuginfo調(diao)試信息(xi), 修改頂層的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年以前機器的不支持RDSEED指令

在config/x86/meson.build 看到如下配置:

optional_flags = [
        'AES',
        'AVX',
        'AVX2',
        'AVX512BW',
        'AVX512CD',
        'AVX512DQ',
        'AVX512F',
        'AVX512VL',
        'PCLMUL',
        'RDRND',

        'RDSEED',
        'VPCLMULQDQ',
]

刪除這(zhe)個flag,不需要CPU指(zhi)令支持(chi)后(hou)即(ji)可。

3. 編(bian)譯bpf 出現報錯xsk 相關錯誤

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)
文章來自個人專欄
文章(zhang) | 訂閱(yue)
0條評論
0 / 1000
請輸入你的評論
0
0