mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Quentin Monnet <qmo@kernel.org>
To: gyutae.opensource@navercorp.com, bpf@vger.kernel.org,
	Daniel Borkmann <daniel@iogearbox.net>
Cc: linux-kernel@vger.kernel.org, Alexei Starovoitov <ast@kernel.org>,
	Andrii Nakryiko <andrii@kernel.org>,
	Martin KaFai Lau <martin.lau@linux.dev>,
	Eduard Zingerman <eddyz87@gmail.com>, Song Liu <song@kernel.org>,
	Yonghong Song <yonghong.song@linux.dev>,
	John Fastabend <john.fastabend@gmail.com>,
	KP Singh <kpsingh@kernel.org>,
	Stanislav Fomichev <sdf@fomichev.me>, Hao Luo <haoluo@google.com>,
	Jiri Olsa <jolsa@kernel.org>,
	Gyutae Bae <gyutae.bae@navercorp.com>,
	Siwan Kim <siwan.kim@navercorp.com>, Daniel Xu <dxu@dxuuu.xyz>,
	Jiayuan Chen <jiayuan.chen@linux.dev>,
	Tao Chen <chen.dylane@linux.dev>,
	Kumar Kartikeya Dwivedi <memxor@gmail.com>
Subject: Re: [PATCH v4] bpftool: Add 'prepend' option for tcx attach to insert at chain start
Date: Mon, 12 Jan 2026 10:20:37 +0000	[thread overview]
Message-ID: <b0a95722-23ed-4f1a-aeac-ded6983693b0@kernel.org> (raw)
In-Reply-To: <20260112034516.22723-1-gyutae.opensource@navercorp.com>

2026-01-12 12:45 UTC+0900 ~ gyutae.opensource@navercorp.com
> From: Gyutae Bae <gyutae.bae@navercorp.com>
> 
> 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>
> Reviewed-by: Quentin Monnet <qmo@kernel.org>
> ---
> Hi Quentin.
> 
> Thank you for the review! I have added the validation for 'overwrite'
> option as you suggested.
> 
> I used a whitelist approach (rejecting non-XDP types) rather than
> a blacklist approach (rejecting TCX types) to be consistent with the
> 'prepend' validation style and to ensure that any future attach types
> will also be rejected by default unless explicitly allowed.


Looks good, thank you!
Quentin

  reply	other threads:[~2026-01-12 10:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20251023093150.25411-1-gyutae.bae@navercorp.com>
2025-11-01 16:21 ` [PATCH] bpftool: Add 'head' " Quentin Monnet
2026-01-06  8:55   ` [PATCH v2] bpftool: Add 'prepend' " gyutae.opensource
2026-01-06 13:11     ` Daniel Borkmann
2026-01-07  2:29   ` [PATCH v3] " gyutae.opensource
2026-01-10  2:48     ` Quentin Monnet
2026-01-12  3:45   ` [PATCH v4] " gyutae.opensource
2026-01-12 10:20     ` Quentin Monnet [this message]
2026-01-14 14:19     ` Daniel Borkmann
2026-01-16 22:50     ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b0a95722-23ed-4f1a-aeac-ded6983693b0@kernel.org \
    --to=qmo@kernel.org \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=chen.dylane@linux.dev \
    --cc=daniel@iogearbox.net \
    --cc=dxu@dxuuu.xyz \
    --cc=eddyz87@gmail.com \
    --cc=gyutae.bae@navercorp.com \
    --cc=gyutae.opensource@navercorp.com \
    --cc=haoluo@google.com \
    --cc=jiayuan.chen@linux.dev \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kpsingh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=memxor@gmail.com \
    --cc=sdf@fomichev.me \
    --cc=siwan.kim@navercorp.com \
    --cc=song@kernel.org \
    --cc=yonghong.song@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®