From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dave Watson Subject: Re: [PATCH net-next][RFC] net/tls: Add support for async decryption of tls records Date: Wed, 15 Aug 2018 09:55:44 -0700 Message-ID: <20180815164548.ikdrxliwtmqdgt3c@davejwatson-mba.local> References: <20180814141758.4930-1-vakul.garg@nxp.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Cc: , , , To: Vakul Garg Return-path: Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:41528 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729481AbeHOTtR (ORCPT ); Wed, 15 Aug 2018 15:49:17 -0400 Content-Disposition: inline In-Reply-To: <20180814141758.4930-1-vakul.garg@nxp.com> Sender: netdev-owner@vger.kernel.org List-ID: On 08/14/18 07:47 PM, Vakul Garg wrote: > Incoming TLS records which are directly decrypted into user space > application buffer i.e. records which are decrypted in zero-copy mode > are submitted for async decryption. When the decryption cryptoapi > returns -EINPROGRESS, the next tls record is parsed and then submitted > for decryption. The references to records which has been sent for async > decryption are dropped. This happens in a loop for all the records that > can be decrypted in zero-copy mode. For records for which decryption is > not possible in zero-copy mode, asynchronous decryption is not used and > we wait for decryption crypto api to complete. > > For crypto requests executing in async fashion, the memory for > aead_request, sglists and skb etc is freed from the decryption > completion handler. The decryption completion handler wakesup the > sleeping user context. This happens when the user context is done > enqueueing all the crypto requests and is waiting for all the async > operations to finish. Since the splice() operation does not use > zero-copy decryption, async remains disabled for splice(). I found it a little hard to understand what you are trying to do based on the commit message. Reading the code, it looks like if the recv() spans multiple TLS records, we will start decryption on all of them, and only wait right before recv() returns, yes? This approach sounds great to me. Three of the selftests are failing for me: [ FAIL ] tls.recv_partial [ FAIL ] tls.recv_peek [ FAIL ] tls.recv_peek_multiple