From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from huawei.com (unknown [45.249.212.255]) by dpdk.org (Postfix) with ESMTP id 260FB1B8F5 for ; Wed, 4 Apr 2018 18:46:47 +0200 (CEST) Received: from DGGEMM404-HUB.china.huawei.com (unknown [172.30.72.56]) by Forcepoint Email with ESMTP id 80F838034AB5E; Thu, 5 Apr 2018 00:46:42 +0800 (CST) Received: from DGGEMM424-HUB.china.huawei.com (10.1.198.41) by DGGEMM404-HUB.china.huawei.com (10.3.20.212) with Microsoft SMTP Server (TLS) id 14.3.361.1; Thu, 5 Apr 2018 00:46:42 +0800 Received: from DGGEMM505-MBS.china.huawei.com ([169.254.2.114]) by dggemm424-hub.china.huawei.com ([10.1.198.41]) with mapi id 14.03.0361.001; Thu, 5 Apr 2018 00:46:41 +0800 From: "Zhoujian (jay)" To: Fan Zhang , "dev@dpdk.org" CC: "maxime.coquelin@redhat.com" , "jianfeng.tan@intel.com" , "pawelx.wodkowski@intel.com" Thread-Topic: [PATCH v6 8/8] doc: update for vhost crypto support Thread-Index: AQHTzCHNW7EkBzqKhUKcGZy5pO4oBqPwz8Vg Date: Wed, 4 Apr 2018 16:46:41 +0000 Message-ID: References: <20180404100902.27637-1-roy.fan.zhang@intel.com> <20180404142504.31836-1-roy.fan.zhang@intel.com> <20180404142504.31836-9-roy.fan.zhang@intel.com> In-Reply-To: <20180404142504.31836-9-roy.fan.zhang@intel.com> Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.177.19.14] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-CFilter-Loop: Reflected Subject: Re: [dpdk-dev] [PATCH v6 8/8] doc: update for vhost crypto support 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: Wed, 04 Apr 2018 16:46:47 -0000 Hi Fan, > -----Original Message----- > From: Fan Zhang [mailto:roy.fan.zhang@intel.com] > Sent: Wednesday, April 04, 2018 10:25 PM > To: dev@dpdk.org > Cc: Zhoujian (jay) ; roy.fan.zhang@intel.com; > maxime.coquelin@redhat.com; jianfeng.tan@intel.com; > pawelx.wodkowski@intel.com > Subject: [PATCH v6 8/8] doc: update for vhost crypto support >=20 > Signed-off-by: Fan Zhang > --- > doc/guides/prog_guide/vhost_lib.rst | 25 ++++++++++ > doc/guides/rel_notes/release_18_05.rst | 5 ++ > doc/guides/sample_app_ug/index.rst | 1 + > doc/guides/sample_app_ug/vhost_crypto.rst | 82 > +++++++++++++++++++++++++++++++ > 4 files changed, 113 insertions(+) > create mode 100644 doc/guides/sample_app_ug/vhost_crypto.rst >=20 > diff --git a/doc/guides/prog_guide/vhost_lib.rst > b/doc/guides/prog_guide/vhost_lib.rst > index f47473609..04ab1eeb4 100644 > --- a/doc/guides/prog_guide/vhost_lib.rst > +++ b/doc/guides/prog_guide/vhost_lib.rst > @@ -160,6 +160,31 @@ The following is an overview of some key Vhost API > functions: >=20 > Receives (dequeues) ``count`` packets from guest, and stored them at > ``pkts``. >=20 > +* ``rte_vhost_crypto_create(vid, cryptodev_id, sess_mempool, > +socket_id)`` > + > + As an extension of new_device(), this function adds virtio-crypto > + workload acceleration capability to the device. All crypto workload > + is processed by DPDK cryptodev with the device ID of ``cryptodev_id``. > + > +* ``rte_vhost_crypto_free(vid)`` > + > + Frees the memory and vhost-user message handlers created in > + rte_vhost_crypto_create(). > + > +* ``rte_vhost_crypto_fetch_requests(vid, queue_id, ops, nb_ops)`` > + > + Receives (dequeues) ``nb_ops`` virtio-crypto requests from guest, > + parses them to DPDK Crypto Operations, and fills the ``ops`` with pars= ing > results. > + > +* ``rte_vhost_crypto_finalize_requests(queue_id, ops, nb_ops)`` > + > + After the ``ops`` are dequeued from Cryptodev, finalizes the jobs and > + notifies the guest(s). > + > +* ``rte_vhost_crypto_set_zero_copy(vid, option)`` > + > + Enable or disable zero copy feature of the vhost crypto backend. > + > Vhost-user Implementations > -------------------------- >=20 > diff --git a/doc/guides/rel_notes/release_18_05.rst > b/doc/guides/rel_notes/release_18_05.rst > index 9cc77f893..6451f8ea0 100644 > --- a/doc/guides/rel_notes/release_18_05.rst > +++ b/doc/guides/rel_notes/release_18_05.rst > @@ -58,6 +58,11 @@ New Features > * Added support for NVGRE, VXLAN and GENEVE filters in flow API. > * Added support for DROP action in flow API. >=20 > +* **Added crypto workload support to vhost library Please add the "**" end-string at the end of the line above. Regards, Jay > + > + New APIs are introduced in vhost library to enable virtio crypto > + support including session creation/deletion handling and translating > + virito-crypto request into DPDK crypto operations. A sample applicatio= n is > also introduced. >=20 > API Changes > ----------- > diff --git a/doc/guides/sample_app_ug/index.rst > b/doc/guides/sample_app_ug/index.rst > index e87afda80..57e8354d4 100644 > --- a/doc/guides/sample_app_ug/index.rst > +++ b/doc/guides/sample_app_ug/index.rst > @@ -44,6 +44,7 @@ Sample Applications User Guides > vmdq_dcb_forwarding > vhost > vhost_scsi > + vhost_crypto > netmap_compatibility > ip_pipeline > test_pipeline > diff --git a/doc/guides/sample_app_ug/vhost_crypto.rst > b/doc/guides/sample_app_ug/vhost_crypto.rst > new file mode 100644 > index 000000000..65c86a534 > --- /dev/null > +++ b/doc/guides/sample_app_ug/vhost_crypto.rst > @@ -0,0 +1,82 @@ > +.. SPDX-License-Identifier: BSD-3-Clause > + Copyright(c) 2017-2018 Intel Corporation. > + > +Vhost_Crypto Sample Application > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D > + > +The vhost_crypto sample application implemented a simple Crypto device, > +which used as the backend of Qemu vhost-user-crypto device. Similar > +with vhost-user-net and vhost-user-scsi device, the sample application > +used domain socket to communicate with Qemu, and the virtio ring was > +processed by vhost_crypto sample application. > + > +Testing steps > +------------- > + > +This section shows the steps how to start a VM with the crypto device > +as fast data path for critical application. > + > +Compiling the Application > +------------------------- > + > +To compile the sample application see :doc:`compiling`. > + > +The application is located in the ``examples`` sub-directory. > + > +Start the vhost_crypto example > +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > + > +.. code-block:: console > + > + ./vhost_crypto [EAL options] -- [--socket-file PATH] > + [--cdev-id ID] [--cdev-queue-id ID] [--zero-copy] > + [--guest-polling] > + > +where, > + > +* socket-file PATH: the path of UNIX socket file to be created, > +multiple > + instances of this config item is supported. Upon absence of this > +item, > + the default socket-file `/tmp/vhost_crypto1.socket` is used. > + > +* cdev-id ID: the target DPDK Cryptodev's ID to process the actual > +crypto > + workload. Upon absence of this item the default value of `0` will be u= sed. > + For details of DPDK Cryptodev, please refer to DPDK Cryptodev Library > + Programmers' Guide. > + > +* cdev-queue-id ID: the target DPDK Cryptodev's queue ID to process the > + actual crypto workload. Upon absence of this item the default value > +of `0` > + will be used. For details of DPDK Cryptodev, please refer to DPDK > +Cryptodev > + Library Programmers' Guide. > + > +* zero-copy: the presence of this item means the ZERO-COPY feature will > +be > + enabled. Otherwise it is disabled. PLEASE NOTE the ZERO-COPY feature > +is still > + in experimental stage and may cause the problem like segmentation > +fault. If > + the user wants to use LKCF in the guest, this feature shall be turned = off. > + > +* guest-polling: the presence of this item means the application > +assumes the > + guest works in polling mode, thus will NOT notify the guest > +completion of > + processing. > + > +The application requires that crypto devices capable of performing the > +specified crypto operation are available on application initialization. > +This means that HW crypto device/s must be bound to a DPDK driver or a > +SW crypto device/s (virtual crypto PMD) must be created (using --vdev). > + > +.. _vhost_crypto_app_run_vm: > + > +Start the VM > +~~~~~~~~~~~~ > + > +.. code-block:: console > + > + qemu-system-x86_64 -machine accel=3Dkvm \ > + -m $mem -object memory-backend-file,id=3Dmem,size=3D$mem,\ > + mem-path=3D/dev/hugepages,share=3Don -numa node,memdev=3Dmem \ > + -drive file=3Dos.img,if=3Dnone,id=3Ddisk \ > + -device ide-hd,drive=3Ddisk,bootindex=3D0 \ > + -chardev socket,id=3D{chardev_id},path=3D{PATH} \ > + -object cryptodev-vhost-user,id=3D{obj_id},chardev=3D{chardev_id= } \ > + -device virtio-crypto-pci,id=3D{dev_id},cryptodev=3D{obj_id} \ > + ... > + > +.. note:: > + You must check whether your Qemu can support "vhost-user-crypto" or = not. > -- > 2.13.6