* [PATCH net] net: tls: set MSG_SPLICE_PAGES consistently
@ 2023-08-08 18:09 Jakub Kicinski
2023-08-08 20:58 ` Tariq Toukan
2023-08-10 18:50 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Jakub Kicinski @ 2023-08-08 18:09 UTC (permalink / raw)
To: davem
Cc: netdev, edumazet, pabeni, Jakub Kicinski, Tariq Toukan, borisp,
john.fastabend, dhowells
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.
Fixes: e117dcfd646e ("tls: Inline do_tcp_sendpages()")
Reported-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://lore.kernel.org/all/4c49176f-147a-4283-f1b1-32aac7b4b996@gmail.com/
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: borisp@nvidia.com
CC: john.fastabend@gmail.com
CC: dhowells@redhat.com
---
net/tls/tls_main.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/net/tls/tls_main.c b/net/tls/tls_main.c
index 7dbb8cd8f809..f550c84f3408 100644
--- a/net/tls/tls_main.c
+++ b/net/tls/tls_main.c
@@ -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);
--
2.41.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH net] net: tls: set MSG_SPLICE_PAGES consistently
2023-08-08 18:09 [PATCH net] net: tls: set MSG_SPLICE_PAGES consistently Jakub Kicinski
@ 2023-08-08 20:58 ` Tariq Toukan
2023-08-10 18:50 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Tariq Toukan @ 2023-08-08 20:58 UTC (permalink / raw)
To: Jakub Kicinski, davem
Cc: netdev, edumazet, pabeni, Tariq Toukan, borisp, john.fastabend,
dhowells
On 08/08/2023 21:09, Jakub Kicinski wrote:
> 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.
>
> Fixes: e117dcfd646e ("tls: Inline do_tcp_sendpages()")
> Reported-by: Tariq Toukan <tariqt@nvidia.com>
> Link: https://lore.kernel.org/all/4c49176f-147a-4283-f1b1-32aac7b4b996@gmail.com/
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> ---
> CC: borisp@nvidia.com
> CC: john.fastabend@gmail.com
> CC: dhowells@redhat.com
> ---
> net/tls/tls_main.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/net/tls/tls_main.c b/net/tls/tls_main.c
> index 7dbb8cd8f809..f550c84f3408 100644
> --- a/net/tls/tls_main.c
> +++ b/net/tls/tls_main.c
> @@ -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.
Tested-by: Tariq Toukan <tariqt@nvidia.com>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH net] net: tls: set MSG_SPLICE_PAGES consistently
2023-08-08 18:09 [PATCH net] net: tls: set MSG_SPLICE_PAGES consistently Jakub Kicinski
2023-08-08 20:58 ` Tariq Toukan
@ 2023-08-10 18:50 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-08-10 18:50 UTC (permalink / raw)
To: Jakub Kicinski
Cc: davem, netdev, edumazet, pabeni, tariqt, borisp, john.fastabend,
dhowells
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
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_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.
>
> [...]
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!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-08-10 18:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-08 18:09 [PATCH net] net: tls: set MSG_SPLICE_PAGES consistently Jakub Kicinski
2023-08-08 20:58 ` Tariq Toukan
2023-08-10 18:50 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).