net/ark: update DDM functions for firmware update
[dpdk.git] / drivers / net / af_xdp / meson.build
1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2019 Intel Corporation
3
4 if is_windows
5     build = false
6     reason = 'not supported on Windows'
7     subdir_done()
8 endif
9
10 sources = files('rte_eth_af_xdp.c')
11
12 xdp_dep = dependency('libxdp', version : '>=1.2.2', required: false, method: 'pkg-config')
13 bpf_dep = dependency('libbpf', required: false, method: 'pkg-config')
14 if not bpf_dep.found()
15     bpf_dep = cc.find_library('bpf', required: false)
16 endif
17
18 if cc.has_header('linux/if_xdp.h')
19     if xdp_dep.found() and cc.has_header('xdp/xsk.h')
20         if bpf_dep.found() and cc.has_header('bpf/bpf.h')
21             cflags += ['-DRTE_NET_AF_XDP_LIBXDP']
22             cflags += ['-DRTE_NET_AF_XDP_SHARED_UMEM']
23             ext_deps += xdp_dep
24             ext_deps += bpf_dep
25             bpf_ver_dep = dependency('libbpf', version : '>=0.7.0',
26                                  required: false, method: 'pkg-config')
27             if bpf_ver_dep.found()
28                 cflags += ['-DRTE_NET_AF_XDP_LIBBPF_OBJ_OPEN']
29             endif
30         else
31             build = false
32             reason = 'missing dependency, libbpf'
33         endif
34     elif bpf_dep.found() and cc.has_header('bpf/xsk.h') and cc.has_header('bpf/bpf.h')
35         # libxdp not found. Rely solely on libbpf for xsk functionality
36         # which is only available in versions <= v0.6.0.
37         bpf_ver_dep = dependency('libbpf', version : '<=0.6.0',
38                                  required: false, method: 'pkg-config')
39         if bpf_ver_dep.found()
40             ext_deps += bpf_dep
41             bpf_shumem_ver_dep = dependency('libbpf', version : '>=0.2.0',
42                             required: false, method: 'pkg-config')
43             if bpf_shumem_ver_dep.found()
44                 cflags += ['-DRTE_NET_AF_XDP_SHARED_UMEM']
45             endif
46         else
47             build = false
48             reason = 'missing dependency, "libxdp" or "libbpf <= v0.6.0"'
49         endif
50     else
51         build = false
52         reason = 'missing dependency, "libxdp" and "libbpf"'
53     endif
54 else
55     build = false
56     reason = 'missing header, "linux/if_xdp.h"'
57 endif