From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 060F92BB1 for ; Fri, 16 Nov 2018 11:48:26 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 483F27BDA9; Fri, 16 Nov 2018 10:48:26 +0000 (UTC) Received: from [10.36.112.13] (unknown [10.36.112.13]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 85384600C2; Fri, 16 Nov 2018 10:48:25 +0000 (UTC) To: Fan Zhang , dev@dpdk.org References: <20181030144852.43339-1-roy.fan.zhang@intel.com> <20181114111642.5526-1-roy.fan.zhang@intel.com> From: Maxime Coquelin Message-ID: Date: Fri, 16 Nov 2018 11:48:23 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20181114111642.5526-1-roy.fan.zhang@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 16 Nov 2018 10:48:26 +0000 (UTC) Subject: Re: [dpdk-dev] [PATCH v2] examples/vhost_crypto: fix zero copy X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Nov 2018 10:48:27 -0000 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 Thanks! Maxime