Received: by 10.223.185.116 with SMTP id b49csp3960871wrg; Tue, 13 Feb 2018 10:24:12 -0800 (PST) X-Google-Smtp-Source: AH8x224fClI9beJnxdnVYJxacCP1NnVhJLsxkX0rQw+B5d+e/FHsu2nhNx4VCC5kp6X1HSDw4cnJ X-Received: by 10.99.99.66 with SMTP id x63mr1619272pgb.421.1518546252741; Tue, 13 Feb 2018 10:24:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518546252; cv=none; d=google.com; s=arc-20160816; b=IHvyUjqsk+ayN6do2Rx2FHoDIL89Cy7aCkq6uRMcgPZdaOS8zT+SQtC/AmytN9nPP1 JmxGckC93lYA5vwxmr5R0DPv4O3yBBkIGit+Et8Hnd+JUXhadTONwsmrMMTWYeqSp8mE PI82PN0hmlsFaROegBYEQSMCKg784FU/maclylIAl1MAe5Vt2L0fHSm7R2NTK/dyVE+w hKdASq5AMkgVxduDbEyra1t6dJ1tG5OGca7Ua7c53x/5eltVz0a0Nn7A5UQlUAv7e48B 2WNOnJ+fpjPkKIFJK18jf3cciHSTUnScfecdxocrQ8Dyr0j2BP+p0H43WWF3STQ0LIWM MJpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-signature:arc-authentication-results; bh=Nd1Nj68SMDkjA+zVG0f7VsiJvdtXoiLwvvq/kL2P73U=; b=q/V4q4e3HM37EFxD5gOmn7wVL4KRNwwD8axJY7U0xTKQpCVVkRyCddSbB72hAi2D15 lCFGgL4MOL/nGnirYlq/zy75cVq+2Et+HoP0ezZVSy6nVqlfqlPvMGPwjUKIfaKwWtzb AuL6GOq3+itzkdkgT/5ce7U3r4+pyuWBGxJz3XokFnSZerU6+7No0/mRUPY1JU+zDvl5 +zTKzeSKDFrWmKsXfiif15+aGVneNtDskD0ru3ufakaHm7dJqcYd9Q55UjWY4ihfnOYI /azagjAI7tpX+rk/+Tr8bRkcQfSz5ogeP+HCWb8bCk1Wan4SL+asEzb7szN5aeyeRxfZ Xkkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=rSocX8U/; dkim=fail header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=StkB5igR; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fb.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k3si4930569pgt.109.2018.02.13.10.23.57; Tue, 13 Feb 2018 10:24:12 -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=@fb.com header.s=facebook header.b=rSocX8U/; dkim=fail header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=StkB5igR; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fb.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965433AbeBMSXG (ORCPT + 99 others); Tue, 13 Feb 2018 13:23:06 -0500 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:40356 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965158AbeBMSXE (ORCPT ); Tue, 13 Feb 2018 13:23:04 -0500 Received: from pps.filterd (m0109334.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w1DIHNjo031956; Tue, 13 Feb 2018 10:22:36 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=facebook; bh=Nd1Nj68SMDkjA+zVG0f7VsiJvdtXoiLwvvq/kL2P73U=; b=rSocX8U/0mcicJKBV025Oyt09pNhhlVYxURX7hMyoGl3e8+OLZw9MqjFiladBPSybjVe Yo4EuVpzFkxcIFRQKokFEQZfsPQwLxDWZhFBtDbJx1iCZxIAw2ERiMxmDOMF65Z+CGWm lbO7i9PT8xZ1DJChH6s5BKD/FHrlCAGX/+4= Received: from maileast.thefacebook.com ([199.201.65.23]) by mx0a-00082601.pphosted.com with ESMTP id 2g44e806yf-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 13 Feb 2018 10:22:36 -0800 Received: from NAM03-CO1-obe.outbound.protection.outlook.com (192.168.183.28) by o365-in.thefacebook.com (192.168.177.33) with Microsoft SMTP Server (TLS) id 14.3.361.1; Tue, 13 Feb 2018 13:22:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.onmicrosoft.com; s=selector1-fb-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Nd1Nj68SMDkjA+zVG0f7VsiJvdtXoiLwvvq/kL2P73U=; b=StkB5igRkfWee2AMJ85VQ9KND8094hTzG4GazrDczQeJLjac+ts6kxuxmBzdIdCGOc4rbyUUldJbwsDKp8MIFU60yxjPWjYDypKKtUxt7TFlTmD8BTkpsHofn/XjaZHRJY+12msmVAgZZH3TNPq6S7l7tAe0pswP0AbMHnCJt7w= Received: from localhost (2620:10d:c090:200::4:5f28) by CY4PR15MB1752.namprd15.prod.outlook.com (10.174.53.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.485.10; Tue, 13 Feb 2018 18:22:13 +0000 Date: Tue, 13 Feb 2018 10:22:03 -0800 From: Dave Watson To: Junaid Shahid CC: Herbert Xu , Steffen Klassert , , "David S. Miller" , Hannes Frederic Sowa , Tim Chen , Sabrina Dubroca , , Stephan Mueller , Ilya Lesokhin Subject: Re: [PATCH 14/14] x86/crypto: aesni: Update aesni-intel_glue to use scatter/gather Message-ID: <20180213182203.GA2122@davejwatson-mba.local> References: <20180212195128.GA61087@davejwatson-mba.local> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.0 (2016-04-01) X-Originating-IP: [2620:10d:c090:200::4:5f28] X-ClientProxiedBy: SN6PR0102CA0020.prod.exchangelabs.com (52.132.112.161) To CY4PR15MB1752.namprd15.prod.outlook.com (10.174.53.142) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a6aa36b5-4e32-4d33-ebf7-08d5730eb484 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603307)(7153060)(7193020);SRVR:CY4PR15MB1752; X-Microsoft-Exchange-Diagnostics: 1;CY4PR15MB1752;3:0BUiCFHJf14nJA2TWGBCEIa7k5p6c4bJLdptUbyMHNv+LA1mz65qkkW7f3D48ks02pQNPdh+dGJnbFVUW6XRuVgrHKgfILylReZhQt8fLuVEifOSy6WKL4KfQcPE3b21cnIxJJJsVsObdz8yNM31TuIZt2l16uFo+XzCHuZlOfofmNONq/L1HrjpDBKHByGEvC0HU64fC+L7SSJyZgg3A1rB2WtWnu+3c3VJr3RZf2eT+XtrZBI9RkQwKgFyPNUY;25:mnycZsyX5kgK17QorWxZHdWt6bT9/qAo55SKt4Xn2GpIyP0Y3ilPnKJXPiM63xRli59Wqlc/c0NNtmyOq3j19cvnn35QKRaNk7p/NTD2MHJF54bYN5/qUcLj3tas5RSQy2TJs3HNkYYkQLK88tM/MKpEGAQ/npfo43YO5/9qhkDe/LyTzkPwsgvCTxBf2AkURpU4TRIGGDgU9BNY3/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dOZc+nFpw2/FPJ0nQB8+bD9ZKTBmXBnQ1KUxjFIR+i8F+fs7a7djq+nBpzLAazahCoKLVEQAqWzX7VBm6MYltBpJ/Quet9RA+VoRa6r4SUUoYdd5LRkoN/fAIUEywx1OICI3CtyqFv/JQzmgJ4C/ws6GTSLeGkhEVHBAn+kjS9CyYTL3KqnbATZFM X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(266576461109395); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040501)(2401047)(8121501046)(5005006)(3231101)(11241501184)(944501161)(3002001)(10201501046)(93006095)(93001095)(6041288)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011);SRVR:CY4PR15MB1752;BCL:0;PCL:0;RULEID:;SRVR:CY4PR15MB1752; X-Forefront-PRVS: 0582641F53 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6069001)(366004)(396003)(39860400002)(39380400002)(346002)(376002)(189003)(199004)(6916009)(2950100002)(8676002)(6666003)(68736007)(1076002)(47776003)(4326008)(6116002)(478600001)(5660300001)(33656002)(106356001)(23726003)(98436002)(25786009)(2906002)(7736002)(105586002)(52396003)(16586007)(54906003)(33896004)(229853002)(386003)(53546011)(76176011)(58126008)(53936002)(305945005)(76506005)(9686003)(6496006)(6246003)(59450400001)(83506002)(52116002)(86362001)(81166006)(81156014)(97736004)(7416002)(16526019)(186003)(6486002)(8936002)(316002)(50466002)(18370500001);DIR:OUT;SFP:1102;SCL:1;SRVR:CY4PR15MB1752;H:localhost;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; Received-SPF: None (protection.outlook.com: fb.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY4PR15MB1752;23:yr4QUY2Uhl8ELCfwCY1xLxXngcDSjScg2XvIkQVWE?= =?us-ascii?Q?Tsu2qxFFH9D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4=;24:j/YoOky4Q5KuuVVB0Zq9umonEh7vx6fgHCURMdPpZp0nzcUUY/FHS3PpUIlc9CWa5jFBevscAL5imj47Bc37R08zhBe03dlqrKOMAV3Te40=;7:eNPYRKzo4xBV0MCl9L/3CVYJZZXT+KJrum8Ibx3t46fqKNVPwz7tJUuuKV3//CIsu+phsuDHgzzvpCehnQPMu/vvGTRUoCyuZSAq3oCfQ/cLvheiVYVDsY2IisVZkF2fe7Rz+qQyMgE7QQ5MMdv1eESk3fTQyBWyAs9lP8gzWWfZpO8XjAGFpOSwuvACFnw0wIzrzKsLMqVrh07KSZbzxhDKeeIdGu1ftpGomJAuwmpnw0O8x3uduotsilO7AE9k SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CY4PR15MB1752;20:Xl4GkcxC9cVd194o0ZRzJDrgsMokP+prNoT3TY5DqbC7gX5XJIkSPtLN7c/Onlk6qNmw20FG9cpXA3N2IxFPzxA1xdmDYGTLP8OQ69Pp8l1gP85LkG7mLGolREb7U2xmUnAzZTmiF3i4NyzmKdbdTiWZXR0M3gDrYgRmiGw/76E= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Feb 2018 18:22:13.5952 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a6aa36b5-4e32-4d33-ebf7-08d5730eb484 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR15MB1752 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-02-13_10:,, signatures=0 X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/12/18 03:12 PM, Junaid Shahid wrote: > Hi Dave, > > > On 02/12/2018 11:51 AM, Dave Watson wrote: > > > +static int gcmaes_encrypt_sg(struct aead_request *req, unsigned int assoclen, > > + u8 *hash_subkey, u8 *iv, void *aes_ctx) > > > > +static int gcmaes_decrypt_sg(struct aead_request *req, unsigned int assoclen, > > + u8 *hash_subkey, u8 *iv, void *aes_ctx) > > These two functions are almost identical. Wouldn't it be better to combine them into a single encrypt/decrypt function, similar to what you have done for the assembly macros? > > > + if (((struct crypto_aes_ctx *)aes_ctx)->key_length != AES_KEYSIZE_128 || > > + aesni_gcm_enc_tfm == aesni_gcm_enc) { > > Shouldn't we also include a check for the buffer length being less than AVX_GEN2_OPTSIZE? AVX will not be used in that case either. Yes, these both sound reasonable. I will send a V2. Thanks!