Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C67644062A; Thu, 20 Aug 2026 17:50:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787248242; cv=none; b=VZ9dAjAGqnRrFk6ly/jsH8lnizYEde6zBOEtoySXZPBTzbesG1pOAvqV0sTHcLomE0u6S1KdSM3F7G7aYnsTxXZdiUzyXHcjZXBylNJNYkoWzg6JNen0cj0vQRIep3RL37wN/E14ChpYBERQRsk0Ftiwu0AJTKgOV0v7MJ03hqE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787248242; c=relaxed/simple; bh=k2t/q1+1di3C/67sHGhXnUqAtAAyf+Igel5DOHGs2mI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tyIH1uzir5/9eS50T8C3J7Dd+sFLugMfWzG6Qbmb4YkfghPvmqP3oJyrGtg5QjhhDTlkMeF+iQzcNMzIqAGhmmK2Wj5+ppq5EU0c9yV3tzvzZaueG5lzYL0Pu+WUvc+A6kk9W4xgsLcPkwtd2NcFQvNZ6hiSsLv7C5Fg7tYx16A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=zyaJYDmq; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="zyaJYDmq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9E9EC1F000E9; Thu, 20 Aug 2026 17:50:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1787248241; bh=qlrkqZQ1xJSY2YSHGgaSG8WdRgujRuaHc7isvb3Ym/8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=zyaJYDmqOHvb5fZuBe6MtjNJaLJ6AqZTsHdz2mGYi7fDBNVR6G8D2Jlbq5QnEXqsq dCitI+mGgZjHWqnZkQ013e/Sp5hTIsv7Y3FqW1UKwQm7WCi9Vr7NR0v7fvbCDoneqt K9+3/YfPR3zKgEV8JiRLJiUyRExYsAYdD5yoqtxI= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, David Howells , Bernard Metzler , Tom Talpey , Jason Gunthorpe , Leon Romanovsky , Jens Axboe , Matthew Wilcox , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.1 160/303] siw: Inline do_tcp_sendpages() Date: Thu, 20 Aug 2026 16:54:56 +0200 Message-ID: <20260820145258.108423784@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260820145253.200766705@linuxfoundation.org> References: <20260820145253.200766705@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: David Howells [ Upstream commit c2ff29e99a764769eb2ce3a1a5585013633ee9a6 ] do_tcp_sendpages() is now just a small wrapper around tcp_sendmsg_locked(), so inline it, allowing do_tcp_sendpages() to be removed. This is part of replacing ->sendpage() with a call to sendmsg() with MSG_SPLICE_PAGES set. Signed-off-by: David Howells Reviewed-by: Bernard Metzler Reviewed-by: Tom Talpey cc: Jason Gunthorpe cc: Leon Romanovsky cc: Jens Axboe cc: Matthew Wilcox Signed-off-by: Jakub Kicinski Stable-dep-of: 007800408002 ("espintcp: use sk_msg_free_partial to fix partial send") Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/sw/siw/siw_qp_tx.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) --- a/drivers/infiniband/sw/siw/siw_qp_tx.c +++ b/drivers/infiniband/sw/siw/siw_qp_tx.c @@ -313,7 +313,7 @@ static int siw_tx_ctrl(struct siw_iwarp_ } /* - * 0copy TCP transmit interface: Use do_tcp_sendpages. + * 0copy TCP transmit interface: Use MSG_SPLICE_PAGES. * * Using sendpage to push page by page appears to be less efficient * than using sendmsg, even if data are copied. @@ -324,20 +324,27 @@ static int siw_tx_ctrl(struct siw_iwarp_ static int siw_tcp_sendpages(struct socket *s, struct page **page, int offset, size_t size) { + struct bio_vec bvec; + struct msghdr msg = { + .msg_flags = (MSG_MORE | MSG_DONTWAIT | MSG_SENDPAGE_NOTLAST | + MSG_SPLICE_PAGES), + }; struct sock *sk = s->sk; - int i = 0, rv = 0, sent = 0, - flags = MSG_MORE | MSG_DONTWAIT | MSG_SENDPAGE_NOTLAST; + int i = 0, rv = 0, sent = 0; while (size) { size_t bytes = min_t(size_t, PAGE_SIZE - offset, size); if (size + offset <= PAGE_SIZE) - flags = MSG_MORE | MSG_DONTWAIT; + msg.msg_flags &= ~MSG_SENDPAGE_NOTLAST; tcp_rate_check_app_limited(sk); + bvec_set_page(&bvec, page[i], bytes, offset); + iov_iter_bvec(&msg.msg_iter, ITER_SOURCE, &bvec, 1, size); + try_page_again: lock_sock(sk); - rv = do_tcp_sendpages(sk, page[i], offset, bytes, flags); + rv = tcp_sendmsg_locked(sk, &msg, size); release_sock(sk); if (rv > 0) {