Skip to contentSkip to conversation

crypto/ccp: Add support for AMD CCP Crypto poll mode driver

PATCH In review Ravi Kumar 2 participants 4 messages Aug 25, 2017 – Sep 15, 2017

Subsystems (2)
lore
Share & tools
lore

Ravi Kumar

author
#0 lore raw

PATCH 1/1 crypto/ccp: Add support for AMD CCP Crypto poll mode driver

The CCP poll mode driver library (librte_pmd_ccp) implements support for AMD’s cryptographic co-processor (CCP). The CCP PMD is a virtual crypto poll mode driver which schedules crypto operations to one or more available CCP hardware engines on the platform. The CCP PMD provides poll mode crypto driver support for the following hardware accelerator devices:
- AMD Cryptographic Co-processor (0x1456)
- AMD Cryptographic Co-processor (0x1468)
The patchset consists of following algorithms support:
- Cipher Algorithm support
o RTE_CRYPTO_CIPHER_AES_ECB
o RTE_CRYPTO_CIPHER_AES_CBC
o RTE_CRYPTO_CIPHER_AES_CTR
o RTE_CRYPTO_CIPHER_3DES_CBC
- Authentication Algorithm support
o RTE_CRYPTO_AUTH_SHA1
o RTE_CRYPTO_AUTH_SHA1_HMAC
o RTE_CRYPTO_AUTH_SHA224
o RTE_CRYPTO_AUTH_SHA224_HMAC
o RTE_CRYPTO_AUTH_SHA256
o RTE_CRYPTO_AUTH_SHA256_HMAC
o RTE_CRYPTO_AUTH_SHA384
o RTE_CRYPTO_AUTH_SHA384_HMAC
o RTE_CRYPTO_AUTH_SHA512
o RTE_CRYPTO_AUTH_SHA512_HMAC
o RTE_CRYPTO_AUTH_MD5_HMAC
o RTE_CRYPTO_AUTH_AES_CMAC
Addition to crypto Library to support SHA3 authentication algorithm
o RTE_CRYPTO_AUTH_SHA3_224
o RTE_CRYPTO_AUTH_SHA3_224_HMAC
o RTE_CRYPTO_AUTH_SHA3_256
o RTE_CRYPTO_AUTH_SHA3_256_HMAC
o RTE_CRYPTO_AUTH_SHA3_384
o RTE_CRYPTO_AUTH_SHA3_384_HMAC
o RTE_CRYPTO_AUTH_SHA3_512
o RTE_CRYPTO_AUTH_SHA3_512_HMAC
- AEAD Algorithm Support
o RTE_CRYPTO_AEAD_AES_GCM

The CCP PMD is not enabled by default. Following option can be enabled in DPDK configuration to enable CCP PMD. CONFIG_RTE_LIBRTE_PMD_CCP (default n)

---
 MAINTAINERS                                |    5 +
 config/common_base                         |    6 +
 doc/guides/cryptodevs/ccp.rst              |  126 ++
 doc/guides/cryptodevs/features/ccp.ini     |   57 +
 doc/guides/cryptodevs/features/default.ini |   12 +
 doc/guides/cryptodevs/index.rst            |    1 +
 drivers/crypto/Makefile                    |    2 +
 drivers/crypto/ccp/Makefile                |   71 +
 drivers/crypto/ccp/ccp_crypto.c            | 3008 ++++++++++++++++++++++++++++
 drivers/crypto/ccp/ccp_crypto.h            |  411 ++++
 drivers/crypto/ccp/ccp_dev.c               |  847 ++++++++
 drivers/crypto/ccp/ccp_dev.h               |  533 +++++
 drivers/crypto/ccp/ccp_pci.c               |  331 +++
 drivers/crypto/ccp/ccp_pci.h               |   58 +
 drivers/crypto/ccp/ccp_pmd_ops.c           |  860 ++++++++
 drivers/crypto/ccp/ccp_pmd_private.h       |  135 ++
 drivers/crypto/ccp/rte_ccp_pmd.c           |  283 +++
 drivers/crypto/ccp/rte_pmd_ccp_version.map |    3 +
 lib/librte_cryptodev/rte_crypto_sym.h      |   18 +
 mk/rte.app.mk                              |    1 +
 20 files changed, 6768 insertions(+)
 create mode 100644 doc/guides/cryptodevs/ccp.rst
 create mode 100644 doc/guides/cryptodevs/features/ccp.ini
 create mode 100644 drivers/crypto/ccp/Makefile
 create mode 100644 drivers/crypto/ccp/ccp_crypto.c
 create mode 100644 drivers/crypto/ccp/ccp_crypto.h
 create mode 100644 drivers/crypto/ccp/ccp_dev.c
 create mode 100644 drivers/crypto/ccp/ccp_dev.h
 create mode 100644 drivers/crypto/ccp/ccp_pci.c
 create mode 100644 drivers/crypto/ccp/ccp_pci.h
 create mode 100644 drivers/crypto/ccp/ccp_pmd_ops.c
 create mode 100644 drivers/crypto/ccp/ccp_pmd_private.h
 create mode 100644 drivers/crypto/ccp/rte_ccp_pmd.c
 create mode 100644 drivers/crypto/ccp/rte_pmd_ccp_version.map
