BPF List
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Tushar Vyavahare" <tushar.vyavahare@intel.com>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH 4/5] selftests/xsk: Use umem_size() helper consistently
Date: Wed, 29 Apr 2026 08:47:42 +0000	[thread overview]
Message-ID: <20260429084743.22F87C19425@smtp.kernel.org> (raw)
In-Reply-To: <20260428080317.702124-5-tushar.vyavahare@intel.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The patch misses an open-coded calculation of the UMEM size in `testapp_unaligned_inv_desc_4001_frame()`, failing to fulfill the commit message's claim.
--

commit 55b162869fca46ad80bf9c4d74237ed3830d1f8e
Author: Tushar Vyavahare <tushar.vyavahare@intel.com>

selftests/xsk: Use umem_size() helper consistently

This commit replaces the remaining open-coded calculations of the UMEM
size with the umem_size() helper in test_xsk.c to centralize computation.

> diff --git a/tools/testing/selftests/bpf/prog_tests/test_xsk.c b/tools/testing/selftests/bpf/prog_tests/test_xsk.c
> index ea229ea446ca..ba4768f83eb6 100644
> --- a/tools/testing/selftests/bpf/prog_tests/test_xsk.c
> +++ b/tools/testing/selftests/bpf/prog_tests/test_xsk.c
> @@ -1581,7 +1581,7 @@ static int thread_common_ops(struct test_spec *test, struct ifobject *ifobject)
>  	int ret;
>  	u32 i;
>  
> -	umem_sz = umem->num_frames * umem->frame_size;
> +	umem_sz = umem_size(umem);
>  	mmap_flags = MAP_PRIVATE | MAP_ANONYMOUS | MAP_NORESERVE;

Since open-coded calculations are being replaced here, did this miss the
calculation in testapp_unaligned_inv_desc_4001_frame()?

tools/testing/selftests/bpf/prog_tests/test_xsk.c:testapp_unaligned_inv_desc_4001_frame() {
    ...
	page_size = sysconf(_SC_PAGESIZE);
	umem_size = test->ifobj_tx->xsk->umem->num_frames *
		test->ifobj_tx->xsk->umem->frame_size;
	assert(umem_size % page_size > MIN_PKT_SIZE);
    ...
}

Checking the subsequent patch in the series ('selftests/xsk: Introduce
mmap_size in umem struct'), it appears it does not resolve this missed
calculation either.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260428080317.702124-1-tushar.vyavahare@intel.com?part=4

  reply	other threads:[~2026-04-29  8:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-28  8:03 [PATCH 0/5] selftests/xsk: foundational UMEM refactoring Tushar Vyavahare
2026-04-28  8:03 ` [PATCH 1/5] selftests/xsk: Introduce helpers for setting UMEM properties Tushar Vyavahare
2026-04-28 10:28   ` bot+bpf-ci
2026-04-28 12:39     ` Vyavahare, Tushar
2026-04-29  8:47   ` sashiko-bot
2026-04-28  8:03 ` [PATCH 2/5] selftests/xsk: Eliminate umem reference from ifobject Tushar Vyavahare
2026-04-29  8:47   ` sashiko-bot
2026-04-28  8:03 ` [PATCH 3/5] selftests/xsk: Remove umem from pkt_generate parameters Tushar Vyavahare
2026-04-28  8:03 ` [PATCH 4/5] selftests/xsk: Use umem_size() helper consistently Tushar Vyavahare
2026-04-29  8:47   ` sashiko-bot [this message]
2026-04-28  8:03 ` [PATCH 5/5] selftests/xsk: Introduce mmap_size in umem struct Tushar Vyavahare
2026-04-29  8:47   ` sashiko-bot

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=20260429084743.22F87C19425@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=sashiko@lists.linux.dev \
    --cc=tushar.vyavahare@intel.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