Re: [PATCH net-next v10 08/16] tls: Inline do_tcp_sendpages()

From: Tariq Toukan
Date: Thu Aug 03 2023 - 07:47:46 EST




On 26/07/2023 3:30, Jakub Kicinski wrote:
On Sun, 23 Jul 2023 09:35:56 +0300 Tariq Toukan wrote:
Hi Jakub, David,

We repro the issue on the server side using this client command:
$ wrk -b2.2.2.2 -t4 -c1000 -d5 --timeout 5s
https://2.2.2.3:20443/256000b.img

Port 20443 is configured with:
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256;
sendfile off;


Important:
1. Couldn't repro with files smaller than 40KB.
2. Couldn't repro with "sendfile on;"

In addition, we collected the vmcore (forced by panic_on_warn), it can
be downloaded from here:
https://drive.google.com/file/d/1Fi2dzgq6k2hb2L_kwyntRjfLF6_RmbxB/view?usp=sharing

This has no symbols :(

There is a small bug in this commit, we should always set SPLICE.
But I don't see how that'd cause the warning you're seeing.
Does your build have CONFIG_DEBUG_VM enabled?

-->8-------------------------

From: Jakub Kicinski <kuba@xxxxxxxxxx>
Date: Tue, 25 Jul 2023 17:03:25 -0700
Subject: 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.

... tags ...
Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
---
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 b6896126bb92..4a8ee2f6badb 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);

Hi Jakub,

When applying this patch, repro disappears! :)
Apparently it is related to the warning.
Please go on and submit it.

Tested-by: Tariq Toukan <tariqt@xxxxxxxxxx>

We are going to run more comprehensive tests, I'll let you know if we find anything unusual.

Regards,
Tariq