Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp970739rdg; Fri, 13 Oct 2023 06:46:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEQBUO0WMFLwBQUCQxLSqxJk7ZI6JNDv6/vi6KsypYrsnF8WVrhgsbFo965w/FZG6MVpSro X-Received: by 2002:a05:6a00:2d06:b0:690:41a1:9b67 with SMTP id fa6-20020a056a002d0600b0069041a19b67mr27476841pfb.9.1697204775366; Fri, 13 Oct 2023 06:46:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697204775; cv=none; d=google.com; s=arc-20160816; b=MTImppVdIq84VGGSfO7XPisC4qXE8dQdDOXDuJJ1lB8ovE82vPnlTqfyhX3TOF2fhk X6spv2ZLiwAAfcSR+54WdiRl5C7g5NXgQizHCIT3lLJ90JZa9srL9eeINzKDLaL7reqz uiFamDLSzETGgUubuRFqkeorIGVt4Jao6kiMTmya9PFCtqe07EdOg2bJHsvZX8D7hAIv 80A1t8F5nOfB79kh1zn0JkgbAhnXnN9+PbMFyXcrdLlhI04bIdrz0MLPIS5aZGWTtb0E y8t30bexpNvCZW/4pLM8e4rT3Otr1fAYTrLtQK/KPCfWLQuFvBhDAaMCdHG0dWXzQYDv RvtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=dy6cR2Hzs2fRj+jqX6DHkTEB1kpzFyCXP4UUU0j0bFE=; fh=07Kyw/WhbVw/psscxGIEZaVV1O7Zz2CdEFvT3QCUZGg=; b=sXJRWROOQqSHeOA8uMs8ZHpm5HPlAklGh8w2RH0WFYGPYJm/HkdGW0hTHg/ab/k29d CGd7NVbjhnL+CglMc8XqZMGLcTlcmTwZeyqczNJ+bjfTyRxf3rgeyaJac2M7b/UzysoN g9+jcgwB3T6HePmsgjcQ7VPFRm3UKGI1cuF62QSfget/r029rV8KIKy8zFXew5dO6lvr Tj0kvWtqLKr95NBt8bP6Y/1sw4XxeuBrDIUd4/iT/Pe8MA952cWpUm7TMJSA5m4p6zva NlaCqCwh9tJeT4QeeAjVWDUcJNX5SOmy4jnXDshHZNC8Ll85h2O5nbD+f/tdhqLLJhfY /3dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=n36tFI7R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id b2-20020a633402000000b00582f1f73c82si996806pga.381.2023.10.13.06.46.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 06:46:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=n36tFI7R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id AFC39801C02E; Fri, 13 Oct 2023 06:46:12 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232017AbjJMNqD (ORCPT + 99 others); Fri, 13 Oct 2023 09:46:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230160AbjJMNqA (ORCPT ); Fri, 13 Oct 2023 09:46:00 -0400 Received: from mail-io1-xd33.google.com (mail-io1-xd33.google.com [IPv6:2607:f8b0:4864:20::d33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D807C2 for ; Fri, 13 Oct 2023 06:45:57 -0700 (PDT) Received: by mail-io1-xd33.google.com with SMTP id ca18e2360f4ac-7a24c86aae3so29101739f.0 for ; Fri, 13 Oct 2023 06:45:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20230601.gappssmtp.com; s=20230601; t=1697204757; x=1697809557; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=dy6cR2Hzs2fRj+jqX6DHkTEB1kpzFyCXP4UUU0j0bFE=; b=n36tFI7RUEpCypQXtxDuyQFYulIBQv94NME8LYqJZ6k8NdiGShK3vSYFNhNE4KDp0d MTBFbe/rihyI+sRO2h3Ke+vOXttE4puJUJgF5znvYKqWlebleZPb9WkZQUbQ88R/qWI8 pdcN45J+yLWa+I3DjwvvEBvAbJTEVUUA5N41Ho+Y/Ni5/84tt5OtTR89OyPNJ7uBz0dB Z6M2ytm1mSw01Hokg+wlKPkeoN1ZTIdsH6k9VYhcBmLB8zsHLsFOYb9dGHq+oHuPg81+ b8mBzPYSirOx2ro7LTkOrTdDabv4egz4M9WoEajOAk6PduJMFXdzBanSuiN7EmLEeXL2 gjtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697204757; x=1697809557; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=dy6cR2Hzs2fRj+jqX6DHkTEB1kpzFyCXP4UUU0j0bFE=; b=VjCerOzI3ODrJGwLL5xwfBocehtBoA7t9bvMQHgY8LCHKfUab3dx9MllLpbsF+ZrbW zeDh5LnUUmcMe9+Vp+ppIRn56+d4FyCX+uopqGPFMvCU1n7c3tAca2nHWvRD3ayZlM+9 ILN5OqNwHHYIlz/q5IHon+MtdNkCufYlFNsFZBTpgM42Qs7gB7/wKpVqQ5w1DFpwUrxm J9CD1tC+o818tQwxUyralLlVNXDwu91r4AI5G/gb+bDCq797+AULvGF+qDKGt4IVMdfH ZnW7AKeVh6Ho0vTe9sUH3tQncD+bqmYwxi3tqXrrVt51nQ+m3CORZOkbSZI5156pw0Mn oYUg== X-Gm-Message-State: AOJu0YwQoRrSG41f0eqKSkLLqB2tUllFSSXGBdpZgFmKmxv217SExp6G CGM+7nN8bK+5/up7a0NUDUQSww== X-Received: by 2002:a92:dacd:0:b0:351:1ed0:5c6b with SMTP id o13-20020a92dacd000000b003511ed05c6bmr26491258ilq.3.1697204756852; Fri, 13 Oct 2023 06:45:56 -0700 (PDT) Received: from [192.168.1.94] ([96.43.243.2]) by smtp.gmail.com with ESMTPSA id em15-20020a0566384daf00b0042ff466c9bdsm4674760jab.127.2023.10.13.06.45.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 13 Oct 2023 06:45:56 -0700 (PDT) Message-ID: Date: Fri, 13 Oct 2023 07:45:55 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Problem with io_uring splice and KTLS Content-Language: en-US To: Sascha Hauer Cc: Boris Pismenny , netdev@vger.kernel.org, John Fastabend , linux-kernel@vger.kernel.org, io-uring@vger.kernel.org, kernel@pengutronix.de, Jakub Kicinski , Pavel Begunkov References: <20231010141932.GD3114228@pengutronix.de> <20231012133407.GA3359458@pengutronix.de> <20231013054716.GG3359458@pengutronix.de> From: Jens Axboe In-Reply-To: <20231013054716.GG3359458@pengutronix.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Fri, 13 Oct 2023 06:46:12 -0700 (PDT) On 10/12/23 11:47 PM, Sascha Hauer wrote: > On Thu, Oct 12, 2023 at 07:45:07PM -0600, Jens Axboe wrote: >> On 10/12/23 7:34 AM, Sascha Hauer wrote: >>> In case you don't have encryption hardware you can create an >>> asynchronous encryption module using cryptd. Compile a kernel with >>> CONFIG_CRYPTO_USER_API_AEAD and CONFIG_CRYPTO_CRYPTD and start the >>> webserver with the '-c' option. /proc/crypto should then contain an >>> entry with: >>> >>> name : gcm(aes) >>> driver : cryptd(gcm_base(ctr(aes-generic),ghash-generic)) >>> module : kernel >>> priority : 150 >> >> I did a bit of prep work to ensure I had everything working for when >> there's time to dive into it, but starting it with -c doesn't register >> this entry. Turns out the bind() in there returns -1/ENOENT. > > Yes, that happens here as well, that's why I don't check for the error > in the bind call. Nevertheless it has the desired effect that the new > algorithm is registered and used from there on. BTW you only need to > start the webserver once with -c. If you start it repeatedly with -c a > new gcm(aes) instance is registered each time. Gotcha - I wasn't able to trigger the condition, which is why I thought perhaps I was missing something. Can you try the below patch and see if that makes a difference? I'm not quite sure why it would since you said it triggers with DEFER_TASKRUN as well, and for that kind of notification, you should never hit the paths you have detailed in the debug patch. diff --git a/net/core/stream.c b/net/core/stream.c index f5c4e47df165..a9a196587254 100644 --- a/net/core/stream.c +++ b/net/core/stream.c @@ -67,7 +67,7 @@ int sk_stream_wait_connect(struct sock *sk, long *timeo_p) return -EPIPE; if (!*timeo_p) return -EAGAIN; - if (signal_pending(tsk)) + if (task_sigpending(tsk)) return sock_intr_errno(*timeo_p); add_wait_queue(sk_sleep(sk), &wait); @@ -103,7 +103,7 @@ void sk_stream_wait_close(struct sock *sk, long timeout) do { if (sk_wait_event(sk, &timeout, !sk_stream_closing(sk), &wait)) break; - } while (!signal_pending(current) && timeout); + } while (!task_sigpending(current) && timeout); remove_wait_queue(sk_sleep(sk), &wait); } @@ -134,7 +134,7 @@ int sk_stream_wait_memory(struct sock *sk, long *timeo_p) goto do_error; if (!*timeo_p) goto do_eagain; - if (signal_pending(current)) + if (task_sigpending(current)) goto do_interrupted; sk_clear_bit(SOCKWQ_ASYNC_NOSPACE, sk); if (sk_stream_memory_free(sk) && !vm_wait) -- Jens Axboe