[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b6e7bbda97f45dcd0362ab99623d54db32742d9d.1741188826.git.skb99@linux.ibm.com>
Date: Wed, 5 Mar 2025 22:43:55 +0530
From: Saket Kumar Bhaskar <skb99@...ux.ibm.com>
To: bpf@...r.kernel.org, netdev@...r.kernel.org,
linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: ast@...nel.org, hbathini@...ux.ibm.com, andrii@...nel.org,
aleksander.lobakin@...el.com, daniel@...earbox.net,
davem@...emloft.net, kuba@...nel.org, hawk@...nel.org,
martin.lau@...ux.dev, eddyz87@...il.com, song@...nel.org,
yonghong.song@...ux.dev, john.fastabend@...il.com, kpsingh@...nel.org
Subject: [PATCH v2 1/2] bpf, test_run: Replace hardcoded page size with dynamic PAGE_SIZE in test_run
Replace fixed value 4096 with PAGE_SIZE for calculating the max_data_sz
in bpf_prog_test_run_xdp, which allows for a more accurate determination
of max_data_sz, considering different default page sizes across different
architectures.
Signed-off-by: Saket Kumar Bhaskar <skb99@...ux.ibm.com>
---
net/bpf/test_run.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/bpf/test_run.c b/net/bpf/test_run.c
index 7cb192cbd65f..c0d5bbf20098 100644
--- a/net/bpf/test_run.c
+++ b/net/bpf/test_run.c
@@ -1249,7 +1249,7 @@ int bpf_prog_test_run_xdp(struct bpf_prog *prog, const union bpf_attr *kattr,
headroom -= ctx->data;
}
- max_data_sz = 4096 - headroom - tailroom;
+ max_data_sz = PAGE_SIZE - headroom - tailroom;
if (size > max_data_sz) {
/* disallow live data mode for jumbo frames */
if (do_live)
--
2.43.5
Powered by blists - more mailing lists