[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240918074516.5697-2-zhoufeng.zf@bytedance.com>
Date: Wed, 18 Sep 2024 15:45:14 +0800
From: Feng zhou <zhoufeng.zf@...edance.com>
To: martin.lau@...ux.dev,
daniel@...earbox.net,
john.fastabend@...il.com,
ast@...nel.org,
andrii@...nel.org,
eddyz87@...il.com,
song@...nel.org,
yonghong.song@...ux.dev,
kpsingh@...nel.org,
sdf@...ichev.me,
haoluo@...gle.com,
jolsa@...nel.org,
davem@...emloft.net,
edumazet@...gle.com,
kuba@...nel.org,
pabeni@...hat.com,
mykolal@...com,
shuah@...nel.org,
geliang@...nel.org,
laoar.shao@...il.com
Cc: netdev@...r.kernel.org,
linux-kernel@...r.kernel.org,
bpf@...r.kernel.org,
linux-kselftest@...r.kernel.org,
yangzhenze@...edance.com,
wangdongdong.6@...edance.com,
zhoufeng.zf@...edance.com
Subject: [PATCH bpf-next v2 1/2] bpf: cg_skb add get classid helper
From: Feng Zhou <zhoufeng.zf@...edance.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@...edance.com>
---
net/core/filter.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/net/core/filter.c b/net/core/filter.c
index e4a4454df5f9..a4aa39b6dbba 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -8115,6 +8115,10 @@ 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;
+#endif
+#ifdef CONFIG_CGROUP_NET_CLASSID
+ case BPF_FUNC_skb_cgroup_classid:
+ return &bpf_skb_cgroup_classid_proto;
#endif
default:
return sk_filter_func_proto(func_id, prog);
--
2.30.2
Powered by blists - more mailing lists