MAINTAINERS +5 -0
index a0cd75e..cce6bce 100644
@@ -586,6 +586,11 @@ M: Fan Zhang <[email protected]>
 F: drivers/crypto/scheduler/
 F: doc/guides/cryptodevs/scheduler.rst
 
+AMD CCP Crypto PMD 
+M: Ravi Kumar <[email protected]>
+F: drivers/crypto/ccp/
+F: doc/guides/cryptodevs/ccp.rst
+F: doc/guides/cryptodevs/features/ccp.ini
 
 Eventdev Drivers
 ----------------
config/common_base +6 -0
index 5e97a08..3353e19 100644
@@ -514,6 +514,12 @@ CONFIG_RTE_LIBRTE_PMD_CRYPTO_SCHEDULER_DEBUG=n
 CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO=y
 
 #
+# Compile PMD for AMD CCP crypto device
+#
+CONFIG_RTE_LIBRTE_PMD_CCP=n
+CONFIG_RTE_LIBRTE_PMD_CCP_CPU_AUTH=n
+
+#
 # Compile generic event device library
 #
 CONFIG_RTE_LIBRTE_EVENTDEV=y
doc/guides/cryptodevs/ccp.rst new file +126 -0

126 lines not on this page · raw message

doc/guides/cryptodevs/features/ccp.ini new file +57 -0

57 lines not on this page · raw message

doc/guides/cryptodevs/features/default.ini +12 -0
index 0926887..d09943f 100644
@@ -26,6 +26,9 @@ NULL           =
 AES CBC (128)  =
 AES CBC (192)  =
 AES CBC (256)  =
+AES ECB (128)  =
+AES ECB (192)  =
+AES ECB (256)  =
 AES CTR (128)  =
 AES CTR (192)  =
 AES CTR (256)  =
@@ -60,6 +63,15 @@ AES GMAC     =
 SNOW3G UIA2  =
 KASUMI F9    =
 ZUC EIA3     =
+AES CMAC     =
+SHA3_224     = 
+SHA3_224 HMAC=
+SHA3_256     =
+SHA3_256 HMAC=
+SHA3_384     =
+SHA3_384 HMAC=
+SHA3_512     =
+SHA3_512 HMAC=
 
 ;
 ; Supported AEAD algorithms of a default crypto driver.
doc/guides/cryptodevs/index.rst +1 -0
index 361b82d..f31c978 100644
@@ -39,6 +39,7 @@ Crypto Device Drivers
     aesni_mb
     aesni_gcm
     armv8
+    ccp
     dpaa2_sec
     kasumi
     openssl
drivers/crypto/Makefile +2 -0
index 7a719b9..3505649 100644
@@ -55,5 +55,7 @@ DIRS-$(CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO) += null
 DEPDIRS-null = $(core-libs)
 DIRS-$(CONFIG_RTE_LIBRTE_PMD_DPAA2_SEC) += dpaa2_sec
 DEPDIRS-dpaa2_sec = $(core-libs)
+DIRS-$(CONFIG_RTE_LIBRTE_PMD_CCP) += ccp
+DEPDIRS-ccp = $(core-libs)
 
 include $(RTE_SDK)/mk/rte.subdir.mk
drivers/crypto/ccp/Makefile new file +71 -0

71 lines not on this page · raw message

drivers/crypto/ccp/ccp_crypto.c new file +3008 -0

2,685 lines not on this page · raw message

drivers/crypto/ccp/ccp_crypto.h new file +411 -0

411 lines not on this page · raw message

drivers/crypto/ccp/ccp_dev.c new file +847 -0

847 lines not on this page · raw message

drivers/crypto/ccp/ccp_dev.h new file +533 -0

533 lines not on this page · raw message

