From: Ferruh Yigit Subject: Re: [PATCH v2] examples/vhost_crypto: fix zero copy Date: Fri, 16 Nov 2018 15:23:53 +0000 Message-ID: <87a8b3eb-eb39-1026-42a0-c903d0d229f3@intel.com> References: <20181030144852.43339-1-roy.fan.zhang@intel.com> <20181114111642.5526-1-roy.fan.zhang@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit To: Maxime Coquelin , Fan Zhang , dev@dpdk.org Return-path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 2675E2BB1 for ; Fri, 16 Nov 2018 16:23:57 +0100 (CET) In-Reply-To: Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 11/16/2018 10:48 AM, Maxime Coquelin wrote: > > > On 11/14/18 12:16 PM, Fan Zhang wrote: >> This patch fixes the zero copy enable problem for vhost crypto >> sample application. >> >> For some Crypto PMDs such as AESNI-MB and AESNI-GCM the data to >> be processed will be made a copy in the same buffer but next to the >> data. For example, to encrypt 64 bytes data the PMD will copy this >> data from offset 64 to offset 123. This requires the application >> provides the buffer with at least double of the data size. >> >> However there is no way for VMs to know this limitation. When >> zero-copy is enabled in Vhost the PMD may overwrite the buffer >> next to the VM data to be processed, and further cause problems >> such as Segmentation Fault or even worse, crashes the VM. >> >> To fix the problem the user should avoid enabling the zero copy >> for these Crypto PMDs. This patch adds the checking of the PMD >> names to see if zero copy can be applied. >> >> Fixes: 709521f4c2cd ("examples/vhost_crypto: support multi-core") >> >> Signed-off-by: Fan Zhang >> --- >> v2: >> - removed unecessary checks >> - Changed log message when zero-copy is not applicable. >> >> examples/vhost_crypto/main.c | 17 +++++++++++++++++ >> 1 file changed, 17 insertions(+) >> > > Reviewed-by: Maxime Coquelin Applied to dpdk-next-net/master, thanks.