[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250131192912.133796-15-ameryhung@gmail.com>
Date: Fri, 31 Jan 2025 11:28:53 -0800
From: Amery Hung <ameryhung@...il.com>
To: netdev@...r.kernel.org
Cc: bpf@...r.kernel.org,
daniel@...earbox.net,
andrii@...nel.org,
alexei.starovoitov@...il.com,
martin.lau@...nel.org,
kuba@...nel.org,
edumazet@...gle.com,
xiyou.wangcong@...il.com,
cong.wang@...edance.com,
jhs@...atatu.com,
sinquersw@...il.com,
toke@...hat.com,
jiri@...nulli.us,
stfomichev@...il.com,
ekarani.silvestre@....ufcg.edu.br,
yangpeihao@...u.edu.cn,
yepeilin.cs@...il.com,
ameryhung@...il.com,
ming.lei@...hat.com,
kernel-team@...a.com
Subject: [PATCH bpf-next v3 14/18] bpf: net_sched: Allow writing to more Qdisc members
From: Amery Hung <amery.hung@...edance.com>
Allow bpf qdisc to write to Qdisc->limit and Qdisc->q.qlen.
Signed-off-by: Amery Hung <amery.hung@...edance.com>
---
net/sched/bpf_qdisc.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/net/sched/bpf_qdisc.c b/net/sched/bpf_qdisc.c
index 2427343d8a10..b8f02ff8734e 100644
--- a/net/sched/bpf_qdisc.c
+++ b/net/sched/bpf_qdisc.c
@@ -68,6 +68,12 @@ static int bpf_qdisc_qdisc_access(struct bpf_verifier_log *log,
size_t end;
switch (off) {
+ case offsetof(struct Qdisc, limit):
+ end = offsetofend(struct Qdisc, limit);
+ break;
+ case offsetof(struct Qdisc, q) + offsetof(struct qdisc_skb_head, qlen):
+ end = offsetof(struct Qdisc, q) + offsetofend(struct qdisc_skb_head, qlen);
+ break;
case offsetof(struct Qdisc, qstats) ... offsetofend(struct Qdisc, qstats) - 1:
end = offsetofend(struct Qdisc, qstats);
break;
--
2.47.1
Powered by blists - more mailing lists