diff options
| author | Gyutae Bae <gyutae.bae@navercorp.com> | 2026-01-12 12:45:16 +0900 |
|---|---|---|
| committer | Andrii Nakryiko <andrii@kernel.org> | 2026-01-16 14:51:23 -0800 |
| commit | 999b2395e3c32273dec98f811f0ab5c8a7441850 (patch) | |
| tree | 1709ec11eaebbc7273810951abd95a3a66fafd9d /kernel/crash_dump_dm_crypt.c | |
| parent | 4787eaf7c17131bf0cce93336f8f411f832ad05a (diff) | |
bpftool: Add 'prepend' option for tcx attach to insert at chain start
Add support for the 'prepend' option when attaching tcx_ingress and
tcx_egress programs. This option allows inserting a BPF program at
the beginning of the TCX chain instead of appending it at the end.
The implementation uses BPF_F_BEFORE flag which automatically inserts
the program at the beginning of the chain when no relative reference
is specified.
This change includes:
- Modify do_attach_tcx() to support prepend insertion using BPF_F_BEFORE
- Update documentation to describe the new 'prepend' option
- Add bash completion support for the 'prepend' option on tcx attach types
- Add example usage in the documentation
- Add validation to reject 'overwrite' for non-XDP attach types
The 'prepend' option is only valid for tcx_ingress and tcx_egress attach
types. For XDP attach types, the existing 'overwrite' option remains
available.
Example usage:
# bpftool net attach tcx_ingress name tc_prog dev lo prepend
This feature is useful when the order of program execution in the TCX
chain matters and users need to ensure certain programs run first.
Co-developed-by: Siwan Kim <siwan.kim@navercorp.com>
Signed-off-by: Siwan Kim <siwan.kim@navercorp.com>
Signed-off-by: Gyutae Bae <gyutae.bae@navercorp.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Reviewed-by: Quentin Monnet <qmo@kernel.org>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20260112034516.22723-1-gyutae.opensource@navercorp.com
Diffstat (limited to 'kernel/crash_dump_dm_crypt.c')
0 files changed, 0 insertions, 0 deletions
