Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1758783lqa; Mon, 29 Apr 2024 20:04:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUgCyazKMiO8D6Jwel1GXxfUSHgtvR5kuIkkcvAJgSR+914N1oMGCMHE+EuXtiUwS7xG112MXbcwFvIreC3Z+V4GYlLxW3c6UdWaeHPCw== X-Google-Smtp-Source: AGHT+IGMCTGMmG+yX0OPuD4jEWM4kjf8dqyzy4EEKaLxfuisUAoO+HzELxA0saFE2jPkuJ++XBbg X-Received: by 2002:a50:d602:0:b0:570:5b3d:91f with SMTP id x2-20020a50d602000000b005705b3d091fmr961171edi.23.1714446297354; Mon, 29 Apr 2024 20:04:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714446297; cv=pass; d=google.com; s=arc-20160816; b=sdYkl/EkPXH1E74RQ71ze+fKxfVhAwv2EhfVz5u0dzdu9TzKwO0w8SPUHNyMOpv1P9 rTAi+tXcNRE1EG4cN++6sWyaREMBlhd9gmWquww9GdidZxbAqmhe3a8Pg8kmUqx6++04 +pjf5AfuhbUFVI3Xvs3gAuR2J3VF+4gxZluyQZIiGrE40NkL/mSp9CGGC+4y3/Xs1qcX lAIofeNQjiSJChMPw8M/gE+/G/EWOPRGCLXt8I3fCzur2ko4+jf7O0WTE2afNxpyqaFC SjIEgdjGr5j8ejroeUBw9UfKqxtTFsWsGTLt4ITe64KwJjhhIyFAfIugwyuTNmFDfO7z h+8w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:subject:cc:to:from:date :dkim-signature; bh=8GmvV6P1saiYDGx6aEXWiDKEEjYyVwYItU/oo2t7qo8=; fh=KObLu2JDz4rRwuqbPVEgDtJeub89s1R5xw9+wX84VCI=; b=kMSKNsI4jpBTF35JX+/GwNBOg9hAC/16tCgPhT5PLOlZTBuxiMpeQMDleVORgSPaEK oHMsOZdDvAN4g32WMFTZ8CD/BFw6MrkxkB7ZZz1v22yxMLokgvpijjxledW54/PabiJg ox3zhI2U8IkOWbdF1ozW5E762B+PFR4f0UV11bJtsqq7HDh5m4uyJaDyK+fVEnMH9qk0 XkrunS4fAe+pBfnU1i1NveuM9B8LymVD4rGH7zvEinjBKvjHD2ovA1O7da0Nf8LFk9EJ 8Y9uuE6YBmCMpGWz90mwEA3tmIP2fsvNfUTjI3MNRrLXPbEP1s46Leeo74yGP8xXVT7X 8Bug==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=mkGoDDhD; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-crypto+bounces-3940-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-crypto+bounces-3940-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id y10-20020a056402358a00b00572709cac19si3331544edc.407.2024.04.29.20.04.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 20:04:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-3940-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=mkGoDDhD; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-crypto+bounces-3940-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-crypto+bounces-3940-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.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 am.mirrors.kernel.org (Postfix) with ESMTPS id A464A1F22274 for ; Tue, 30 Apr 2024 03:04:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 91F99F9D6; Tue, 30 Apr 2024 03:04:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="mkGoDDhD" X-Original-To: linux-crypto@vger.kernel.org Received: from mail-oi1-f182.google.com (mail-oi1-f182.google.com [209.85.167.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F2B41DF6B for ; Tue, 30 Apr 2024 03:04:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714446294; cv=none; b=Sj3Clk/Zm/CKJmU+OZnq2mvDGH19SdBCt22sAoJ5Ohl9LvYmLSFYX0q7REhoov880qklnaT8a9o4OWNtSBXWq8cVNhS2M8d4AjQ+UrmKH9iLyPeWWPhWIA0PHC9wzhmEBFTfIwrcYwI7QkYrNmlRdXd0GmIPZACqubNVNN2MZak= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714446294; c=relaxed/simple; bh=S3dcFG9nl2arKz/OB2xphR0OKK1uAoMU8ChtHy95lPU=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=addD7Oh3M/FriyAxgFyjqt38CYpVfZJ7UrD32W+Np0N0dXJEjhmScIG/5iXHXAcI1QNKLuWTuuL2K/Z+/eLmnTa8//cbM0jdNMR05UlFck2bV2v72t10Plg5UuoJJCEI3Ouc7yZsUk1Mm9UEvAeFh5oKfDBj2hlHTrXpQoEBAuc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=mkGoDDhD; arc=none smtp.client-ip=209.85.167.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-oi1-f182.google.com with SMTP id 5614622812f47-3c74fd6fb92so3551625b6e.3 for ; Mon, 29 Apr 2024 20:04:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714446292; x=1715051092; darn=vger.kernel.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=8GmvV6P1saiYDGx6aEXWiDKEEjYyVwYItU/oo2t7qo8=; b=mkGoDDhDbcMXpOtD/awIvRX4i+T7K/WTxQ0BZp0TQ+JNGgYl+1gbIM/hrM4st3dhQ8 SkFJRwxtRDWd2A4VTjLpBk8p7fGivV0yd9DbKMyHgDeD3zQ1JwDx4wA4a88thHVT1u+O AQ1G33mQsFMpbMyzADAjCqmtZSscC4wNcEw94= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714446292; x=1715051092; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=8GmvV6P1saiYDGx6aEXWiDKEEjYyVwYItU/oo2t7qo8=; b=xNmsjSKFKR6gON2fUBhB7DDYln8xKY/ftH+B6fVud8wvYi+2uFfuqb0+OieAI0uLxt PfgBaCl8gs4RfR9RwHytSPr7KpY0E8B+1ZJIdkW22l97hbZw41i/27CIPVRF5Myhl6Lq Ix5RCtefRnL5GROA74itR+fnHP9YPiuPR1MHRI24w11wP2+LJKYECzpd+80VNLKAW0kV VRu6is3Obiuey6MnsLbDiuAXSc7F0nKb0awwULkNnSaRl61/5OipqrRIC9pkImWhbxsW wWMFgi2FMiHIlG1JM5bA9vXfvMGGjFDUvNniycCRdzZcspEBqrn1k7Nfv2hP1DojN99P 0RzQ== X-Gm-Message-State: AOJu0YzNIIFKyZGF5EdXdXMDz0h04qHI/sekq42DoDpw2Jx0b7b8mtUy POTP4z/R1SRQ4l0iit2bs8LKawPGEoDDSVly83fj58kyZHYEYLrEuZkBqiYffg== X-Received: by 2002:a05:6808:4c8:b0:3c7:3af6:1cb5 with SMTP id a8-20020a05680804c800b003c73af61cb5mr13307260oie.46.1714446292049; Mon, 29 Apr 2024 20:04:52 -0700 (PDT) Received: from google.com ([2401:fa00:8f:203:e55f:86cd:c9e1:6daf]) by smtp.gmail.com with ESMTPSA id g7-20020a632007000000b005e83b64021fsm19850926pgg.25.2024.04.29.20.04.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 20:04:51 -0700 (PDT) Date: Tue, 30 Apr 2024 12:04:47 +0900 From: Sergey Senozhatsky To: Herbert Xu , "David S. Miller" Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC] crypto: passing configuration parameters to comp algos Message-ID: <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 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.