DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jay Zhou <jianjay.zhou@huawei.com>
To: <dev@dpdk.org>
Cc: <pablo.de.lara.guarch@intel.com>, <roy.fan.zhang@intel.com>,
	<thomas@monjalon.net>, <arei.gonglei@huawei.com>,
	<xin.zeng@intel.com>, <weidong.huang@huawei.com>,
	<wangxinxin.wang@huawei.com>, <longpeng2@huawei.com>,
	<jianjay.zhou@huawei.com>
Subject: [dpdk-dev] [PATCH v2 0/7] crypto: add virtio poll mode driver
Date: Sat, 24 Feb 2018 21:14:28 +0800	[thread overview]
Message-ID: <cover.1519477564.git.jianjay.zhou@huawei.com> (raw)

This patch series introduce virtio crypto poll mode driver.

Since it is limited by the backend of the virtio-crypto,
this patch series only supports a limited subset of crypto services.
Only the following algorithms are tested:

Cipher algorithms:
  - RTE_CRYPTO_CIPHER_AES_CBC (128-bit, 192-bit and 256-bit keys)
  - RTE_CRYPTO_CIPHER_AES_CTR (128-bit, 192-bit and 256-bit keys)

Firstly build QEMU with libgcrypt cryptography support.
QEMU can then be started using the following parameters:
qemu-system-x86_64 \
    [...] \
        -object cryptodev-backend-builtin,id=cryptodev0 \
        -device virtio-crypto-pci,id=crypto0,cryptodev=cryptodev0 \
    [...]

Bind the uio_generic driver for the virtio-crypto device.
For example, 0000:00:04.0 is the domain, bus, device and function
number of the virtio-crypto device:
    modprobe uio_pci_generic
    echo -n 0000:00:04.0 > /sys/bus/pci/drivers/virtio-pci/unbind
    echo "1af4 1054" > /sys/bus/pci/drivers/uio_pci_generic/new_id

The front-end virtio crypto PMD driver can be installed:
    cd to the top-level DPDK directory
    sed -i 's,\(CONFIG_RTE_LIBRTE_PMD_VIRTIO_CRYPTO\)=n,\1=y,' config/common_base
    make config T=x86_64-native-linuxapp-gcc
    make install T=x86_64-native-linuxapp-gcc

The test cases can be compiled as below:
    cd to the top-level DPDK directory
    export RTE_TARGET=x86_64-native-linuxapp-gcc
    export RTE_SDK=`pwd`
    cd to test/test
    make
    ./test (MUST reserve enough huge pages memory)
    type the command "cryptodev_virtio_autotest" to test

The result should be like this:
RTE>>cryptodev_virtio_autotest
 + ------------------------------------------------------- +
 + Test Suite : Crypto VIRTIO Unit Test Suite
 + ------------------------------------------------------- +
  0) TestCase AES-128-CBC Encryption PASS
  1) TestCase AES-128-CBC Decryption PASS
  2) TestCase AES-192-CBC Encryption PASS
  3) TestCase AES-192-CBC Decryption PASS
  4) TestCase AES-256-CBC Encryption PASS
  5) TestCase AES-256-CBC Decryption PASS
  6) TestCase AES-256-CBC OOP Encryption PASS
  7) TestCase AES-256-CBC OOP Decryption PASS
  8) TestCase AES-128-CTR Encryption PASS
  9) TestCase AES-128-CTR Decryption PASS
  10) TestCase AES-192-CTR Encryption PASS
  11) TestCase AES-192-CTR Decryption PASS
  12) TestCase AES-256-CTR Encryption PASS
  13) TestCase AES-256-CTR Decryption PASS
 + TestCase [ 0] : test_AES_cipheronly_virtio_all succeeded
 + ------------------------------------------------------- +
 + Test Suite Summary
 + Tests Total :        1
 + Tests Skipped :      0
 + Tests Executed :     1
 + Tests Unsupported:   0
 + Tests Passed :       1
 + Tests Failed :       0
 + ------------------------------------------------------- +
Test OK

Please help to review, thanks!

Changes in v2:
 - using pre-allocated mempool instead of rte_malloc to improve performance [Fan]
 - split the patch into a patchset [Fan]
 - using linux/virtio_crypto.h instead of creating a copy of the file [Fan]
 - update doc/guides/cryptodevs for describing virtio crypto PMD [Fan]
 - update copyright
 - delete virtio legacy mode code since virtio-crypto conforms to virtio-1.0
 - refine the function and variable names
 - fix errors and warnings reported by checkpatch

