mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Saket Kumar Bhaskar <skb99@linux.ibm.com>
To: bpf@vger.kernel.org, netdev@vger.kernel.org,
	linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: ast@kernel.org, hbathini@linux.ibm.com, andrii@kernel.org,
	aleksander.lobakin@intel.com, daniel@iogearbox.net,
	davem@davemloft.net, kuba@kernel.org, hawk@kernel.org,
	martin.lau@linux.dev, eddyz87@gmail.com, song@kernel.org,
	yonghong.song@linux.dev, john.fastabend@gmail.com,
	kpsingh@kernel.org
Subject: [PATCH v2 1/2] bpf, test_run: Replace hardcoded page size with dynamic PAGE_SIZE in test_run
Date: Wed,  5 Mar 2025 22:43:55 +0530	[thread overview]
Message-ID: <b6e7bbda97f45dcd0362ab99623d54db32742d9d.1741188826.git.skb99@linux.ibm.com> (raw)
In-Reply-To: <cover.1741188826.git.skb99@linux.ibm.com>

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@linux.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


  reply	other threads:[~2025-03-05 17:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-05 17:13 [PATCH v2 0/2] Fix xdp_adjust_frags_tail_grow selftest on powerpc Saket Kumar Bhaskar
2025-03-05 17:13 ` Saket Kumar Bhaskar [this message]
2025-03-05 17:13 ` [PATCH v2 2/2] selftests/bpf: Refactor xdp_adjust_tail selftest with dynamic sizing Saket Kumar Bhaskar
2025-03-07 15:24 ` [PATCH v2 0/2] Fix xdp_adjust_frags_tail_grow selftest on powerpc Venkat Rao Bagalkote
2025-03-11  4:32   ` Saket Kumar Bhaskar
2025-03-20  8:20   ` Saket Kumar Bhaskar

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=b6e7bbda97f45dcd0362ab99623d54db32742d9d.1741188826.git.skb99@linux.ibm.com \
    --to=skb99@linux.ibm.com \
    --cc=aleksander.lobakin@intel.com \
    --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=hawk@kernel.org \
    --cc=hbathini@linux.ibm.com \
    --cc=john.fastabend@gmail.com \
    --cc=kpsingh@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=netdev@vger.kernel.org \
    --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®