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 v6 07/10] crypto/virtio: support AES-CBC
Date: Tue, 3 Apr 2018 17:43:07 +0800	[thread overview]
Message-ID: <90792b42db0e235458057dd97cd62aead8e7a1ad.1522747556.git.jianjay.zhou@huawei.com> (raw)
In-Reply-To: <cover.1522747556.git.jianjay.zhou@huawei.com>

Signed-off-by: Jay Zhou <jianjay.zhou@huawei.com>
---
 drivers/crypto/virtio/virtio_crypto_capabilities.h | 30 ++++++++++++++++++++++
 drivers/crypto/virtio/virtio_cryptodev.c           | 11 ++++++++
 2 files changed, 41 insertions(+)
 create mode 100644 drivers/crypto/virtio/virtio_crypto_capabilities.h

diff --git a/drivers/crypto/virtio/virtio_crypto_capabilities.h b/drivers/crypto/virtio/virtio_crypto_capabilities.h
new file mode 100644
index 0000000..db6932f
--- /dev/null
+++ b/drivers/crypto/virtio/virtio_crypto_capabilities.h
@@ -0,0 +1,30 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2018 HUAWEI TECHNOLOGIES CO., LTD.
+ */
+
+#ifndef _VIRTIO_CRYPTO_CAPABILITIES_H_
+#define _VIRTIO_CRYPTO_CAPABILITIES_H_
+
+#define VIRTIO_SYM_CAPABILITIES					\
+	{	/* AES CBC */						\
+		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,			\
+		{.sym = {						\
+			.xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,	\
+			{.cipher = {					\
+				.algo = RTE_CRYPTO_CIPHER_AES_CBC,	\
+				.block_size = 16,			\
+				.key_size = {				\
+					.min = 16,			\
+					.max = 32,			\
+					.increment = 8			\
+				},					\
+				.iv_size = {				\
+					.min = 16,			\
+					.max = 16,			\
+					.increment = 0			\
+				}					\
+			}, }						\
+		}, }							\
+	}
+
+#endif /* _VIRTIO_CRYPTO_CAPABILITIES_H_ */
diff --git a/drivers/crypto/virtio/virtio_cryptodev.c b/drivers/crypto/virtio/virtio_cryptodev.c
index 0ab0d38..209f639 100644
--- a/drivers/crypto/virtio/virtio_cryptodev.c
+++ b/drivers/crypto/virtio/virtio_cryptodev.c
@@ -15,6 +15,7 @@
 #include "virtio_cryptodev.h"
 #include "virtqueue.h"
 #include "virtio_crypto_algs.h"
+#include "virtio_crypto_capabilities.h"
 
 int virtio_crypto_logtype_init;
 int virtio_crypto_logtype_session;
@@ -58,6 +59,11 @@ static int virtio_crypto_sym_configure_session(struct rte_cryptodev *dev,
 	{ .vendor_id = 0, /* sentinel */ },
 };
 
+static const struct rte_cryptodev_capabilities virtio_capabilities[] = {
+	VIRTIO_SYM_CAPABILITIES,
+	RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST()
+};
+
 uint8_t cryptodev_virtio_driver_id;
 
 #define NUM_ENTRY_SYM_CREATE_SESSION 4
