summaryrefslogtreecommitdiffstats
path: root/build/external/packages
diff options
context:
space:
mode:
authorYulong Pei <yulong.pei@intel.com>2023-01-05 02:26:32 +0000
committerBeno�t Ganne <bganne@cisco.com>2023-01-13 09:57:00 +0000
commitf9a17487982ebc231ad0f32f15f261453aef8a88 (patch)
treeedbfdc326ad1b0fc25f2efa083e94010c025c2a8 /build/external/packages
parent809eb669c7a353cd06da58ccdf8578053b1233ca (diff)
af_xdp: update af_xdp driver plugin to depend on libxdp
AF_XDP support is deprecated in libbpf since v0.7.0 [1], the libxdp library now provides the functionality which once was in libbpf, this commit updates af_xdp plugin to depend on libxdp, libbpf still remains a dependency even if libxdp is present, as it need use libbpf APIs for program loading. libxdp is distributed within xdp-tool [2], xdp-tools package also include libbpf in it as dependency, so here installed libxdp v1.2.9 and libbpf v0.8.0, both from xdp-tool-1.2.9 package. More information about libxdp compatibility can be found in the libxdp README [3]. In libbpf v0.8.0, The bpf_prog_load function was deprecated and changed to bpf_object__open_file and bpf_object__next_program and bpf_object__load, The bpf_get_link_xdp_id and bpf_set_link_xdp_fd functions were deprecated and changed to bpf_xdp_attach and bpf_xdp_detach, The bpf_object__unload function was deprecated and changed to bpf_object__close. [1] https://github.com/libbpf/libbpf/commit/277846bc6c15 [2] https://github.com/xdp-project/xdp-tools/releases/tag/v1.2.9 [3] https://github.com/xdp-project/xdp-tools/blob/master/lib/libxdp/README.org Type: improvement Change-Id: Ifbf6e3aa38bc6e0b77561f26311fd11c15ddb47e Signed-off-by: Yulong Pei <yulong.pei@intel.com>
Diffstat (limited to 'build/external/packages')
-rw-r--r--build/external/packages/libbpf.mk58
-rw-r--r--build/external/packages/xdp-tools.mk38
2 files changed, 38 insertions, 58 deletions
diff --git a/build/external/packages/libbpf.mk b/build/external/packages/libbpf.mk
deleted file mode 100644
index 78b1468991a..00000000000
--- a/build/external/packages/libbpf.mk
+++ /dev/null
@@ -1,58 +0,0 @@
-# Copyright (c) 2018 Cisco and/or its affiliates.
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at:
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LIBBPF_DEBUG?=n
-
-libbpf_version := 0.5.0
-libbpf_tarball := v$(libbpf_version).tar.gz
-libbpf_tarball_md5sum_0.2 := cd0f82d76a9830c1e66b1a249393d5a8
-libbpf_tarball_md5sum_0.5.0:= ba0a514d2775f033c24a6fec37e587bc
-libbpf_tarball_md5sum := $(libbpf_tarball_md5sum_$(libbpf_version))
-libbpf_tarball_strip_dirs := 1
-libbpf_url := https://github.com/libbpf/libbpf/archive/$(libbpf_tarball)
-
-LIBBPF_CFLAGS:=-g -Werror -Wall -fPIC -fvisibility=hidden
-ifeq ($(LIBBPF_DEBUG),y)
- LIBBPF_CFLAGS+= -O0
-else
- LIBBPF_CFLAGS+= -O2
-endif
-
-# check for libelf, zlib and kernel if_xdp.h presence
-LIBBPF_DEPS_CHECK:="\#include <linux/if_xdp.h>\\n\#include <gelf.h>\\n\#include <zlib.h>\\nint main(void){return 0;}"
-LIBBPF_DEPS_CHECK:=$(shell echo -e $(LIBBPF_DEPS_CHECK) | $(CC) -xc -lelf -lz -o /dev/null - > /dev/null 2>&1)
-LIBBPF_DEPS_CHECK:=$(.SHELLSTATUS)
-
-define libbpf_config_cmds
- @true
-endef
-
-define libbpf_build_cmds__
- BUILD_STATIC_ONLY=y OBJDIR='$(libbpf_build_dir)' PREFIX='' DESTDIR='$(libbpf_install_dir)' CFLAGS='$(LIBBPF_CFLAGS)' make -C '$(libbpf_src_dir)/src' $(1) > $(2)
-endef
-
-define libbpf_build_cmds
- $(call libbpf_build_cmds__,,$(libbpf_build_log))
-endef
-
-define libbpf_install_cmds
- $(call libbpf_build_cmds__,install,$(libbpf_install_log))
-endef
-
-ifneq ($(LIBBPF_DEPS_CHECK),0)
- $(warning "Missing libbpf dependencies. libbpf will be skipped.")
-libbpf-install:
- @true
-else
- $(eval $(call package,libbpf))
-endif
diff --git a/build/external/packages/xdp-tools.mk b/build/external/packages/xdp-tools.mk
new file mode 100644
index 00000000000..b65ae1361f5
--- /dev/null
+++ b/build/external/packages/xdp-tools.mk
@@ -0,0 +1,38 @@
+# Copyright (c) 2023 Intel and/or its affiliates.
+# Copyright (c) 2018 Cisco and/or its affiliates.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at:
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+xdp-tools_version := 1.2.9
+xdp-tools_tarball := xdp-tools-$(xdp-tools_version).tar.gz
+xdp-tools_tarball_md5sum_1.2.9:= 6e4a49ceea8354bb7bb3b55990e9aed7
+xdp-tools_tarball_md5sum := $(xdp-tools_tarball_md5sum_$(xdp-tools_version))
+xdp-tools_tarball_strip_dirs := 1
+xdp-tools_url := https://github.com/xdp-project/xdp-tools/releases/download/v$(xdp-tools_version)/$(xdp-tools_tarball)
+
+define xdp-tools_config_cmds
+ @true
+endef
+
+define xdp-tools_build_cmds
+ @cd ${xdp-tools_src_dir} && make V=1 BUILD_STATIC_ONLY=y > $(xdp-tools_build_log)
+endef
+
+define xdp-tools_install_cmds
+ @rm -f $(xdp-tools_install_log)
+ @cd ${xdp-tools_src_dir} && \
+ make -C lib/libbpf/src install V=1 BUILD_STATIC_ONLY=y PREFIX='' DESTDIR='$(xdp-tools_install_dir)' >> $(xdp-tools_install_log)
+ @cd ${xdp-tools_src_dir} && \
+ make libxdp_install V=1 BUILD_STATIC_ONLY=y PREFIX='' DESTDIR='$(xdp-tools_install_dir)' >> $(xdp-tools_install_log)
+endef
+
+$(eval $(call package,xdp-tools))