[SRU][N][O][PATCH 2/3] nvme-tcp: use sendpages_ok() instead of sendpage_ok()
Matthew Ruffell
matthew.ruffell at canonical.com
Thu Jan 30 01:26:42 UTC 2025
From: Ofir Gal <ofir.gal at volumez.com>
BugLink: https://bugs.launchpad.net/bugs/2093871
Currently nvme_tcp_try_send_data() use sendpage_ok() in order to disable
MSG_SPLICE_PAGES, it check the first page of the iterator, the iterator
may represent contiguous pages.
MSG_SPLICE_PAGES enables skb_splice_from_iter() which checks all the
pages it sends with sendpage_ok().
When nvme_tcp_try_send_data() sends an iterator that the first page is
sendable, but one of the other pages isn't skb_splice_from_iter() warns
and aborts the data transfer.
Using the new helper sendpages_ok() in order to disable MSG_SPLICE_PAGES
solves the issue.
Reviewed-by: Christoph Hellwig <hch at lst.de>
Reviewed-by: Hannes Reinecke <hare at suse.de>
Reviewed-by: Sagi Grimberg <sagi at grimberg.me>
Signed-off-by: Ofir Gal <ofir.gal at volumez.com>
Link: https://lore.kernel.org/r/20240718084515.3833733-3-ofir.gal@volumez.com
Signed-off-by: Jens Axboe <axboe at kernel.dk>
(cherry picked from commit 6af7331a70b4888df43ec1d7e1803ae2c43b6981)
Signed-off-by: Matthew Ruffell <matthew.ruffell at canonical.com>
---
drivers/nvme/host/tcp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c
index 6eeb96578d1b..e1db3b9914ed 100644
--- a/drivers/nvme/host/tcp.c
+++ b/drivers/nvme/host/tcp.c
@@ -1043,7 +1043,7 @@ static int nvme_tcp_try_send_data(struct nvme_tcp_request *req)
else
msg.msg_flags |= MSG_MORE;
- if (!sendpage_ok(page))
+ if (!sendpages_ok(page, len, offset))
msg.msg_flags &= ~MSG_SPLICE_PAGES;
bvec_set_page(&bvec, page, len, offset);
--
2.45.2
More information about the kernel-team
mailing list