Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp239666lqh; Thu, 30 May 2024 22:48:09 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWigrrz6mQgD/7WJThrzwpvqHVCZZ1BE7KBZee9KJoKDbPQ30FJ8xxE2i45hSe5W4JJz7AAQ+kdLYh1ifHq4a0b4SBjfUKqRL3hAyeFSw== X-Google-Smtp-Source: AGHT+IEqQxErFxzLfFsaLky0PGNe7Tu8D5I+wDcsZc9NnDoU6hmM8utulP2T0tbsEg6ETqA/bbsB X-Received: by 2002:a05:622a:4b0e:b0:43f:f4d2:dcc with SMTP id d75a77b69052e-43ff54ff7cfmr9677511cf.52.1717134489425; Thu, 30 May 2024 22:48:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717134489; cv=pass; d=google.com; s=arc-20160816; b=DhRf+Td5CpkV8opLD3ajd5burIxcnnOG44b7N1FSxUzwIIXOd8xELWbO0oaqzmFB2k GLVUr3kJcZwrzPXFulxgCAPWQx4obWwDdj3Z+T2BBpc4IXF+Bp2gaHiG288gJ6nLSljg OCT1SN8VShThkN8cZLLJnWpsobwKAfpHCtuBBTCYcpTXb5nc3UTXvty3tX/KAMmCGfXi KO6qoit3jmDtCoqdDmeiF2xfwHbZYndoHPRRozz4yd0146AR76agVdHFAG716TtjdOgy 7wg/x8pEtrgaDwhTOfN6fLZWkmEYr+Gn6SVNRHibacJxIJ6JgRESP144y3Di+UvU2Ywo fdGA== 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=0UJbNmaJFMgZpBYeZAlCzxirBsjEUPoVCwt43VjRfB4=; fh=7h10UUybZVzqtuQRgFLirrXdXyUJu6au1lspDNLcTO0=; b=dP4AJaX7O39UujPcqu6XmMPiyuSQAc/L8P0ivazjoHe9avYmO4Z4TnmnRq4YsM8Ym5 3Pv2TPT3q8cM6eXTiYM7szxAWj64JpyLpL+ndhwensG4Rw4vXnSPWhcILqI8A3dfY06e zRaN7ArpiSazNSvgQxQUKvUakCKMKETVdEFj+llzkXWjnVPLUZm3nIPPCVXei5lRBHRx 0OGMvl/NV91L9+53KL+pkF2wt3yXjaFIkMR2msWBWU0gqujPmQSbbYkzKrkgL2v9a10T NwyU9uQKEKed2TWO9WVmjamGZ+AQmAY7r0VAjMmJ0a3iR1vX2kyOowIQLVuY93Ie9rrG zmWg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=K52AJGvA; 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-4578-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4578-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d75a77b69052e-43ff23adf8asi13848361cf.66.2024.05.30.22.48.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 22:48:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-4578-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=K52AJGvA; 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-4578-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4578-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 119E11C20FD0 for ; Fri, 31 May 2024 05:48:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 71D1E3BBC9; Fri, 31 May 2024 05:48:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="K52AJGvA" X-Original-To: linux-crypto@vger.kernel.org Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) (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 DC0A228FD for ; Fri, 31 May 2024 05:48:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717134485; cv=none; b=Pld3gr1NI6pBoJDbMnT6pL6RxZ18cYXyc98P/p/xHfrf0uRNmFt0aKUGvPf5keS6KV8/JKHbVaNcG8Et1LaEJnub6MZMzW5SajvJLHZk1MHvzaKFNxV+ZFS/jHumOGC93Gx6/EXJkzpHC9iN0VGsnpS8z8sRwwd7iZJ6xGFuox4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717134485; c=relaxed/simple; bh=ObWTi6TFcadZUcq6ZxKbymBP8ZJdQ2ZSzmIPTwa/5SE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=tu2EaXXcHYYky40/l/u6JVmlDllJ3TELl58hte1xNItWYSqJGRm7x9/EavsGNmNHJCyRVfKRuIcQHVAct7Ny1ek0oe4Ns8xUJau1oRRjXTov9fbLCf9RnZdgVsVCghEPGNeiRC6WKWSMlr2bNATvObd3jq8kUIvnMlbmXSqMNvI= 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=K52AJGvA; arc=none smtp.client-ip=209.85.216.54 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-pj1-f54.google.com with SMTP id 98e67ed59e1d1-2c19e6dc3dcso1367941a91.3 for ; Thu, 30 May 2024 22:48:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1717134483; x=1717739283; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=0UJbNmaJFMgZpBYeZAlCzxirBsjEUPoVCwt43VjRfB4=; b=K52AJGvAElcSYLab4CUXHpk4s7Qc2Tuk4H5Z0cUPoBrjdcugy2ETeuMT+oNSGE6feY /ZkbcBt3WLZYquQNYa5DJQpBQayrXn2nLENF3G84DnFY2t0Kz4bZ5VzCsYrGokeCX0QA tXZgFwr15EE3uTF6yTFcCYei9B3BxlRouRWYw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717134483; x=1717739283; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=0UJbNmaJFMgZpBYeZAlCzxirBsjEUPoVCwt43VjRfB4=; b=JgTyfYtLRIUe7jVvzIsFvDq4TnJQm4vXkQ0xNPormMhi0HEVuwXkqnZzQKtfOu8xhH dJFWA0u+78Jmmx1hcUKn8M+08fmPlFT8yBQJ/R4DIK0SdmeQsVEVnj9IMnPc+eXBZcLb Eg7gu1Xwc2YJcsUhph0yWLUmGvVFcOKa5AnGJwuv83Eg4b4WvBwLIgV2ERgsmYyOmI8z 4trLFz65p5TG9Azt8PrN4C6Z4EdQ+S6p9KrNoM+c8vn5qcs0ajZgL1pW0I7Uas6YVZju nI6kGqAefrNvMHqXP2PTuZEWbpl+WKFiVHLAg6A0nbOclmGQFa/UYOtBCLHiHBa0pNUA ZmpA== X-Gm-Message-State: AOJu0Yz7CIJiJ+3uzSPjN33Tk6olYLWn89dDJADWkhwdWuVdlPS4P8Ot uxsOtQd1YtQPsJNutc1vW3czBQxpnGuIDqSKvIyDPoAp7ozxawAE0h2xRpckbPw/2lnJ1fwjXlo = X-Received: by 2002:a17:90b:84:b0:2c1:bb0c:9af5 with SMTP id 98e67ed59e1d1-2c1dc56c21bmr876480a91.1.1717134483049; Thu, 30 May 2024 22:48:03 -0700 (PDT) Received: from google.com ([2401:fa00:8f:203:b7f3:e557:e6df:620b]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2c1c28317ffsm690846a91.36.2024.05.30.22.48.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 22:48:02 -0700 (PDT) Date: Fri, 31 May 2024 14:47:59 +0900 From: Sergey Senozhatsky To: Herbert Xu Cc: Linux Crypto Mailing List , Sergey Senozhatsky Subject: Re: [PATCH 1/3] crypto: scomp - Add setparam interface Message-ID: <20240531054759.GE8400@google.com> References: <84523e14722d0629b2ee9c8e7e3c04aa223c5fb5.1716202860.git.herbert@gondor.apana.org.au> 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: <84523e14722d0629b2ee9c8e7e3c04aa223c5fb5.1716202860.git.herbert@gondor.apana.org.au> On (24/05/20 19:04), Herbert Xu wrote: [..] > +int crypto_scomp_setparam(struct crypto_scomp *tfm, const u8 *param, > + unsigned int len) > +{ > + struct scomp_alg *scomp = crypto_scomp_alg(tfm); > + int err; > + > + err = scomp->setparam(tfm, param, len); > + if (unlikely(err)) { > + scomp_set_need_param(tfm, scomp); > + return err; > + } > + > + crypto_scomp_clear_flags(tfm, CRYPTO_TFM_NEED_KEY); > + return 0; > +} Is the idea here that each compression driver will have its own structure for params? In other words, something like this? static int setup_tfm(...) { ... this_cpu->tfm = crypto_alloc_comp(name, 0, 0); if (!strcmp(name, "zstd")) { struct crypto_comp_param_zstd param; param.dict = ... param.cleve = ... crypto_scomp_setparam(tfm, ¶m, sizeof(param)); } if (!strcmp(name, "lz4")) { struct crupto_comp_param_lz4 param; ... } if (!strcmp(name, "lzo")) { struct crupto_comp_param_lzo param; ... } ... } Or should it be "struct crypto_comp_params param"?