From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boris Pismenny Subject: Re: [net-next v3 1/5] net/tls: Do not enable zero-copy prematurely Date: Thu, 19 Jul 2018 06:28:05 -0400 Message-ID: <1601b472-319e-f1c8-6a71-be883aa18bd2@mellanox.com> References: <20180719111643.12787-1-vakul.garg@nxp.com> <20180719111643.12787-2-vakul.garg@nxp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: aviadye@mellanox.com, davejwatson@fb.com, davem@davemloft.net To: Vakul Garg , netdev@vger.kernel.org Return-path: Received: from mail-eopbgr50072.outbound.protection.outlook.com ([40.107.5.72]:2209 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727512AbeGSLKv (ORCPT ); Thu, 19 Jul 2018 07:10:51 -0400 In-Reply-To: <20180719111643.12787-2-vakul.garg@nxp.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: Hi Vakul, On 7/19/2018 7:16 AM, Vakul Garg wrote: > Zero-copy mode was left enabled even when zerocopy_from_iter() failed. > Set the zero-copy mode only when zerocopy_from_iter() succeeds. This > leads to removal of argument 'zc' of function decrypt_skb_update(). > Function decrypt_skb_update() does not need to check whether > ctx->decrypted is set since it is never called if ctx->decrypted is > true. > This patch breaks our tls_device code for the following 2 reasons: 1. We need to disable zerocopy if the device decrypted the record, because decrypted data has to be copied to user buffers. 2. ctx->decrypted must be checked in decrypt_skb_update, because it might change after calling tls_device_decrypted.