drivers/crypto/ccp/ccp_pci.c new file +331 -0

331 lines not on this page · raw message

drivers/crypto/ccp/ccp_pci.h new file +58 -0

58 lines not on this page · raw message

drivers/crypto/ccp/ccp_pmd_ops.c new file +860 -0

860 lines not on this page · raw message

drivers/crypto/ccp/ccp_pmd_private.h new file +135 -0

135 lines not on this page · raw message

drivers/crypto/ccp/rte_ccp_pmd.c new file +283 -0

283 lines not on this page · raw message

drivers/crypto/ccp/rte_pmd_ccp_version.map new file +3 -0
new file mode 100644
index 0000000..a753031

Lines of this file are not shown. View the raw message.

lib/librte_cryptodev/rte_crypto_sym.h +18 -0
index 0ceaa91..eea3c87 100644

Lines of this file are not shown. View the raw message.

mk/rte.app.mk +1 -0
index c25fdd9..c65bd55 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.7.4

Part of the diff is not shown here. View the raw message.

#1 lore raw

Hi,

Please do not consider this patch as the license has to be updated. We are working with our legal team to get that done.

Regards,
Ravi

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Ravi Kumar
Sent: Friday, August 25, 2017 9:16 PM
To: [email protected]
Subject: [dpdk-dev] [PATCH] crypto/ccp: Add support for AMD CCP Crypto poll mode driver

The CCP poll mode driver library (librte_pmd_ccp) implements support for AMD’s cryptographic co-processor (CCP). The CCP PMD is a virtual crypto poll mode driver which schedules crypto operations to one or more available CCP hardware engines on the platform. The CCP PMD provides poll mode crypto driver support for the following hardware accelerator devices:
- AMD Cryptographic Co-processor (0x1456)
- AMD Cryptographic Co-processor (0x1468)
The patchset consists of following algorithms support:
- Cipher Algorithm support
o RTE_CRYPTO_CIPHER_AES_ECB
o RTE_CRYPTO_CIPHER_AES_CBC
o RTE_CRYPTO_CIPHER_AES_CTR
o RTE_CRYPTO_CIPHER_3DES_CBC
- Authentication Algorithm support
o RTE_CRYPTO_AUTH_SHA1
o RTE_CRYPTO_AUTH_SHA1_HMAC
o RTE_CRYPTO_AUTH_SHA224
o RTE_CRYPTO_AUTH_SHA224_HMAC
o RTE_CRYPTO_AUTH_SHA256
o RTE_CRYPTO_AUTH_SHA256_HMAC
o RTE_CRYPTO_AUTH_SHA384
o RTE_CRYPTO_AUTH_SHA384_HMAC
o RTE_CRYPTO_AUTH_SHA512
o RTE_CRYPTO_AUTH_SHA512_HMAC
o RTE_CRYPTO_AUTH_MD5_HMAC
o RTE_CRYPTO_AUTH_AES_CMAC
Addition to crypto Library to support SHA3 authentication algorithm
o RTE_CRYPTO_AUTH_SHA3_224
o RTE_CRYPTO_AUTH_SHA3_224_HMAC
o RTE_CRYPTO_AUTH_SHA3_256
o RTE_CRYPTO_AUTH_SHA3_256_HMAC
o RTE_CRYPTO_AUTH_SHA3_384
o RTE_CRYPTO_AUTH_SHA3_384_HMAC
o RTE_CRYPTO_AUTH_SHA3_512
o RTE_CRYPTO_AUTH_SHA3_512_HMAC
- AEAD Algorithm Support
o RTE_CRYPTO_AEAD_AES_GCM

The CCP PMD is not enabled by default. Following option can be enabled in DPDK configuration to enable CCP PMD. CONFIG_RTE_LIBRTE_PMD_CCP (default n)

