* [PATCH] RDMA/siw: drop duplicate check_app_limited in siw_tcp_sendpages
@ 2026-09-24 7:39 Geliang Tang
2026-09-24 7:44 ` sashiko-bot
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Geliang Tang @ 2026-09-24 7:39 UTC (permalink / raw)
To: Bernard Metzler, Jason Gunthorpe, Leon Romanovsky
Cc: Geliang Tang, linux-rdma
From: Geliang Tang <tanggeliang@kylinos.cn>
After do_tcp_sendpages() was converted to use MSG_SPLICE_PAGES and
later inlined as direct tcp_sendmsg_locked() calls, callers that
previously needed an explicit tcp_rate_check_app_limited(sk) to cover
do_tcp_sendpages() no longer need it. tcp_sendmsg_locked() performs the
check on every path that queues data, making the outer call redundant.
The site changed here, siw_tcp_sendpages() in siw_qp_tx.c, holds the socket
lock and invokes tcp_sendmsg_locked() on every iteration. The early-return
paths in tcp_sendmsg_locked() that skip tcp_rate_check_app_limited() - the
MSG_ZEROCOPY allocation failure and MSG_FASTOPEN branches - return without
queueing any MSG_SPLICE_PAGES data, so there is no functional consequence
from omitting the outer check.
Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
---
Hi,
I'm Geliang from the MPTCP community. While developing "MPTCP sockmap" and
"MPTCP KTLS", I found this duplicate check_app_limited issue. I recently
submitted patches to remove it in BPF [1] and TLS [2], both of which have
been accepted. I noticed the same duplicate check_app_limited also exists
in siw_tcp_sendpages, so I'm sending this patch to remove it as well.
Thanks,
-Geliang
[1]
https://patchwork.kernel.org/project/netdevbpf/patch/1f7dc605b16fc0590f7cbf5a27d57271926c01ce.1790074764.git.tanggeliang@kylinos.cn/
[2]
https://patchwork.kernel.org/project/netdevbpf/patch/5bc803abb4e27054eaffc8b26db7812e6347b0dd.1789634247.git.tanggeliang@kylinos.cn/
---
drivers/infiniband/sw/siw/siw_qp_tx.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/infiniband/sw/siw/siw_qp_tx.c b/drivers/infiniband/sw/siw/siw_qp_tx.c
index f7dd32c6e5ba..56bd009879c2 100644
--- a/drivers/infiniband/sw/siw/siw_qp_tx.c
+++ b/drivers/infiniband/sw/siw/siw_qp_tx.c
@@ -336,7 +336,6 @@ static int siw_tcp_sendpages(struct socket *s, struct page **page, int offset,
if (size + offset <= PAGE_SIZE)
msg.msg_flags &= ~MSG_MORE;
- tcp_rate_check_app_limited(sk);
if (!sendpage_ok(page[i]))
msg.msg_flags &= ~MSG_SPLICE_PAGES;
bvec_set_page(&bvec, page[i], bytes, offset);
--
2.53.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] RDMA/siw: drop duplicate check_app_limited in siw_tcp_sendpages
2026-09-24 7:39 [PATCH] RDMA/siw: drop duplicate check_app_limited in siw_tcp_sendpages Geliang Tang
@ 2026-09-24 7:44 ` sashiko-bot
2026-09-24 14:53 ` Bernard Metzler
2026-09-29 18:38 ` Leon Romanovsky
2 siblings, 0 replies; 4+ messages in thread
From: sashiko-bot @ 2026-09-24 7:44 UTC (permalink / raw)
To: Geliang Tang; +Cc: linux-rdma
> From: Geliang Tang <tanggeliang@kylinos.cn>
>
> After do_tcp_sendpages() was converted to use MSG_SPLICE_PAGES and
> later inlined as direct tcp_sendmsg_locked() calls, callers that
> previously needed an explicit tcp_rate_check_app_limited(sk) to cover
> do_tcp_sendpages() no longer need it. tcp_sendmsg_locked() performs the
> check on every path that queues data, making the outer call redundant.
>
> The site changed here, siw_tcp_sendpages() in siw_qp_tx.c, holds the socket
> lock and invokes tcp_sendmsg_locked() on every iteration. The early-return
> paths in tcp_sendmsg_locked() that skip tcp_rate_check_app_limited() - the
> MSG_ZEROCOPY allocation failure and MSG_FASTOPEN branches - return without
> queueing any MSG_SPLICE_PAGES data, so there is no functional consequence
> from omitting the outer check.
>
> Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/32ef40cc81486adb8f2d43585224ab44d7e77f73.1790234916.git.tanggeliang@kylinos.cn?part=1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] RDMA/siw: drop duplicate check_app_limited in siw_tcp_sendpages
2026-09-24 7:39 [PATCH] RDMA/siw: drop duplicate check_app_limited in siw_tcp_sendpages Geliang Tang
2026-09-24 7:44 ` sashiko-bot
@ 2026-09-24 14:53 ` Bernard Metzler
2026-09-29 18:38 ` Leon Romanovsky
2 siblings, 0 replies; 4+ messages in thread
From: Bernard Metzler @ 2026-09-24 14:53 UTC (permalink / raw)
To: Geliang Tang, Jason Gunthorpe, Leon Romanovsky; +Cc: Geliang Tang, linux-rdma
On 24.09.2026 09:39, Geliang Tang wrote:
> From: Geliang Tang <tanggeliang@kylinos.cn>
>
> After do_tcp_sendpages() was converted to use MSG_SPLICE_PAGES and
> later inlined as direct tcp_sendmsg_locked() calls, callers that
> previously needed an explicit tcp_rate_check_app_limited(sk) to cover
> do_tcp_sendpages() no longer need it. tcp_sendmsg_locked() performs the
> check on every path that queues data, making the outer call redundant.
>
> The site changed here, siw_tcp_sendpages() in siw_qp_tx.c, holds the socket
> lock and invokes tcp_sendmsg_locked() on every iteration. The early-return
> paths in tcp_sendmsg_locked() that skip tcp_rate_check_app_limited() - the
> MSG_ZEROCOPY allocation failure and MSG_FASTOPEN branches - return without
> queueing any MSG_SPLICE_PAGES data, so there is no functional consequence
> from omitting the outer check.
>
> Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
> ---
> Hi,
>
> I'm Geliang from the MPTCP community. While developing "MPTCP sockmap" and
> "MPTCP KTLS", I found this duplicate check_app_limited issue. I recently
> submitted patches to remove it in BPF [1] and TLS [2], both of which have
> been accepted. I noticed the same duplicate check_app_limited also exists
> in siw_tcp_sendpages, so I'm sending this patch to remove it as well.
>
> Thanks,
> -Geliang
>
> [1]
> https://patchwork.kernel.org/project/netdevbpf/patch/1f7dc605b16fc0590f7cbf5a27d57271926c01ce.1790074764.git.tanggeliang@kylinos.cn/
> [2]
> https://patchwork.kernel.org/project/netdevbpf/patch/5bc803abb4e27054eaffc8b26db7812e6347b0dd.1789634247.git.tanggeliang@kylinos.cn/
> ---
> drivers/infiniband/sw/siw/siw_qp_tx.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/infiniband/sw/siw/siw_qp_tx.c b/drivers/infiniband/sw/siw/siw_qp_tx.c
> index f7dd32c6e5ba..56bd009879c2 100644
> --- a/drivers/infiniband/sw/siw/siw_qp_tx.c
> +++ b/drivers/infiniband/sw/siw/siw_qp_tx.c
> @@ -336,7 +336,6 @@ static int siw_tcp_sendpages(struct socket *s, struct page **page, int offset,
> if (size + offset <= PAGE_SIZE)
> msg.msg_flags &= ~MSG_MORE;
>
> - tcp_rate_check_app_limited(sk);
> if (!sendpage_ok(page[i]))
> msg.msg_flags &= ~MSG_SPLICE_PAGES;
> bvec_set_page(&bvec, page[i], bytes, offset);
Thank you Geliang, much appreciated.
Acked-by: Bernard Metzler <bernard.metzler@linux.dev>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] RDMA/siw: drop duplicate check_app_limited in siw_tcp_sendpages
2026-09-24 7:39 [PATCH] RDMA/siw: drop duplicate check_app_limited in siw_tcp_sendpages Geliang Tang
2026-09-24 7:44 ` sashiko-bot
2026-09-24 14:53 ` Bernard Metzler
@ 2026-09-29 18:38 ` Leon Romanovsky
2 siblings, 0 replies; 4+ messages in thread
From: Leon Romanovsky @ 2026-09-29 18:38 UTC (permalink / raw)
To: Bernard Metzler, Jason Gunthorpe, Geliang Tang; +Cc: linux-rdma, Geliang Tang
On Thu, 24 Sep 2026 15:39:19 +0800, Geliang Tang wrote:
> After do_tcp_sendpages() was converted to use MSG_SPLICE_PAGES and
> later inlined as direct tcp_sendmsg_locked() calls, callers that
> previously needed an explicit tcp_rate_check_app_limited(sk) to cover
> do_tcp_sendpages() no longer need it. tcp_sendmsg_locked() performs the
> check on every path that queues data, making the outer call redundant.
>
> The site changed here, siw_tcp_sendpages() in siw_qp_tx.c, holds the socket
> lock and invokes tcp_sendmsg_locked() on every iteration. The early-return
> paths in tcp_sendmsg_locked() that skip tcp_rate_check_app_limited() - the
> MSG_ZEROCOPY allocation failure and MSG_FASTOPEN branches - return without
> queueing any MSG_SPLICE_PAGES data, so there is no functional consequence
> from omitting the outer check.
>
> [...]
Applied, thanks!
[1/1] RDMA/siw: drop duplicate check_app_limited in siw_tcp_sendpages
https://git.kernel.org/rdma/rdma/c/ad91fd9e9440ab
Best regards,
--
Leon Romanovsky <leon@kernel.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-09-29 18:38 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-24 7:39 [PATCH] RDMA/siw: drop duplicate check_app_limited in siw_tcp_sendpages Geliang Tang
2026-09-24 7:44 ` sashiko-bot
2026-09-24 14:53 ` Bernard Metzler
2026-09-29 18:38 ` Leon Romanovsky
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox