Received: by 10.223.148.5 with SMTP id 5csp7154440wrq; Thu, 18 Jan 2018 01:27:39 -0800 (PST) X-Google-Smtp-Source: ACJfBou75i8yGhVn7qVCg6TDWtkiz+zcKO82HjEXsD1qoYp5AOveyxDxwiHs7CIbzCHtnNZyMOhG X-Received: by 10.84.133.47 with SMTP id 44mr13861635plf.65.1516267659395; Thu, 18 Jan 2018 01:27:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516267659; cv=none; d=google.com; s=arc-20160816; b=uccF02gl3kHi96Plxd8d/5GYFcl0QIICz55SrRFaeSI0ZSKVIydnsgXJmprvI67mWY tNTzRdTEX0j7Cf9eekJFi8jAqVXYErNjQpVy1Cffr9llx3qqZmR9lljoKvcRX3COygRX dNhPIrWnU9onZNF2FSbR+Yfwn/QO1seIxtzQYIlMxmePsFutP78GozWHvQpmXBC6Isc5 WOdNIoQRv4oJAFRRuSU/qApe/dXFaOCaOtSzzFbTp1/fDuV0rBuDjXFodtIiRm/taUpg 9Wk/mhG32GDwiXslTSLrum3agNndp/zlnHS5S2IOoz05Zei92ceeCY2FgG3DepZEoKLF PJlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=jE3dcEp5kZ6u8PH/v9zdMH+uzeJe2D4uUNzrny9AWk8=; b=qg9x0POrhRmSwa/85docHGklpwx5RBsFpEcmZyJxRTaex9RvRgJ8Sbr3T3aPFpwF0i 9gKesXsxrT0Cyq07uBiEMlcjmVYTXo+2Imtl6fqAap3IS2k6sNUPVvSFhGLAY7+moo/2 Jqid23m8nIeKSLbY2cRSJeJv1x4To4jsMPbVuvLr3N5bSf4hJkhDvqVuObWLcxjoInHH JpQ3K6hpUXptLpgP77//rZIfLfqCKzQUnHqs0G8D2Vvq+74D2FeB/bl6a0/Sj3kUykh+ twV564yJR/L0s4SMj/oGdRmDIP2BastOnqeQUYZJcdNgtDoLU35JCYk5SpwR+/X14tsB Zj9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=K3E/pSlx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s77si6433002pfa.172.2018.01.18.01.27.25; Thu, 18 Jan 2018 01:27:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=K3E/pSlx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932121AbeARI6T (ORCPT + 99 others); Thu, 18 Jan 2018 03:58:19 -0500 Received: from mail-lf0-f67.google.com ([209.85.215.67]:33784 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754976AbeARI6R (ORCPT ); Thu, 18 Jan 2018 03:58:17 -0500 Received: by mail-lf0-f67.google.com with SMTP id t139so10789627lff.0 for ; Thu, 18 Jan 2018 00:58:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=jE3dcEp5kZ6u8PH/v9zdMH+uzeJe2D4uUNzrny9AWk8=; b=K3E/pSlxK8S3pu7osvUJP0nrTAX3fj5SbNSM7/9j/Dka6D21/eyE1CPy6e9PStWZQ1 6F3OcdXnsU8sbEElf2LIIYDmMjg4nVDKiGQRo3sxdjXEjuK064oqq7y0qLIIlrv2XRSg SD7a2sDIvjiRkDHbUWzP87NECrOvvogNkXCKeEKbg0VaXFajICz9ip+qxLSxvZ50WPKd Y4McKL2T0LDqauWEO8DLi8JLVQMn6yWalrpgVNWybyHvPTwq8S5dhlORLLsZZtROcr7/ Du2mcoD1h5xzVzlRJ21g06uD4Z9d+PvlIkb6eQokaIMBHutnoJ/5CSntYOSZqxh90ptu ulCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=jE3dcEp5kZ6u8PH/v9zdMH+uzeJe2D4uUNzrny9AWk8=; b=m53y2Mcsr9QiVW9vy3j3zEdnESB7UnEN8mml6SUPjSa4padl5weIFYZP2TZ+AtyNsm /7CpT9CPPD9naY9Nn2p7MilPM1OpvyPa1dqIclXiwihxr7mq2yusQfjiczEebqY8RkC7 c24taWog1zsjCEFbO/D0tVpOAzzxpb5rax8E+2F5Ar3BS7zhQpW8Og2gK4G6PlQ8wqsK cpsZujYW+VyhHufywfQ4bdXE5Yc6PfLky0SZSfjp3A2sMftiPhFp5bBO/XgnVJLTgBUs irfs2p5+zR4rTKVZYHDSzSCennnkCVE1wbIiO6X6SZi4qtbxcbFDCQIiqIScz/V7lFXb 2ouQ== X-Gm-Message-State: AKwxytchH/bkvMdOB9SWKdFeZUeGapNwrCQZjfsFaFXLNAaUpA7y0N4n 0Fc4Mxu+0HS/th7cO/KCFpjjwB15 X-Received: by 10.25.201.81 with SMTP id z78mr12329122lff.74.1516265896312; Thu, 18 Jan 2018 00:58:16 -0800 (PST) Received: from Red ([2a01:cb1d:16e:1300:2e56:dcff:fed2:c6d6]) by smtp.googlemail.com with ESMTPSA id c76sm1153876lfh.35.2018.01.18.00.58.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jan 2018 00:58:15 -0800 (PST) Date: Thu, 18 Jan 2018 09:58:13 +0100 From: LABBE Corentin To: herbert@gondor.apana.org.au Cc: davem@davemloft.net, nhorman@tuxdriver.com, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, smueller@chronox.de Subject: Re: [PATCH 1/2] crypto: Implement a generic crypto statistics Message-ID: <20180118085813.GA1988@Red> References: <1515700617-3513-1-git-send-email-clabbe@baylibre.com> <3297958.ndliyBY1jk@tauon.chronox.de> <20180112090730.GA15630@Red> <16302559.hxlYq3rOsN@tauon.chronox.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <16302559.hxlYq3rOsN@tauon.chronox.de> User-Agent: Mutt/1.7.2 (2016-11-26) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 12, 2018 at 10:11:18AM +0100, Stephan Mueller wrote: > Am Freitag, 12. Januar 2018, 10:07:30 CET schrieb LABBE Corentin: > > > > > + __u64 stat_hash_tlen; > > > > > > > > }; > > > > > > What I am slightly unsure here is: how should user space detect whether > > > these additional parameters are part of the NETLINK_USER API or not? I > > > use that interface in my libkcapi whose binary may be used on multiple > > > different kernel versions. How should that library operate if one kernel > > > has these parameters and another does not? > > > > Userspace could check for kernel version and know if stat are present or > > not. Another way is to add a new netlink request. > > Well, I am not sure that checking the kernel version is good enough. Distros > and other vendors may backport this patch. This means that for some older > kernel versions this interface is present. > > Hence I would rather opt for a separate stat message where the user spacee > caller receives an error on kernels that does not support it. > Herbert, I have two way of adding a new netlink request - keep the current patch and simply add a new CRYPTO_MSG_GETSTAT which use the same function than CRYPTO_MSG_GETALG => minimal changes, in fact CRYPTO_MSG_GETSTAT and CRYPTO_MSG_GETALG would be the same, but it is easy for userspace to test presence of stat. - Create a new CRYPTO_MSG_GETSTAT which imply lot of code and add a new crypto_user_stat.c => this imply also to change makefile (rename crypto_user.c to crypto_user_base.c) since crypto_user.ko is made of two files. Which one do you prefer ? Regards