From: "e.kubanski" <e.kubanski@partner.samsung.com>
To: linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Cc: bjorn@kernel.org, magnus.karlsson@intel.com,
maciej.fijalkowski@intel.com, jonathan.lemon@gmail.com,
"e.kubanski" <e.kubanski@partner.samsung.com>
Subject: [PATCH] xsk: Fix offset calculation in unaligned mode
Date: Wed, 9 Apr 2025 15:19:13 +0200 [thread overview]
Message-ID: <20250409131913.65179-1-e.kubanski@partner.samsung.com> (raw)
In-Reply-To: CGME20250409131930eucas1p22b304bf5924a9b3bc43a442d738ebef3@eucas1p2.samsung.com
Offset calculation in unaligned mode didn't
match previous behaviour.
Unaligned mode should pass offset only in
upper 16 bits, lower 48 bits should pass
only specific chunk location in umem.
pool->headroom was duplicated into offset
and address of the umem chunk.
Signed-off-by: Eryk Kubanski <e.kubanski@partner.samsung.com>
---
include/net/xsk_buff_pool.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/net/xsk_buff_pool.h b/include/net/xsk_buff_pool.h
index 7f0a75d6563d..b3699a848844 100644
--- a/include/net/xsk_buff_pool.h
+++ b/include/net/xsk_buff_pool.h
@@ -232,8 +232,8 @@ static inline u64 xp_get_handle(struct xdp_buff_xsk *xskb,
return orig_addr;
offset = xskb->xdp.data - xskb->xdp.data_hard_start;
- orig_addr -= offset;
offset += pool->headroom;
+ orig_addr -= offset;
return orig_addr + (offset << XSK_UNALIGNED_BUF_OFFSET_SHIFT);
}
--
2.34.1
next parent reply other threads:[~2025-04-09 13:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20250409131930eucas1p22b304bf5924a9b3bc43a442d738ebef3@eucas1p2.samsung.com>
2025-04-09 13:19 ` e.kubanski [this message]
2025-04-10 12:50 ` [PATCH] xsk: Fix offset calculation in unaligned mode Maciej Fijalkowski
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=20250409131913.65179-1-e.kubanski@partner.samsung.com \
--to=e.kubanski@partner.samsung.com \
--cc=bjorn@kernel.org \
--cc=jonathan.lemon@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maciej.fijalkowski@intel.com \
--cc=magnus.karlsson@intel.com \
--cc=netdev@vger.kernel.org \
/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