Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2491496rdg; Mon, 16 Oct 2023 06:17:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFXaqkKE/pSRwbTZRYer6XweWRVuzNA1z411VR/5IaljhWd0M7nE5iXfzGi8tPZFvlQN6W2 X-Received: by 2002:a17:903:41c1:b0:1c3:c687:478c with SMTP id u1-20020a17090341c100b001c3c687478cmr45041108ple.8.1697462261425; Mon, 16 Oct 2023 06:17:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697462261; cv=none; d=google.com; s=arc-20160816; b=m+B+PJrGMwLl7Liq4gLrDcFzfMHBSEzE86yqQm54vFDh4eIEQ8VA/xWXJupSxKXQRm nk8tiGiyg615v30PIWJbNLrLyU5C8zBuKALBDk92VaskXhuxV8G570E6Cx01mA4CtBc1 kjysBSXRrBH7OyKNPisIc6VM7DAuA+Q3Pyq5W9Nkvv8opJId8OBCBzIYBnWkqw7TyMLW ToDOOsPGSvUpdCOK4NwiOIdvrKi0p/7lijhml4rs/ppXyBImheNb4Kd3XIZZVaYngzLN ejCHs1uONydm7Yz8r6SmvyeYfMowhJwx6PPiA8NN3wQqeinUfhLZmhc4OeQIdf207538 fNZQ== 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=Bh3+AgzPel++Li3i4cnaSQ7/7AOtdWQs4MXrIboRuuI=; fh=07Kyw/WhbVw/psscxGIEZaVV1O7Zz2CdEFvT3QCUZGg=; b=hNOL3xQFlX28MEliZ+pBuiJHN29Ukc4iVehn9pB4923+B/cmc43SIqaKMC0PSuoy2U PbecKNKbvAc9NJjXf8E0A7Myax43cc2ZGvJmF0BmdnkiKTPEy3i9DHrh9cBIkw5St7th k3v27Z4uf5ymRMB/JZEI0fjpI38z2sD2MJd1p71eYzEtHGw37XqsxCM0r9shD43mzmJZ ILUebtqpqPQFSOiPCI6gBiyAe2X1K8xPTbj53JmU/JgA/3RUO4IPrb3ea5pOg7hMo8xK S0yJe+KyYCL0Ia4eaQZN0h14+wrvb+rkCT2FgJWfVbSsoJgDiLBITPaFqicX+APHRaB5 7GNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b="FIDM8/5k"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id c12-20020a170902d48c00b001c5db1e47c3si6006107plg.553.2023.10.16.06.17.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 06:17:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b="FIDM8/5k"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 C374380B1235; Mon, 16 Oct 2023 06:17:38 -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 S233414AbjJPNRa (ORCPT + 99 others); Mon, 16 Oct 2023 09:17:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233445AbjJPNR2 (ORCPT ); Mon, 16 Oct 2023 09:17:28 -0400 Received: from mail-oo1-xc35.google.com (mail-oo1-xc35.google.com [IPv6:2607:f8b0:4864:20::c35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1B6B102 for ; Mon, 16 Oct 2023 06:17:26 -0700 (PDT) Received: by mail-oo1-xc35.google.com with SMTP id 006d021491bc7-57b83ff7654so349404eaf.1 for ; Mon, 16 Oct 2023 06:17:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20230601.gappssmtp.com; s=20230601; t=1697462246; x=1698067046; 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=Bh3+AgzPel++Li3i4cnaSQ7/7AOtdWQs4MXrIboRuuI=; b=FIDM8/5kZdjdRNyaOYo7ZqsYXQM9Fb0Iq85/g5ZEU5EeiPOiPFR3JoMQ1x5rIQ+0of 4r2m7qV+OUjEeiSjv/gtJKuLeyVxu9bU4dFMjguIKRVsednR3BiQh3RuVqSfhcwRARu/ lGYIJcROM+KTMzRsrDfNA4zFVOXUHG0OTbnmiNCmwf9u/lgC2f/yFUeSk62m3nNNclte gIJFOUeszgFhf0KUnT4DJGf6IyZPy5b5MURYg0QMhmJrd+SxXLvk6yfZiT/F3p9zHS/x IK19USNGJK5Kt9+nSH0ODthKiK0blcz2oRvFGergFqXxsdCDgCNEUpX/MT9Eg1WYTqJO TB+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697462246; x=1698067046; 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=Bh3+AgzPel++Li3i4cnaSQ7/7AOtdWQs4MXrIboRuuI=; b=gd8vgMwZKIzco7OIAZv5Ha/JmGYyYn3crqNJdcHlPFT8bjG4oJb156xBVVUTr3PjlO IwV31wuWIWRlatlhXrozjAUbiPuMvTWTxamBM0N0TXVDNLgb+zORN1J7qFiQIpxZLwi3 Ep29VcpuxFMZtY2SUQ/SJs6mUuK6dnO5FDDdL3dLvQDK4ZzDyyGcQp2opQSth1TwkTYV bdmvl1CAydn1cRbkczvygc27N4zFGKHJ/fX2wN+mBMp97U2KjNxUhs4xayH8kET/lmJ6 RXbdX7PucYftdFSoL18QHLNuk2lRfu7/qpmdW0ON3ETQfjHUMGRjUsXHWOMf16qj3US7 Cquw== X-Gm-Message-State: AOJu0YwrhLuuuwfJYZ/Zc+cCsKR1utICkYBKRsXq7GUPmTQa1jioJZWQ tpZpzhiWSXthoPY/a704cq0ajg== X-Received: by 2002:a05:6358:e908:b0:147:47f2:2d54 with SMTP id gk8-20020a056358e90800b0014747f22d54mr28008523rwb.0.1697462245823; Mon, 16 Oct 2023 06:17:25 -0700 (PDT) Received: from [192.168.1.136] ([198.8.77.194]) by smtp.gmail.com with ESMTPSA id x24-20020aa79ad8000000b006b341144ad0sm5760746pfp.102.2023.10.16.06.17.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 16 Oct 2023 06:17:24 -0700 (PDT) Message-ID: <50310b5e-7642-4ca1-a9e1-6d817d472131@kernel.dk> Date: Mon, 16 Oct 2023 07:17:23 -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> <20231016072646.GV3359458@pengutronix.de> From: Jens Axboe In-Reply-To: <20231016072646.GV3359458@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]); Mon, 16 Oct 2023 06:17:39 -0700 (PDT) On 10/16/23 1:26 AM, Sascha Hauer wrote: > On Fri, Oct 13, 2023 at 07:45:55AM -0600, Jens Axboe wrote: >> 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. > > I can confirm that this patch makes it work for me. I tested with both > software cryptd and also with my original CAAM encryption workload. > IORING_SETUP_SINGLE_ISSUER | IORING_SETUP_DEFER_TASKRUN is not needed. > Both my simple webserver and the original C++ Webserver from our > customer are now working without problems. OK, good to hear. I'm assuming you only change for sk_stream_wait_memory()? If you can reproduce, would be good to test. But i general none of them should hurt. FWIW, the reason why DEFER_TASKRUN wasn't fully solving it is because we'd also use TIF_NOTIFY_SIGNAL for creating new io-wq workers. So while task_work would not be the trigger for setting that condition, we'd still end up doing it via io-wq worker creation. > Do you think there is a chance getting this change upstream? I'm a bit > afraid the code originally uses signal_pending() instead of > task_sigpending() for a good reason. The distinction between signal_pending() and task_sigpending() was introduced with TIF_NOTIFY_SIGNAL. This isn't a case of networking needing to use signal_pending(), just that this is was originally the only aborting condition and now it's a bit too broad for some cases (like this one). -- Jens Axboe