---
 MAINTAINERS                                |    5 +
 config/common_base                         |    6 +
 doc/guides/cryptodevs/ccp.rst              |  126 ++
 doc/guides/cryptodevs/features/ccp.ini     |   57 +
 doc/guides/cryptodevs/features/default.ini |   12 +
 doc/guides/cryptodevs/index.rst            |    1 +
 drivers/crypto/Makefile                    |    2 +
 drivers/crypto/ccp/Makefile                |   71 +
 drivers/crypto/ccp/ccp_crypto.c            | 3008 ++++++++++++++++++++++++++++
 drivers/crypto/ccp/ccp_crypto.h            |  411 ++++
 drivers/crypto/ccp/ccp_dev.c               |  847 ++++++++
 drivers/crypto/ccp/ccp_dev.h               |  533 +++++
 drivers/crypto/ccp/ccp_pci.c               |  331 +++
 drivers/crypto/ccp/ccp_pci.h               |   58 +
 drivers/crypto/ccp/ccp_pmd_ops.c           |  860 ++++++++
 drivers/crypto/ccp/ccp_pmd_private.h       |  135 ++
 drivers/crypto/ccp/rte_ccp_pmd.c           |  283 +++
 drivers/crypto/ccp/rte_pmd_ccp_version.map |    3 +
 lib/librte_cryptodev/rte_crypto_sym.h      |   18 +
 mk/rte.app.mk                              |    1 +
 20 files changed, 6768 insertions(+)
 create mode 100644 doc/guides/cryptodevs/ccp.rst
 create mode 100644 doc/guides/cryptodevs/features/ccp.ini
 create mode 100644 drivers/crypto/ccp/Makefile
 create mode 100644 drivers/crypto/ccp/ccp_crypto.c
 create mode 100644 drivers/crypto/ccp/ccp_crypto.h
 create mode 100644 drivers/crypto/ccp/ccp_dev.c
 create mode 100644 drivers/crypto/ccp/ccp_dev.h
 create mode 100644 drivers/crypto/ccp/ccp_pci.c
 create mode 100644 drivers/crypto/ccp/ccp_pci.h
 create mode 100644 drivers/crypto/ccp/ccp_pmd_ops.c
 create mode 100644 drivers/crypto/ccp/ccp_pmd_private.h
 create mode 100644 drivers/crypto/ccp/rte_ccp_pmd.c
 create mode 100644 drivers/crypto/ccp/rte_pmd_ccp_version.map
MAINTAINERS +5 -0
index a0cd75e..cce6bce 100644
@@ -586,6 +586,11 @@ M: Fan Zhang <[email protected]>
 F: drivers/crypto/scheduler/
 F: doc/guides/cryptodevs/scheduler.rst
 
+AMD CCP Crypto PMD 
+M: Ravi Kumar <[email protected]>
+F: drivers/crypto/ccp/
+F: doc/guides/cryptodevs/ccp.rst
+F: doc/guides/cryptodevs/features/ccp.ini
 
 Eventdev Drivers
 ----------------
config/common_base +6 -0
index 5e97a08..3353e19 100644
@@ -514,6 +514,12 @@ CONFIG_RTE_LIBRTE_PMD_CRYPTO_SCHEDULER_DEBUG=n
 CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO=y
 
 #
+# Compile PMD for AMD CCP crypto device
+#
+CONFIG_RTE_LIBRTE_PMD_CCP=n
+CONFIG_RTE_LIBRTE_PMD_CCP_CPU_AUTH=n
+
+#
 # Compile generic event device library
 #
 CONFIG_RTE_LIBRTE_EVENTDEV=y
doc/guides/cryptodevs/ccp.rst new file +126 -0

126 lines not on this page · raw message

doc/guides/cryptodevs/features/ccp.ini new file +57 -0

57 lines not on this page · raw message

doc/guides/cryptodevs/features/default.ini +12 -0
index 0926887..d09943f 100644
@@ -26,6 +26,9 @@ NULL           =
 AES CBC (128)  =
 AES CBC (192)  =
 AES CBC (256)  =
+AES ECB (128)  =
+AES ECB (192)  =
+AES ECB (256)  =
 AES CTR (128)  =
 AES CTR (192)  =
 AES CTR (256)  =
@@ -60,6 +63,15 @@ AES GMAC     =
 SNOW3G UIA2  =
 KASUMI F9    =
 ZUC EIA3     =
+AES CMAC     =
+SHA3_224     = 
+SHA3_224 HMAC=
+SHA3_256     =
+SHA3_256 HMAC=
+SHA3_384     =
+SHA3_384 HMAC=
+SHA3_512     =
+SHA3_512 HMAC=
 
 ;
 ; Supported AEAD algorithms of a default crypto driver.
doc/guides/cryptodevs/index.rst +1 -0
index 361b82d..f31c978 100644
@@ -39,6 +39,7 @@ Crypto Device Drivers
     aesni_mb
     aesni_gcm
     armv8
+    ccp
     dpaa2_sec
     kasumi
     openssl