@@ -744,6 +750,7 @@ int virtio_crypto_queue_setup(struct rte_cryptodev *dev,
 
 	hw = cryptodev->data->dev_private;
 	hw->dev_id = cryptodev->data->dev_id;
+	hw->virtio_dev_capabilities = virtio_capabilities;
 
 	VIRTIO_CRYPTO_INIT_LOG_DBG("dev %d vendorID=0x%x deviceID=0x%x",
 		cryptodev->data->dev_id, pci_dev->id.vendor_id,
@@ -1131,6 +1138,9 @@ static int virtio_crypto_sym_pad_cipher_param(
 		struct rte_crypto_cipher_xform *cipher_xform)
 {
 	switch (cipher_xform->algo) {
+	case RTE_CRYPTO_CIPHER_AES_CBC:
+		para->algo = VIRTIO_CRYPTO_CIPHER_AES_CBC;
+		break;
 	default:
 		VIRTIO_CRYPTO_SESSION_LOG_ERR("Crypto: Unsupported "
 				"Cipher alg %u", cipher_xform->algo);
@@ -1390,6 +1400,7 @@ static int virtio_crypto_sym_configure_session(
 		info->max_nb_queue_pairs = hw->max_dataqueues;
 		info->sym.max_nb_sessions =
 			RTE_VIRTIO_CRYPTO_PMD_MAX_NB_SESSIONS;
+		info->capabilities = hw->virtio_dev_capabilities;
 	}
 }
 
-- 
1.8.3.1

  parent reply	other threads:[~2018-04-03  9:43 UTC|newest]

Thread overview: 76+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-03  9:43 [dpdk-dev] [PATCH v6 00/10] crypto: add virtio poll mode driver Jay Zhou
2018-04-03  9:43 ` [dpdk-dev] [PATCH v6 01/10] crypto/virtio: add virtio crypto PMD Jay Zhou
2018-04-04 12:56   ` De Lara Guarch, Pablo
2018-04-04 13:52     ` Zhoujian (jay)
2018-04-03  9:43 ` [dpdk-dev] [PATCH v6 02/10] crypto/virtio: support virtio device init Jay Zhou
2018-04-03  9:43 ` [dpdk-dev] [PATCH v6 03/10] crypto/virtio: support basic PMD ops Jay Zhou
2018-04-03  9:43 ` [dpdk-dev] [PATCH v6 04/10] crypto/virtio: support session related ops Jay Zhou
2018-04-03  9:43 ` [dpdk-dev] [PATCH v6 05/10] crypto/virtio: support crypto enqueue/dequeue burst API Jay Zhou
2018-04-03  9:43 ` [dpdk-dev] [PATCH v6 06/10] crypto/virtio: support stats related ops Jay Zhou
2018-04-03  9:43 ` Jay Zhou [this message]
2018-04-03  9:43 ` [dpdk-dev] [PATCH v6 08/10] crypto/virtio: support HMAC-SHA1 Jay Zhou
2018-04-03  9:43 ` [dpdk-dev] [PATCH v6 09/10] test/crypto: add function tests for virtio crypto PMD Jay Zhou
2018-04-03  9:43 ` [dpdk-dev] [PATCH v6 10/10] doc: add virtio crypto PMD guide Jay Zhou
2018-04-04 17:03 ` [dpdk-dev] [PATCH v7 00/10] crypto: add virtio poll mode driver Jay Zhou
2018-04-04 17:03   ` [dpdk-dev] [PATCH v7 01/10] crypto/virtio: add virtio crypto PMD Jay Zhou
2018-04-04 17:03   ` [dpdk-dev] [PATCH v7 02/10] crypto/virtio: support virtio device init Jay Zhou
2018-04-04 17:03   ` [dpdk-dev] [PATCH v7 03/10] crypto/virtio: support basic PMD ops Jay Zhou
2018-04-04 17:03   ` [dpdk-dev] [PATCH v7 04/10] crypto/virtio: support session related ops Jay Zhou
2018-04-04 17:03   ` [dpdk-dev] [PATCH v7 05/10] crypto/virtio: support crypto enqueue/dequeue burst API Jay Zhou
2018-04-04 17:03   ` [dpdk-dev] [PATCH v7 06/10] crypto/virtio: support stats related ops Jay Zhou
2018-04-04 17:03   ` [dpdk-dev] [PATCH v7 07/10] crypto/virtio: support AES-CBC Jay Zhou
2018-04-04 17:03   ` [dpdk-dev] [PATCH v7 08/10] crypto/virtio: support HMAC-SHA1 Jay Zhou
2018-04-04 17:03   ` [dpdk-dev] [PATCH v7 09/10] test/crypto: add function tests for virtio crypto PMD Jay Zhou
2018-04-04 17:03   ` [dpdk-dev] [PATCH v7 10/10] doc: add virtio crypto PMD guide Jay Zhou
2018-04-14  9:34 ` [dpdk-dev] [PATCH v8 00/11] crypto: add virtio poll mode driver Jay Zhou
2018-04-14  9:34   ` [dpdk-dev] [PATCH v8 01/11] crypto/virtio: add virtio crypto PMD Jay Zhou
2018-04-14  9:34   ` [dpdk-dev] [PATCH v8 02/11] crypto/virtio: support virtio device init Jay Zhou
2018-04-14  9:34   ` [dpdk-dev] [PATCH v8 03/11] crypto/virtio: support basic PMD ops Jay Zhou
2018-04-14  9:34   ` [dpdk-dev] [PATCH v8 04/11] crypto/virtio: support session related ops Jay Zhou
2018-04-14  9:34   ` [dpdk-dev] [PATCH v8 05/11] crypto/virtio: support crypto enqueue/dequeue burst API Jay Zhou
2018-04-14  9:34   ` [dpdk-dev] [PATCH v8 06/11] crypto/virtio: support stats related ops Jay Zhou
2018-04-14  9:34   ` [dpdk-dev] [PATCH v8 07/11] crypto/virtio: support AES-CBC Jay Zhou
2018-04-14  9:34   ` [dpdk-dev] [PATCH v8 08/11] crypto/virtio: support HMAC-SHA1 Jay Zhou
2018-04-14  9:34   ` [dpdk-dev] [PATCH v8 09/11] crypto/virtio: build with meson Jay Zhou
2018-04-14  9:34   ` [dpdk-dev] [PATCH v8 10/11] test/crypto: add function tests for virtio crypto PMD Jay Zhou
2018-04-14  9:34   ` [dpdk-dev] [PATCH v8 11/11] doc: add virtio crypto PMD guide Jay Zhou
2018-04-15  8:51 ` [dpdk-dev] [PATCH v9 00/11] crypto: add virtio poll mode driver Jay Zhou
2018-04-15  8:51   ` [dpdk-dev] [PATCH v9 01/11] crypto/virtio: add virtio crypto PMD Jay Zhou
2018-04-15  8:51   ` [dpdk-dev] [PATCH v9 02/11] crypto/virtio: support virtio device init Jay Zhou
2018-04-15  8:51   ` [dpdk-dev] [PATCH v9 03/11] crypto/virtio: support basic PMD ops Jay Zhou
2018-04-15  8:51   ` [dpdk-dev] [PATCH v9 04/11] crypto/virtio: support session related ops Jay Zhou
2018-04-15  8:51   ` [dpdk-dev] [PATCH v9 05/11] crypto/virtio: support crypto enqueue/dequeue burst API Jay Zhou
2018-04-15  8:51   ` [dpdk-dev] [PATCH v9 06/11] crypto/virtio: support stats related ops Jay Zhou
2018-04-15  8:51   ` [dpdk-dev] [PATCH v9 07/11] crypto/virtio: support AES-CBC Jay Zhou
2018-04-15  8:51   ` [dpdk-dev] [PATCH v9 08/11] crypto/virtio: support HMAC-SHA1 Jay Zhou
2018-04-15  8:51   ` [dpdk-dev] [PATCH v9 09/11] crypto/virtio: build with meson Jay Zhou
2018-04-15 12:09     ` De Lara Guarch, Pablo
2018-04-16  0:56       ` Zhoujian (jay)
2018-04-15  8:51   ` [dpdk-dev] [PATCH v9 10/11] test/crypto: add function tests for virtio crypto PMD Jay Zhou
2018-04-15  8:51   ` [dpdk-dev] [PATCH v9 11/11] doc: add virtio crypto PMD guide Jay Zhou
2018-04-16  2:21 ` [dpdk-dev] [PATCH v10 00/10] crypto: add virtio poll mode driver Jay Zhou
2018-04-16  2:21   ` [dpdk-dev] [PATCH v10 01/10] crypto/virtio: add virtio crypto PMD Jay Zhou
2018-04-16 14:15     ` De Lara Guarch, Pablo
2018-04-16 15:18       ` Zhoujian (jay)
2018-04-16  2:21   ` [dpdk-dev] [PATCH v10 02/10] crypto/virtio: support virtio device init Jay Zhou
2018-04-16  2:21   ` [dpdk-dev] [PATCH v10 03/10] crypto/virtio: support basic PMD ops Jay Zhou
2018-04-16  2:21   ` [dpdk-dev] [PATCH v10 04/10] crypto/virtio: support session related ops Jay Zhou
2018-04-16  2:21   ` [dpdk-dev] [PATCH v10 05/10] crypto/virtio: support crypto enqueue/dequeue burst API Jay Zhou
2018-04-16  2:21   ` [dpdk-dev] [PATCH v10 06/10] crypto/virtio: support stats related ops Jay Zhou
2018-04-16  2:21   ` [dpdk-dev] [PATCH v10 07/10] crypto/virtio: support AES-CBC Jay Zhou
2018-04-16  2:21   ` [dpdk-dev] [PATCH v10 08/10] crypto/virtio: support HMAC-SHA1 Jay Zhou
2018-04-16  2:21   ` [dpdk-dev] [PATCH v10 09/10] test/crypto: add function tests for virtio crypto PMD Jay Zhou
2018-04-16  2:21   ` [dpdk-dev] [PATCH v10 10/10] doc: add virtio crypto PMD guide Jay Zhou
2018-04-17  9:23 ` [dpdk-dev] [PATCH v11 00/10] crypto: add virtio poll mode driver Jay Zhou
2018-04-17  9:23   ` [dpdk-dev] [PATCH v11 01/10] crypto/virtio: add virtio crypto PMD Jay Zhou
2018-04-17  9:23   ` [dpdk-dev] [PATCH v11 02/10] crypto/virtio: support virtio device init Jay Zhou
2018-04-17  9:23   ` [dpdk-dev] [PATCH v11 03/10] crypto/virtio: support basic PMD ops Jay Zhou
2018-04-17  9:23   ` [dpdk-dev] [PATCH v11 04/10] crypto/virtio: support session related ops Jay Zhou
2018-04-17  9:23   ` [dpdk-dev] [PATCH v11 05/10] crypto/virtio: support crypto enqueue/dequeue burst API Jay Zhou
2018-04-17  9:23   ` [dpdk-dev] [PATCH v11 06/10] crypto/virtio: support stats related ops Jay Zhou
2018-04-17  9:23   ` [dpdk-dev] [PATCH v11 07/10] crypto/virtio: support AES-CBC Jay Zhou
2018-04-17  9:23   ` [dpdk-dev] [PATCH v11 08/10] crypto/virtio: support HMAC-SHA1 Jay Zhou
2018-04-17  9:23   ` [dpdk-dev] [PATCH v11 09/10] test/crypto: add function tests for virtio crypto PMD Jay Zhou
2018-04-17  9:23   ` [dpdk-dev] [PATCH v11 10/10] doc: add virtio crypto PMD guide Jay Zhou
2018-04-18 10:00   ` [dpdk-dev] [PATCH v11 00/10] crypto: add virtio poll mode driver De Lara Guarch, Pablo
2018-04-18 13:07     ` 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=90792b42db0e235458057dd97cd62aead8e7a1ad.1522747556.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).