mirror of
https://github.com/pavel-odintsov/fastnetmon
synced 2024-05-28 05:46:21 +02:00
Added cmake flag to disable XDP builds as libbpf on Ubuntu 22.04 is significantly out of sync with libbpf 1.x API and we have no plans to support it
This commit is contained in:
parent
75788631fe
commit
97567a051c
|
@ -213,7 +213,7 @@ jobs:
|
|||
- run: sudo docker exec --env DEBIAN_FRONTEND linux_docker apt-get install -y perl wget git cmake g++ make liblog4cpp5-dev libhiredis-dev libmongoc-dev libbpf-dev libgrpc++-dev libprotobuf-dev protobuf-compiler libcapnp-dev capnproto libssl-dev protobuf-compiler-grpc libncurses5-dev libpcap-dev pkg-config libboost-atomic-dev libboost-chrono-dev libboost-date-time-dev libboost-program-options-dev libboost-regex-dev libboost-system-dev libboost-thread-dev
|
||||
- run: sudo docker exec linux_docker git clone https://github.com/pavel-odintsov/fastnetmon.git
|
||||
- run: sudo docker exec linux_docker mkdir fastnetmon/src/build
|
||||
- run: sudo docker exec linux_docker cmake -S fastnetmon/src -B fastnetmon/src/build
|
||||
- run: sudo docker exec linux_docker cmake -S fastnetmon/src -B fastnetmon/src/build -DENABLE_AF_XDP_SUPPORT=FALSE
|
||||
- run: sudo docker exec linux_docker make -C fastnetmon/src/build -j
|
||||
build_debian:
|
||||
parameters:
|
||||
|
|
|
@ -368,6 +368,9 @@ else()
|
|||
endif()
|
||||
|
||||
|
||||
# It can be disabled using flag: -DENABLE_AF_XDP_SUPPORT=FALSE
|
||||
option(ENABLE_AF_XDP_SUPPORT "Enables build for AF_XDP" ON)
|
||||
|
||||
CHECK_CXX_SOURCE_COMPILES("
|
||||
#include <linux/if_xdp.h>
|
||||
int main() {
|
||||
|
@ -375,26 +378,16 @@ int main() {
|
|||
}
|
||||
" HAVE_AF_XDP)
|
||||
|
||||
# libbpf 1.x introduced plenty of API changes and we need to guess when we have support for it
|
||||
CHECK_CXX_SOURCE_COMPILES("
|
||||
#include <bpf/bpf.h>
|
||||
#include <bpf/libbpf.h>
|
||||
# If XDP build enabled then we need to confirm that system has support for it
|
||||
if (${ENABLE_AF_XDP_SUPPORT})
|
||||
|
||||
int main() {
|
||||
bpf_object__next_program(NULL, NULL);
|
||||
return 1;
|
||||
}
|
||||
" HAVE_LIBBPF1_API_SUPPORT)
|
||||
if (${HAVE_AF_XDP})
|
||||
message(STATUS "Your system has support for AF_XDP")
|
||||
else()
|
||||
message(STATUS "Your system does not support AF_XDP, disabled it")
|
||||
set (ENABLE_AF_XDP_SUPPORT FALSE)
|
||||
endif()
|
||||
|
||||
if (${HAVE_LIBBPF1_API_SUPPORT})
|
||||
message(STATUS "We have libbpf 1.x support")
|
||||
endif()
|
||||
|
||||
if (${HAVE_AF_XDP})
|
||||
message(STATUS "Your system has support for AF_XDP")
|
||||
set (ENABLE_AF_XDP_SUPPORT ON)
|
||||
else()
|
||||
message(STATUS "Your system does not support AF_XDP, disabled it")
|
||||
endif()
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue