From: Martin KaFai Lau <martin.lau@linux.dev>
To: Feng zhou <zhoufeng.zf@bytedance.com>
Cc: daniel@iogearbox.net, john.fastabend@gmail.com, ast@kernel.org,
andrii@kernel.org, eddyz87@gmail.com, song@kernel.org,
yonghong.song@linux.dev, kpsingh@kernel.org, sdf@fomichev.me,
haoluo@google.com, jolsa@kernel.org, davem@davemloft.net,
edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
bpf@vger.kernel.org, yangzhenze@bytedance.com,
wangdongdong.6@bytedance.com
Subject: Re: [PATCH] bpf: cg_skb add get classid helper
Date: Thu, 15 Aug 2024 18:06:06 -0700 [thread overview]
Message-ID: <be4d3e00-de84-420b-9979-277ecc9df6ce@linux.dev> (raw)
In-Reply-To: <20240814095038.64523-1-zhoufeng.zf@bytedance.com>
On 8/14/24 2:50 AM, Feng zhou wrote:
> From: Feng Zhou <zhoufeng.zf@bytedance.com>
>
> At cg_skb hook point, can get classid for v1 or v2, allowing
> users to do more functions such as acl.
>
> Signed-off-by: Feng Zhou <zhoufeng.zf@bytedance.com>
> ---
> net/core/filter.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/net/core/filter.c b/net/core/filter.c
> index 78a6f746ea0b..d69ba589882f 100644
> --- a/net/core/filter.c
> +++ b/net/core/filter.c
> @@ -8111,6 +8111,12 @@ cg_skb_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)
> return &bpf_get_listener_sock_proto;
> case BPF_FUNC_skb_ecn_set_ce:
> return &bpf_skb_ecn_set_ce_proto;
> + case BPF_FUNC_get_cgroup_classid:
> + return &bpf_get_cgroup_classid_proto;
> +#endif
> +#ifdef CONFIG_CGROUP_NET_CLASSID
> + case BPF_FUNC_skb_cgroup_classid:
> + return &bpf_skb_cgroup_classid_proto;
With this bpf_skb_cgroup_classid_proto, is the above
bpf_get_cgroup_classid_proto necessary?
The cg_skb hook must have a skb->sk.
Please add a selftest and tag the subject with bpf-next.
pw-bot: cr
> #endif
> default:
> return sk_filter_func_proto(func_id, prog);
next prev parent reply other threads:[~2024-08-16 1:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-14 9:50 [PATCH] bpf: cg_skb add get classid helper Feng zhou
2024-08-16 1:06 ` Martin KaFai Lau [this message]
2024-08-19 4:25 ` [External] " Feng Zhou
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=be4d3e00-de84-420b-9979-277ecc9df6ce@linux.dev \
--to=martin.lau@linux.dev \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=eddyz87@gmail.com \
--cc=edumazet@google.com \
--cc=haoluo@google.com \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kpsingh@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sdf@fomichev.me \
--cc=song@kernel.org \
--cc=wangdongdong.6@bytedance.com \
--cc=yangzhenze@bytedance.com \
--cc=yonghong.song@linux.dev \
--cc=zhoufeng.zf@bytedance.com \
/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