aboutsummaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorAndrew Melnychenko <andrew@daynix.com>2021-05-14 14:48:32 +0300
committerJason Wang <jasowang@redhat.com>2021-06-04 15:25:46 +0800
commit46627f41b6b781885c64a2b12814060a7ca8da36 (patch)
tree76087ad727fa6ab584eb3c52aa5d280de9555261 /meson.build
parentf3fa412de28ae3cb31d38811d30a77e4e20456cc (diff)
ebpf: Added eBPF RSS loader.
Added function that loads RSS eBPF program. Added stub functions for RSS eBPF loader. Added meson and configuration options. By default, eBPF feature enabled if libbpf is present in the build system. libbpf checked in configuration shell script and meson script. Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com> Signed-off-by: Andrew Melnychenko <andrew@daynix.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build23
1 files changed, 23 insertions, 0 deletions
diff --git a/meson.build b/meson.build
index 632b380738..bcbce8e164 100644
--- a/meson.build
+++ b/meson.build
@@ -1032,6 +1032,23 @@ if not get_option('fuse_lseek').disabled()
endif
endif
+# libbpf
+libbpf = dependency('libbpf', required: get_option('bpf'), method: 'pkg-config')
+if libbpf.found() and not cc.links('''
+ #include <bpf/libbpf.h>
+ int main(void)
+ {
+ bpf_object__destroy_skeleton(NULL);
+ return 0;
+ }''', dependencies: libbpf)
+ libbpf = not_found
+ if get_option('bpf').enabled()
+ error('libbpf skeleton test failed')
+ else
+ warning('libbpf skeleton test failed, disabling')
+ endif
+endif
+
if get_option('cfi')
cfi_flags=[]
# Check for dependency on LTO
@@ -1131,6 +1148,7 @@ endif
config_host_data.set('CONFIG_GTK', gtk.found())
config_host_data.set('CONFIG_LIBATTR', have_old_libattr)
config_host_data.set('CONFIG_LIBCAP_NG', libcap_ng.found())
+config_host_data.set('CONFIG_EBPF', libbpf.found())
config_host_data.set('CONFIG_LIBISCSI', libiscsi.found())
config_host_data.set('CONFIG_LIBNFS', libnfs.found())
config_host_data.set('CONFIG_RBD', rbd.found())
@@ -1800,6 +1818,7 @@ if have_system
'backends',
'backends/tpm',
'chardev',
+ 'ebpf',
'hw/9pfs',
'hw/acpi',
'hw/adc',
@@ -1992,6 +2011,9 @@ subdir('accel')
subdir('plugins')
subdir('bsd-user')
subdir('linux-user')
+subdir('ebpf')
+
+common_ss.add(libbpf)
bsd_user_ss.add(files('gdbstub.c'))
specific_ss.add_all(when: 'CONFIG_BSD_USER', if_true: bsd_user_ss)
@@ -2701,6 +2723,7 @@ summary_info += {'RDMA support': config_host.has_key('CONFIG_RDMA')}
summary_info += {'PVRDMA support': config_host.has_key('CONFIG_PVRDMA')}
summary_info += {'fdt support': fdt_opt == 'disabled' ? false : fdt_opt}
summary_info += {'libcap-ng support': libcap_ng.found()}
+summary_info += {'bpf support': libbpf.found()}
# TODO: add back protocol and server version
summary_info += {'spice support': config_host.has_key('CONFIG_SPICE')}
summary_info += {'rbd support': rbd.found()}