Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3996479pxu; Mon, 30 Nov 2020 15:13:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJy0Nzp7mDGE4yr6vWAD3cXRQU2IMndEQomkgxHAqs4KGj77XpzysRfqc3TYjAcuhirQ23f3 X-Received: by 2002:a50:d784:: with SMTP id w4mr24280edi.201.1606778034066; Mon, 30 Nov 2020 15:13:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606778034; cv=none; d=google.com; s=arc-20160816; b=moFhzttfXzWadwYuhhD6ZzrhflzQ4R2sr1V7bPjiBwGeOrO/J/+vEc7A3zupSKKhMH PYCq9gJQJKlteaekMBdeMNdpfP4tvc0ghf7YsXww0vKYZzqlaTcDns2JEdFpl/yBNdy9 canV6tS04RuxjpsyJiyZpIZCMwz08q23qvPE8auKyIg3NFqut2n5h8i0wzMjZwNTEDqT prMpQWJ2ALeevgn1a6UD4sAIwDVsc/DzusGpL1idGhYmxJnMWroGVol8ouQT8qH6W5L5 SlgjA7RYT39GQynekleY4kTJ9hah/OuzNlWyV2m5zt2CvGrYkq/DF0qxN8h56+puMCiR l/BQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject:dkim-signature:dkim-filter; bh=AK15NssxzD6A2D+3MVj+qNsM1RLyB06njGR568+TK/Y=; b=TC1H4iMgtBcwvwRIgnQwvhaGp72URhJjbUxIFmLdzZsQJ6pujZxwURnW8p4+3vsQF8 3NbdQ4ugFAimqkDW3dDxmsiIOdeOn3u+KE/69ptKcPGTAT2we3MZHcku+5DME8P3UTPo CN4wURcHdubRoP0bhJsIBG0SgUl652WEM17pfBc/ajzaDocAF2xXE3CZhS+4R/pHfCk4 CKuapbS67q1/Qh9dW1TuAyQNGaQV9UMsIGNtN3JSxX7jk29yj8RsVR9pBSkUWpPQAPqJ CHCYPQcqnohe+fPC96AMpZVLLo+QDPOi0CVisiFOKKkwM4/ySBNnUUvlXRgTkSPf1djo cMpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@candelatech.com header.s=default header.b=r7fyhpkS; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=candelatech.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h7si11081473ejj.159.2020.11.30.15.13.19; Mon, 30 Nov 2020 15:13:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@candelatech.com header.s=default header.b=r7fyhpkS; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=candelatech.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388848AbgK3WyU (ORCPT + 99 others); Mon, 30 Nov 2020 17:54:20 -0500 Received: from mail2.candelatech.com ([208.74.158.173]:45312 "EHLO mail3.candelatech.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388847AbgK3WyT (ORCPT ); Mon, 30 Nov 2020 17:54:19 -0500 X-Greylist: delayed 339 seconds by postgrey-1.27 at vger.kernel.org; Mon, 30 Nov 2020 17:54:19 EST Received: from [192.168.254.6] (unknown [50.46.158.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail3.candelatech.com (Postfix) with ESMTPSA id 4709A13C2B0; Mon, 30 Nov 2020 14:47:59 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 mail3.candelatech.com 4709A13C2B0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=candelatech.com; s=default; t=1606776479; bh=ouvyFm6PapYOnUiuqySiexyIHG1eqaJbBpaBjVJqLiA=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=r7fyhpkSkqZVCcFlJ+vSOlpvIteRUD7VmfSOTbNXmDza74rgLVMZhvojdKaSzaViL JjFMnHoXUv4Uek5JYNv6oBzoNYq70MT+9n1/dC22ZzRf76ZITrNxGNEzeX9nC8VrUR dCNDbppOygrAgceAz3EC+fj0HuPT5vIAE2qGYCus= Subject: Re: [PATCH] crypto: aesni - add ccm(aes) algorithm implementation To: Ard Biesheuvel , linux-crypto@vger.kernel.org Cc: herbert@gondor.apana.org.au, Steve deRosier References: <20201129182035.7015-1-ardb@kernel.org> From: Ben Greear Organization: Candela Technologies Message-ID: <4e850713-af8b-f81f-bf3d-f4ee5185d99f@candelatech.com> Date: Mon, 30 Nov 2020 14:47:58 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20201129182035.7015-1-ardb@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-MW Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On 11/29/20 10:20 AM, Ard Biesheuvel wrote: > From: Steve deRosier > > Add ccm(aes) implementation from linux-wireless mailing list (see > http://permalink.gmane.org/gmane.linux.kernel.wireless.general/126679). > > This eliminates FPU context store/restore overhead existing in more > general ccm_base(ctr(aes-aesni),aes-aesni) case in MAC calculation. > > Suggested-by: Ben Greear > Co-developed-by: Steve deRosier > Signed-off-by: Steve deRosier > Signed-off-by: Ard Biesheuvel > --- > Ben, > > This is almost a rewrite of the original patch, switching to the new > skcipher API, using the existing SIMD helper, and drop numerous unrelated > changes. The basic approach is almost identical, though, so I expect this > to perform on par or perhaps slightly faster than the original. > > Could you please confirm with some numbers? I tried this on my apu2 platform, here is perf top during a TCP download using rx-sw-crypt (ie, the aesni cpu decrypt path): 18.77% [kernel] [k] acpi_idle_enter 14.68% [kernel] [k] kernel_fpu_begin 4.45% [kernel] [k] __crypto_xor 3.46% [kernel] [k] _aesni_enc1 Total throughput is 127Mbps or so. This is with your patch applied to 5.8.0+ kernel (it applied clean with 'git am') Is there a good way to verify at runtime that I've properly applied your patch? On my 5.4 kernel with the old version of the patch installed, I see 253Mbps throughput, and perf-top shows: 13.33% [kernel] [k] acpi_idle_do_entry 9.21% [kernel] [k] _aesni_enc1 4.49% [unknown] [.] 0x00007fbc3f00adb6 4.34% [unknown] [.] 0x00007fbc3f00adba 3.85% [kernel] [k] memcpy So, new patch is not working that well for me... Thanks, Ben -- Ben Greear Candela Technologies Inc http://www.candelatech.com