diff mbox series

[RFC,8/8] net: temp hack for dmabuf page in __skb_datagram_iter()

Message ID 20231113130041.58124-9-linyunsheng@huawei.com (mailing list archive)
State RFC
Delegated to: Netdev Maintainers
Headers show
Series A possible proposal for intergating dmabuf to page pool | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Guessed tree name to be net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1136 this patch: 1136
netdev/cc_maintainers warning 3 maintainers not CCed: brauner@kernel.org lixiaoyan@google.com dhowells@redhat.com
netdev/build_clang fail Errors and warnings before: 19 this patch: 19
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 1163 this patch: 1163
netdev/checkpatch warning WARNING: Deprecated use of 'kmap', prefer 'kmap_local_page' instead WARNING: Missing commit description - Add an appropriate one WARNING: line length of 91 exceeds 80 columns
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Yunsheng Lin Nov. 13, 2023, 1 p.m. UTC
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
---
 net/core/datagram.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/net/core/datagram.c b/net/core/datagram.c
index 103d46fa0eeb..5556782ac658 100644
--- a/net/core/datagram.c
+++ b/net/core/datagram.c
@@ -436,7 +436,15 @@  static int __skb_datagram_iter(const struct sk_buff *skb, int offset,
 		end = start + skb_frag_size(frag);
 		if ((copy = end - offset) > 0) {
 			struct page *page = skb_frag_page(frag);
-			u8 *vaddr = kmap(page);
+			u8 *vaddr;
+
+			if ((page->pp_magic & ~0x3UL) == PP_SIGNATURE) {
+				struct page_pool_iov *ppiov = (struct page_pool_iov *)page;
+
+				page = ppiov->page;
+			}
+
+			vaddr = kmap(page);
 
 			if (copy > len)
 				copy = len;