2019-04-04 08:51:13 +00:00
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
# Copyright(c) 2019 Intel Corporation
|
|
|
|
|
2020-12-22 00:45:11 +00:00
|
|
|
if is_windows
|
2021-04-20 10:22:25 +00:00
|
|
|
build = false
|
|
|
|
reason = 'not supported on Windows'
|
|
|
|
subdir_done()
|
2020-12-22 00:45:11 +00:00
|
|
|
endif
|
|
|
|
|
2019-04-04 08:51:13 +00:00
|
|
|
sources = files('rte_eth_af_xdp.c')
|
|
|
|
|
2021-01-18 14:29:57 +00:00
|
|
|
bpf_dep = dependency('libbpf', required: false, method: 'pkg-config')
|
2019-04-04 08:51:13 +00:00
|
|
|
if not bpf_dep.found()
|
2021-04-20 10:22:25 +00:00
|
|
|
bpf_dep = cc.find_library('bpf', required: false)
|
2019-04-04 08:51:13 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
if bpf_dep.found() and cc.has_header('bpf/xsk.h') and cc.has_header('linux/if_xdp.h')
|
2021-04-20 10:22:25 +00:00
|
|
|
ext_deps += bpf_dep
|
|
|
|
bpf_ver_dep = dependency('libbpf', version : '>=0.2.0',
|
|
|
|
required: false, method: 'pkg-config')
|
|
|
|
if bpf_ver_dep.found()
|
|
|
|
dpdk_conf.set('RTE_LIBRTE_AF_XDP_PMD_SHARED_UMEM', 1)
|
|
|
|
endif
|
2019-04-04 08:51:13 +00:00
|
|
|
else
|
2021-04-20 10:22:25 +00:00
|
|
|
build = false
|
|
|
|
reason = 'missing dependency, "libbpf"'
|
2019-04-04 08:51:13 +00:00
|
|
|
endif
|