drivers/crypto/Makefile +2 -0
index 7a719b9..3505649 100644
@@ -55,5 +55,7 @@ DIRS-$(CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO) += null
 DEPDIRS-null = $(core-libs)
 DIRS-$(CONFIG_RTE_LIBRTE_PMD_DPAA2_SEC) += dpaa2_sec
 DEPDIRS-dpaa2_sec = $(core-libs)
+DIRS-$(CONFIG_RTE_LIBRTE_PMD_CCP) += ccp
+DEPDIRS-ccp = $(core-libs)
 
 include $(RTE_SDK)/mk/rte.subdir.mk
drivers/crypto/ccp/Makefile new file +71 -0

71 lines not on this page · raw message

drivers/crypto/ccp/ccp_crypto.c new file +3008 -0

2,685 lines not on this page · raw message

drivers/crypto/ccp/ccp_crypto.h new file +411 -0

411 lines not on this page · raw message

drivers/crypto/ccp/ccp_dev.c new file +847 -0

847 lines not on this page · raw message

drivers/crypto/ccp/ccp_dev.h new file +533 -0

533 lines not on this page · raw message

drivers/crypto/ccp/ccp_pci.c new file +331 -0

331 lines not on this page · raw message

drivers/crypto/ccp/ccp_pci.h new file +58 -0

58 lines not on this page · raw message

drivers/crypto/ccp/ccp_pmd_ops.c new file +860 -0

860 lines not on this page · raw message

drivers/crypto/ccp/ccp_pmd_private.h new file +135 -0

135 lines not on this page · raw message

drivers/crypto/ccp/rte_ccp_pmd.c new file +283 -0

283 lines not on this page · raw message

drivers/crypto/ccp/rte_pmd_ccp_version.map new file +3 -0
new file mode 100644
index 0000000..a753031

Lines of this file are not shown. View the raw message.

lib/librte_cryptodev/rte_crypto_sym.h +18 -0
index 0ceaa91..eea3c87 100644

Lines of this file are not shown. View the raw message.

mk/rte.app.mk +1 -0
index c25fdd9..c65bd55 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.7.4

Part of the diff is not shown here. View the raw message.

#2 lore raw
Quoted 9 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Kumar, Ravi1
Sent: Wednesday, August 30, 2017 7:25 AM
To: [email protected]
Subject: Re: [dpdk-dev] [PATCH] crypto/ccp: Add support for AMD CCP Crypto poll mode driver

Quoted 4 lines

Hi,

Please do not consider this patch as the license has to be updated. We are working with our legal team to get that done.

Hi Ravi,

I have several comments about this patch, for the v2 that you will send:

- Could you split the patch into separate patches? The patch is quite big to be reviewed easily. Here it is an example of how you should do it:
http://dpdk.org/ml/archives/dev/2017-April/064385.html

- When including a file that is in the same folder, use quotes:
#include <ccp_crypto.h> --> #include "ccp_crypto.h".

- There are some checkpatch errors. Look at patchwork:
http://dpdk.org/ml/archives/test-report/2017-August/027829.html

- I think you should add some tests for this PMD. You don't really need to add new tests, you can just add a test suite for this driver and use the existing tests.

Last thing, when replying to a patch, comment inline and use ">" before each line, otherwise patchwork picks up the email as a new patch.

Thanks!
Pablo

#3 lore raw
Quoted 24 lines
Quoted 8 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Kumar, Ravi1
Sent: Wednesday, August 30, 2017 7:25 AM
To: [email protected]
Subject: Re: [dpdk-dev] [PATCH] crypto/ccp: Add support for AMD CCP Crypto poll mode driver

Quoted 4 lines

Hi,

Please do not consider this patch as the license has to be updated. We are working with our legal team to get that done.

Hi Ravi,

I have several comments about this patch, for the v2 that you will send:

- Could you split the patch into separate patches? The patch is quite big to be reviewed easily. Here it is an example of how you should do it:
http://dpdk.org/ml/archives/dev/2017-April/064385.html

- When including a file that is in the same folder, use quotes:
#include <ccp_crypto.h> --> #include "ccp_crypto.h".

Quoted 6 lines

- There are some checkpatch errors. Look at patchwork:
http://dpdk.org/ml/archives/test-report/2017-August/027829.html

- I think you should add some tests for this PMD. You don't really need to add new tests, you can just add a test suite for this driver and use the existing tests.

Last thing, when replying to a patch, comment inline and use ">" before each line, otherwise patchwork picks up the email as a new patch.

Hi Pablo,

Thanks a lot for the review comments. We have been working on this and will send updated patches once we are ready.

Regards,
Ravi

Quoted 3 lines

Thanks!
Pablo