Jay Zhou (7):
  crypto/virtio: add virtio related fundamental functions
  crpyto/virtio: add crypto related session structure
  cryptodev/virtio: core code of crypto devices
  crypto/virtio: add makefile
  cryptodev: add document for virtio crypto PMD
  cryptodev: add function tests for virtio crypto PMD
  MAINTAINERS: add myself as virtio crypto PMD maintainer

 MAINTAINERS                                        |    6 +
 config/common_base                                 |   20 +
 doc/guides/cryptodevs/features/virtio.ini          |   20 +
 doc/guides/cryptodevs/virtio.rst                   |   93 ++
 drivers/crypto/Makefile                            |    1 +
 drivers/crypto/virtio/Makefile                     |   31 +
 .../virtio/rte_pmd_virtio_crypto_version.map       |    3 +
 drivers/crypto/virtio/virtio_crypto_algs.h         |   27 +
 drivers/crypto/virtio/virtio_cryptodev.c           | 1544 ++++++++++++++++++++
 drivers/crypto/virtio/virtio_cryptodev.h           |   66 +
 drivers/crypto/virtio/virtio_logs.h                |   47 +
 drivers/crypto/virtio/virtio_pci.c                 |  460 ++++++
 drivers/crypto/virtio/virtio_pci.h                 |  252 ++++
 drivers/crypto/virtio/virtio_ring.h                |  137 ++
 drivers/crypto/virtio/virtio_rxtx.c                |  533 +++++++
 drivers/crypto/virtio/virtqueue.c                  |   43 +
 drivers/crypto/virtio/virtqueue.h                  |  176 +++
 mk/rte.app.mk                                      |    1 +
 test/test/test_cryptodev.c                         |   49 +
 test/test/test_cryptodev.h                         |    1 +
 test/test/test_cryptodev_aes_test_vectors.h        |   45 +-
 test/test/test_cryptodev_blockcipher.c             |    9 +-
 test/test/test_cryptodev_blockcipher.h             |    1 +
 23 files changed, 3549 insertions(+), 16 deletions(-)
 create mode 100644 doc/guides/cryptodevs/features/virtio.ini
 create mode 100644 doc/guides/cryptodevs/virtio.rst
 create mode 100644 drivers/crypto/virtio/Makefile
 create mode 100644 drivers/crypto/virtio/rte_pmd_virtio_crypto_version.map
 create mode 100644 drivers/crypto/virtio/virtio_crypto_algs.h
 create mode 100644 drivers/crypto/virtio/virtio_cryptodev.c
 create mode 100644 drivers/crypto/virtio/virtio_cryptodev.h
 create mode 100644 drivers/crypto/virtio/virtio_logs.h
 create mode 100644 drivers/crypto/virtio/virtio_pci.c
 create mode 100644 drivers/crypto/virtio/virtio_pci.h
 create mode 100644 drivers/crypto/virtio/virtio_ring.h
 create mode 100644 drivers/crypto/virtio/virtio_rxtx.c
 create mode 100644 drivers/crypto/virtio/virtqueue.c
 create mode 100644 drivers/crypto/virtio/virtqueue.h

--
1.8.3.1

             reply	other threads:[~2018-02-24 13:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-24 13:14 Jay Zhou [this message]
2018-02-24 13:14 ` [dpdk-dev] [PATCH v2 1/7] crypto/virtio: add virtio related fundamental functions Jay Zhou
2018-02-24 13:14 ` [dpdk-dev] [PATCH v2 2/7] crpyto/virtio: add crypto related session structure Jay Zhou
2018-02-24 13:14 ` [dpdk-dev] [PATCH v2 3/7] cryptodev/virtio: core code of crypto devices Jay Zhou
2018-03-21  4:08   ` Zhang, Roy Fan
2018-03-21  4:58     ` Zhoujian (jay)
2018-02-24 13:14 ` [dpdk-dev] [PATCH v2 4/7] crypto/virtio: add makefile Jay Zhou
2018-02-24 13:14 ` [dpdk-dev] [PATCH v2 5/7] cryptodev: add document for virtio crypto PMD Jay Zhou
2018-02-24 13:14 ` [dpdk-dev] [PATCH v2 6/7] cryptodev: add function tests " Jay Zhou
2018-02-24 13:14 ` [dpdk-dev] [PATCH v2 7/7] MAINTAINERS: add myself as virtio crypto PMD maintainer Jay Zhou
2018-03-21  1:44 ` [dpdk-dev] [PATCH v2 0/7] crypto: add virtio poll mode driver Zhoujian (jay)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1519477564.git.jianjay.zhou@huawei.com \
    --to=jianjay.zhou@huawei.com \
    --cc=arei.gonglei@huawei.com \
    --cc=dev@dpdk.org \
    --cc=longpeng2@huawei.com \
    --cc=pablo.de.lara.guarch@intel.com \
    --cc=roy.fan.zhang@intel.com \
    --cc=thomas@monjalon.net \
    --cc=wangxinxin.wang@huawei.com \
    --cc=weidong.huang@huawei.com \
    --cc=xin.zeng@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).