Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp292246pxb; Tue, 12 Apr 2022 02:00:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyN5W5mFiSfLxDTAZL5QrEUzTsiamPwZ+hbxGen23VjlPuV+w6b17VBQNWoPzsX1ICyyQ5a X-Received: by 2002:a05:6a00:2402:b0:4e1:46ca:68bd with SMTP id z2-20020a056a00240200b004e146ca68bdmr3492683pfh.70.1649754014975; Tue, 12 Apr 2022 02:00:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649754014; cv=none; d=google.com; s=arc-20160816; b=v9dqSOyhc3Dub+AC5YPpD5Pb4iF0rwaGJ1t9Cjh8VclB/Opy3RFm2CyupRkvFKcVZm 5QYNSYp+Kjg80MNsaPZJ3J0lNgDansLlT1MkfLAfxYJ2sg7odmdcqLzmR1kbt3Rlr4Dq lhqnjbhxRSEO7QGKcuYQ96zkTvp0YH9Yb2Ql62Sbkh12J4yX7TtJiagZ826nn7qThe4q 5EiSm5B11K2K6AnSg8SZgF0edtJgsc1W6etAW7wRpaDRDnXn0cRw0+H9IHF386FuRnP9 hO+rB6Ss2MEUU8S84iSDgbZuYylU2J9yUgJjn9DHPYOcPozN+wszo3gzkWBZtsMAaxyc OufA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=OkGpjK3lEEesmUnCm2EhsfqwoaInVbAdd79OHVFPqT8=; b=THQ9ymLq/jULWj7R9QaFT9peE5E+ZYyrSCdykKfngtUHuvb9gHTVTej7UKOG378T3n YcsPnF07lAF8nTwL44634LZdj0vUXhsrp2Tuwuij3us834tdlbY/RO30fEIrNDR2/ryu EE/yxVcZdK2hBjM3Cg3VzxobNsPwV4SM9XVkxLNrCHj0e7B2/KIzJWOhJgruj+fdy0ko w8wb+eYiQNWmDMUeryckPJ/w0SvqRFlpVoZJ2KPW1I4q5pV5nw/oCRZ4IdANVJRD0pnY RS6o969v0Ddx3bWsowwCI/pfFAArqk9GldxYdMAVpQxuMnx0VDrFGjnLtEoIsoLCPFAH YCuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gVQ6tC1U; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cl13-20020a056a0032cd00b00505d9c44e97si2601659pfb.320.2022.04.12.01.59.52; Tue, 12 Apr 2022 02:00:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gVQ6tC1U; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348934AbiDKRjn (ORCPT + 99 others); Mon, 11 Apr 2022 13:39:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245622AbiDKRjm (ORCPT ); Mon, 11 Apr 2022 13:39:42 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D2312E080; Mon, 11 Apr 2022 10:37:28 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 3CFAEB817F4; Mon, 11 Apr 2022 17:37:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9F007C385A3; Mon, 11 Apr 2022 17:37:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649698645; bh=d11mO3LX2P3Rkje8lctEcN2DxY/GwNb0EftCmy3y2A8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gVQ6tC1UOcpoExzTBT2QIf5RCrpmKiltJrefElAQL7hOSnhMRzQzjHDBe7eL7sdxc 6B24ncMgQs10tbXz7S2VEJp90RdSbmBGjLrgbNtnyf/U+wPNZAbVeLnQneXhCpXW1Z Yenl5ORmVZ3JOvf4EcrJOYQ9ouqu8FaAwTFe5ZPYW8m0U0GSMDUShaCk6xf7A8PTBX d2X3baNLiOQSl8H6hZetYc9e/0N6xgxyHVfnUgIj+EYQD1gFkX4Eb21yNbI47nTtJu cgy3yApNWCHWcmwaTEw+nDdb7qgu289ymAHMpYDL9nlgxTiN8WrBA0qLFaeArLm+Nh gRI6F7Vr5dVfQ== Date: Mon, 11 Apr 2022 17:37:24 +0000 From: Eric Biggers To: Giovanni Cabiddu Cc: herbert@gondor.apana.org.au, linux-crypto@vger.kernel.org, qat-linux@intel.com, stable@vger.kernel.org, Mikulas Patocka , Marco Chiappero , Wojciech Ziemba Subject: Re: [PATCH v3 1/3] crypto: qat - use pre-allocated buffers in datapath Message-ID: References: <20220410194707.9746-1-giovanni.cabiddu@intel.com> <20220410194707.9746-2-giovanni.cabiddu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220410194707.9746-2-giovanni.cabiddu@intel.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Sun, Apr 10, 2022 at 08:47:05PM +0100, Giovanni Cabiddu wrote: > If requests exceed 4 entries buffers, memory is allocated dynamically. > > In addition, remove the CRYPTO_ALG_ALLOCATES_MEMORY flag from both aead > and skcipher alg structures. > There is nothing that says that algorithms can ignore !CRYPTO_ALG_ALLOCATES_MEMORY if there are too many scatterlist entries. See the comment above the definition of CRYPTO_ALG_ALLOCATES_MEMORY. If you need to introduce this constraint, then you will need to audit the users of !CRYPTO_ALG_ALLOCATES_MEMORY to verify that none of them are issuing requests that violate this constraint, then add this to the documentation comment for CRYPTO_ALG_ALLOCATES_MEMORY. - Eric