net: tls: set MSG_SPLICE_PAGES consistently
Subsystems (3)
Jakub Kicinski
maintainerPATCH 1/1 net: tls: set MSG_SPLICE_PAGES consistently
We used to change the flags for the last segment, because non-last segments had the MSG_SENDPAGE_NOTLAST flag set. That flag is no longer a thing so remove the setting.
Since flags most likely don't have MSG_SPLICE_PAGES set this avoids passing parts of the sg as splice and parts as non-splice. Before commit under Fixes we'd have called tcp_sendpage() which would add the MSG_SPLICE_PAGES.
Why this leads to trouble remains unclear but Tariq reports hitting the WARN_ON(!sendpage_ok()) due to page refcount of 0.
---
CC: [email protected]
CC: [email protected]
CC: [email protected]
--- net/tls/tls_main.c | 3 --- 1 file changed, 3 deletions(-)
net/tls/tls_main.c +0 -3
@@ -139,9 +139,6 @@ int tls_push_sg(struct sock *sk, ctx->splicing_pages = true;while (1 ) { -if (sg_is_last (sg)) - msg.msg_flags = flags; -/* is sending application-limited? */ tcp_rate_check_app_limited (sk); p =sg_page (sg);
Signature · 1 line
2.41.0
Quoted 30 lines · Jakub Kicinski
We used to change the flags for the last segment, because non-last segments had the
MSG_SENDPAGE_NOTLASTflag set. That flag is no longer a thing so remove the setting.Since flags most likely don't have
MSG_SPLICE_PAGESset this avoids passing parts of the sg as splice and parts as non-splice. Before commit under Fixes we'd have calledtcp_sendpage()which would add theMSG_SPLICE_PAGES.Why this leads to trouble remains unclear but Tariq reports hitting the WARN_ON(!sendpage_ok()) due to page refcount of 0.
Fixes e117dcfd646e ("tls: Inline do_tcp_sendpages()")Reported-by Tariq Toukan <[email protected]>Signed-off-by Jakub Kicinski <[email protected]>---
CC: [email protected]
CC: [email protected]
CC: [email protected]--- net/tls/tls_main.c | 3 --- 1 file changed, 3 deletions(-)net/tls/tls_main.c +0
-0
net/tls/tls_main.c int tls_push_sg(struct sock *sk, · line 144
Quoted 9 lines
net/tls/tls_main.c +0
-3@@ -139,9 +139,6 @@ int tls_push_sg(struct sock *sk, ctx->splicing_pages = true;while (1 ) { -if (sg_is_last (sg)) - msg.msg_flags = flags; -/* is sending application-limited? */ tcp_rate_check_app_limited (sk); p =sg_page (sg);
Thanks for your patch.
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 10 lines · On Tue, 8 Aug 2023 11:09:17 -0700 you wrote:
We used to change the flags for the last segment, because non-last segments had the
MSG_SENDPAGE_NOTLASTflag set. That flag is no longer a thing so remove the setting.Since flags most likely don't have
MSG_SPLICE_PAGESset this avoids passing parts of the sg as splice and parts as non-splice. Before commit under Fixes we'd have calledtcp_sendpage()which would add theMSG_SPLICE_PAGES.[...]
Here is the summary with links:
- [net] net: tls: set MSG_SPLICE_PAGES consistently
https://git.kernel.org/netdev/net/c/6b486676b41c
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html