import xdp-tools-1.2.0-1.el8
This commit is contained in:
parent
ff12c1e17b
commit
e90bac9462
2
.gitignore
vendored
2
.gitignore
vendored
@ -1 +1 @@
|
||||
SOURCES/xdp-tools-1.1.1.tar.gz
|
||||
SOURCES/xdp-tools-1.2.0.tar.gz
|
||||
|
@ -1 +1 @@
|
||||
cce9f7c3a5275a78056a88cf940413cce1e4776b SOURCES/xdp-tools-1.1.1.tar.gz
|
||||
4ea7e4c19f85d5c95730da9d101ba668f7af1a15 SOURCES/xdp-tools-1.2.0.tar.gz
|
||||
|
@ -1,42 +0,0 @@
|
||||
commit 98a7fdb7c820a8474c9a6d836f4551eac050bd54
|
||||
Author: Toke Høiland-Jørgensen <toke@redhat.com>
|
||||
Date: Wed Feb 10 16:28:57 2021 +0100
|
||||
|
||||
libxdp/README: Update documentation with support for incremental attach
|
||||
|
||||
Seems I forgot to update the libxdp documentation when adding support for
|
||||
incrementally attaching multiple programs. Fix that oversight and note the
|
||||
limitations in terms of kernel versions and dispatcher compatibility.
|
||||
|
||||
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
|
||||
|
||||
diff --git a/lib/libxdp/README.org b/lib/libxdp/README.org
|
||||
index 5a930813c7d9..045348bb1d9a 100644
|
||||
--- a/lib/libxdp/README.org
|
||||
+++ b/lib/libxdp/README.org
|
||||
@@ -76,13 +76,18 @@ metadata* section below). Because the loading process involves modifying the
|
||||
attach type of the program, the attach functions only work with =struct
|
||||
xdp_program= objects that have not yet been loaded into the kernel.
|
||||
|
||||
-Due to limitations in the kernel support, it is currently not possible to attach
|
||||
-another program to an already-attached list of programs. As such, the only way
|
||||
-to actually run multiple programs on a single interface is to attach them all at
|
||||
-the same time with =xdp_program__attach_multi()=. It is expected that this
|
||||
-restriction will be lifted in an upcoming kernel version, after which
|
||||
-=xdp_program__attach()= will simply add the program being loaded into the
|
||||
-existing chain of programs running on the interface.
|
||||
+When using the attach functions to attach to an interface that already has an
|
||||
+XDP program loaded, libxdp will attempt to add the program to the list of loaded
|
||||
+programs. However, this may fail, either due to missing kernel support, or
|
||||
+because the already-attached program was not loaded using a dispatcher
|
||||
+compatible with libxdp. If the kernel support for incremental attach (merged in
|
||||
+kernel 5.10) is missing, the only way to actually run multiple programs on a
|
||||
+single interface is to attach them all at the same time with
|
||||
+=xdp_program__attach_multi()=. If the existing program is not an XDP dispatcher,
|
||||
+that program will have to be detached from the interface before libxdp can
|
||||
+attach a new one. This can be done by calling =xdp_program__detach()= with a
|
||||
+reference to the loaded program; but note that this will of course break any
|
||||
+application relying on that other XDP program to be present.
|
||||
|
||||
* Program metadata
|
||||
|
@ -1,30 +0,0 @@
|
||||
commit 5fb355a7c9a1fdd5842c4b9dbd5e48ba6b767921
|
||||
Author: Toke Høiland-Jørgensen <toke@redhat.com>
|
||||
Date: Wed Feb 10 16:59:08 2021 +0100
|
||||
|
||||
xdp-filter: Check whether we have already been loaded
|
||||
|
||||
Now that we can attach multiple programs to an interface, xdp-filter will
|
||||
happily load itself multiple times on the same interface. Fix that by
|
||||
checking if it's already loaded before attempting a new load.
|
||||
|
||||
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
|
||||
|
||||
diff --git a/xdp-filter/xdp-filter.c b/xdp-filter/xdp-filter.c
|
||||
index 08cfd722e169..895dbd5750b2 100644
|
||||
--- a/xdp-filter/xdp-filter.c
|
||||
+++ b/xdp-filter/xdp-filter.c
|
||||
@@ -268,6 +268,13 @@ int do_load(const void *cfg, const char *pin_root_path)
|
||||
}
|
||||
features |= opt->policy_mode;
|
||||
|
||||
+ err = get_pinned_program(&opt->iface, pin_root_path, NULL, &p);
|
||||
+ if (!err) {
|
||||
+ pr_warn("xdp-filter is already loaded on %s\n", opt->iface.ifname);
|
||||
+ xdp_program__close(p);
|
||||
+ return EXIT_FAILURE;
|
||||
+ }
|
||||
+
|
||||
print_flags(featbuf, sizeof(featbuf), print_features, features);
|
||||
pr_debug("Looking for eBPF program with features %s\n", featbuf);
|
||||
|
@ -1,14 +1,12 @@
|
||||
Name: xdp-tools
|
||||
Version: 1.1.1
|
||||
Release: 2%{?dist}
|
||||
Version: 1.2.0
|
||||
Release: 1%{?dist}
|
||||
Summary: Utilities and example programs for use with XDP
|
||||
%global _soversion 1.1.0
|
||||
%global _soversion 1.2.0
|
||||
|
||||
License: GPLv2
|
||||
URL: https://github.com/xdp-project/%{name}
|
||||
Source0: https://github.com/xdp-project/%{name}/releases/download/v%{version}/xdp-tools-%{version}.tar.gz
|
||||
Patch0: xdp-tools-1.1.1-fix-libxdp-man-page.patch
|
||||
Patch1: xdp-tools-1.1.1-xdp-filter-load-check.patch
|
||||
|
||||
BuildRequires: libbpf-devel
|
||||
BuildRequires: elfutils-libelf-devel
|
||||
@ -89,6 +87,7 @@ export DATADIR='%{_datadir}'
|
||||
export HDRDIR='%{_includedir}/xdp'
|
||||
make install V=1
|
||||
cd $DESTDIR/$LIBDIR && ln -vs libxdp.so.%{_soversion} libxdp.so.1.0.0
|
||||
cd $DESTDIR/$LIBDIR && ln -vs libxdp.so.%{_soversion} libxdp.so.1.1.0
|
||||
|
||||
%files
|
||||
%{_sbindir}/xdp-filter
|
||||
@ -97,13 +96,15 @@ cd $DESTDIR/$LIBDIR && ln -vs libxdp.so.%{_soversion} libxdp.so.1.0.0
|
||||
%{_mandir}/man8/*
|
||||
%{_libdir}/bpf/xdpfilt_*.o
|
||||
%{_libdir}/bpf/xdpdump_*.o
|
||||
%{_libdir}/bpf/xsk_def_xdp_prog*.o
|
||||
%{_datadir}/xdp-tools/
|
||||
%license LICENSE
|
||||
%license LICENSES/*
|
||||
|
||||
%files -n libxdp
|
||||
%{_libdir}/libxdp.so.1
|
||||
%{_libdir}/libxdp.so.%{_soversion}
|
||||
%{_libdir}/libxdp.so.1.0.0
|
||||
%{_libdir}/libxdp.so.1.1.0
|
||||
%{_libdir}/bpf/xdp-dispatcher.o
|
||||
%{_mandir}/man3/*
|
||||
|
||||
@ -116,6 +117,12 @@ cd $DESTDIR/$LIBDIR && ln -vs libxdp.so.%{_soversion} libxdp.so.1.0.0
|
||||
%{_libdir}/pkgconfig/libxdp.pc
|
||||
|
||||
%changelog
|
||||
* Wed Jul 7 2021 Toke Høiland-Jørgensen <toke@redhat.com> 1.2.0-1
|
||||
- Upstream version bump
|
||||
|
||||
* Wed Feb 10 2021 Toke Høiland-Jørgensen <toke@redhat.com> 1.1.1-2
|
||||
- Fix depedency and patch two issues fixed upstream
|
||||
|
||||
* Wed Feb 3 2021 Toke Høiland-Jørgensen <toke@redhat.com> 1.1.1-1
|
||||
- Upstream version bump
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user