Skip to content

Commit

Permalink
net: tls: set MSG_SPLICE_PAGES consistently
Browse files Browse the repository at this point in the history
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: e117dcf ("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/
Tested-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://lore.kernel.org/r/20230808180917.1243540-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Jakub Kicinski committed Aug 10, 2023
1 parent 3e91b0e commit 6b48667
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions net/tls/tls_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 6b48667

Please sign in to comment.