Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1763227lqa; Mon, 29 Apr 2024 20:18:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXgql4tr0C/9ynFPNXkbhFc+AFfYammSA0w4kc0A9cz/o5bj37z82nv6/X2GtM7k51uf0xErvWONSVs9z9ZoV8fJaSr5Ggs/Pwvs+EY8g== X-Google-Smtp-Source: AGHT+IGaQ9DcdxGpasnrgVRKZiX0xdtUDXXywj0n16wxsRRz3r38M1U0q6ETYzG8B+D+s6fVUPfd X-Received: by 2002:a05:622a:1921:b0:437:bcac:a770 with SMTP id w33-20020a05622a192100b00437bcaca770mr16643516qtc.55.1714447136198; Mon, 29 Apr 2024 20:18:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714447136; cv=pass; d=google.com; s=arc-20160816; b=hr9k9tvG4NoKhv+RNBN72gnN6TNwGwB9+WM3k5fSNR+ACePWZ/1G7xtxdOB5ExV0D2 TooErcW3MHFpUPnSUl58AAXwBNZqCAEgum5xDdKWX9LCfyQ+vrlVNZP8fjuM4KcpD/N1 E90j3IRl/Oy3Ljc+pNVSHTQnVUOSaNSyQZEWH94R5ncpWxVSY94D1xsmNRcyIWbzSQc0 MVYD1nhVpwxegLS0l7TrsyXswipiotsgNSuAYkSzLrXt7Nx3ytdq2LkBrSNN5iCNsAHd AofnizTOzRWNIZe1QFvg0rnydky21Ub+F8XVDcD4D+6AM3j7WA9/uW6G/EdF5ZUqDaQO JmZA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=EJeIXItYdaaeSM0z+8PwgmXrYbm64ZYKZi+lZZeU/wA=; fh=yD66OKFn0Y0s2LNn6tehZGDLCoECFvw+jnjNMB1V+U0=; b=QZ9vOW81hcdl9Pte7x7Y1pc/F03o2V5c56JBUIu4Mh8Rw0S5XHEcCocbnB4KjsA9Y7 Nzi2TThUfhqkte+8UheTfxURJFa42M5l3L5yC7m9cHr5C/9PEMjTnhBr19XszdDJ/TfC CG/1cgEVTQSVDMeNt1D3T6a38m8cLzC/vHc3r7qp72ntVtE9QXlny3wiZLfAwV6fZxOO 9XhxLX3WktHEE0XAZMZKt/UunsREai6u3NGWHLiAiTyhq+eynYsIH7pXWngR2aon3u/f DQcS/PhbVPlwJ5VHTkWHGS7nEcMwKg1HlKZkd0jhqk4wLmECS7rfQqhzvEdzZBGsFYtU J79Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LuZn1koE; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-crypto+bounces-3943-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-3943-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id fb27-20020a05622a481b00b0043a42b98b5csi12743108qtb.434.2024.04.29.20.18.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 20:18:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-3943-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LuZn1koE; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-crypto+bounces-3943-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-3943-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id D56651C213F0 for ; Tue, 30 Apr 2024 03:18:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4A2CC101DE; Tue, 30 Apr 2024 03:18:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="LuZn1koE" X-Original-To: linux-crypto@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 07C0B101C4; Tue, 30 Apr 2024 03:18:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714447130; cv=none; b=lsJWxasPZmOt2/kUSKVfihAShJsy1lER5c3so+Q4/IDw0H9GvYmCt/hvBjQ8QBJwPdNITTJcjvAj7K1uwtA9dTyHv0eAeoj6hCoLJo9oBlLCYKo8SbVtS5jV9o4vD8ZAAc2rioUjcDcVAjbYp0SQttSm0spiFFofErv3EVdeweU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714447130; c=relaxed/simple; bh=jFpDU0vcTXdr0AsLdbKUE/E45SonMzpHUKonO6iy2VQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=UcOCacOUXWJDp/lylfLpuxEP61BBiSZAXdleUPgum8kaMQZg+aEzoO4RFPxdwe099Qbat/ayaC3RWlWXObwifRpQbQYGwgjuhKoE1SCyLvLGcFAeOgcNLVTMhPkjM9h8MSVB7RIMCx4o/IlJnedqS7Wn9XCutsuyTl7JC0lUQp4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LuZn1koE; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 70D4DC116B1; Tue, 30 Apr 2024 03:18:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714447129; bh=jFpDU0vcTXdr0AsLdbKUE/E45SonMzpHUKonO6iy2VQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LuZn1koErWxms/QDZXsWzaiYu3CyBpxnfB20cadUDPZLM9t+h+1Ngvt3b5rKhR3am 0WSEoHBI+Ig9nHB1XRPaKn561cAT+rtiu8qKd1q5G+7h6kSjeyD2BSwCjWpqMOfooc xi2wvmcs4d81xgpdNGnYLg1tGoGAhA2thgiKSpT24DQp6qYM98KWj8jnDzGARIACg0 KIImSkzb+CSGg9vnS5tE5U3QWIRGngkFCPknmHlVwPGjMVFNfa1rS3aU8vYdkRfJLk iE4M3cSQHjSgek3+F79vE3WtJbndjMJVmYYyN2UYO/z1PwmFaP7iTossxxI1obtT8x yVjoiGGSlev/g== Date: Mon, 29 Apr 2024 20:18:47 -0700 From: Eric Biggers To: Sergey Senozhatsky Cc: Herbert Xu , "David S. Miller" , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC] crypto: passing configuration parameters to comp algos Message-ID: <20240430031847.GB10165@sol.localdomain> References: <20240430030447.GE14947@google.com> Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240430030447.GE14947@google.com> On Tue, Apr 30, 2024 at 12:04:47PM +0900, Sergey Senozhatsky wrote: > Hi, > > We'd like to be able to pass algorithm-specific parameters to > comp backends. As of this moment, crypto usees hard-coded default > values and does not permit any run-time algorithm configuration, > which in some cases simply disables the most interesting functionality. > E.g. zstd can be configured to use a pre-trained (in the user-space) > compression dictionary, which significantly changes algorithms > characteristics. Another, obvious and trivial example, is algorithms > compression level. > > The problem is that we need to pass params to cra_init() function, > because for some algorithms that's the only place where configuration > can take place (e.g. zstd). Changing cra_init() to accept additional > `struct crypto_comp_params` looks to be a little intrusive so before > I write any patches I'd like to hear your thoughts. > Have you considered just using the zstd library () directly? Which kernel subsystem are you working on that uses compression? - Eric