Skip to contentSkip to conversation

crypto/mvsam: add new features and fixes

PATCH In review Tomasz Duszynski 3 participants 24 messages Aug 24, 2018 – Oct 1, 2018 Crypto API

lore
Share & tools
lore
#0 lore raw

cover crypto/mvsam: add new features and fixes

This patch series introduces following changes:

* Add support for HMAC SHA224, AES ECB and NULL algorithms.
* Update hash digest sizes to match hardware capabilities.
* Fix a shared build.

Szymon Sliwa (1):
crypto/mvsam: update hash digest sizes

Tomasz Duszynski (5):
crypto/mvsam: fix shared library build crypto/mvsam: add support for HMAC SHA224 crypto/mvsam: add support for AES ECB crypto/mvsam: add support for crypto/auth NULL algorithms crypto/mvsam: add 3DES ECB to the capabilities list

 drivers/crypto/mvsam/Makefile           |   2 +-
 drivers/crypto/mvsam/rte_mrvl_pmd.c     |  15 ++++
 drivers/crypto/mvsam/rte_mrvl_pmd_ops.c | 150 +++++++++++++++++++++++++++-----
 3 files changed, 144 insertions(+), 23 deletions(-)

--
2.7.4

#1 lore raw

PATCH 1/6 crypto/mvsam: fix shared library build

Add missing rte_kvargs library dependency. Without that shared library build fails due to unresolved rte_kvargs_* symbols.

Fixes 25b05a1c806b ("crypto/mvsam: parse max number of sessions")
---
 drivers/crypto/mvsam/Makefile       | 2 +-
 drivers/crypto/mvsam/rte_mrvl_pmd.c | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
drivers/crypto/mvsam/Makefile +1 -1
index c3dc72c..3290147 100644
@@ -31,7 +31,7 @@ EXPORT_MAP := rte_pmd_mvsam_version.map
 
 # external library dependencies
 LDLIBS += -L$(LIBMUSDK_PATH)/lib -lmusdk
-LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool
+LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_kvargs
 LDLIBS += -lrte_cryptodev
 LDLIBS += -lrte_bus_vdev
 
drivers/crypto/mvsam/rte_mrvl_pmd.c +1 -0
index 73eff75..9d130b1 100644
@@ -11,6 +11,7 @@
 #include <rte_bus_vdev.h>
 #include <rte_malloc.h>
 #include <rte_cpuflags.h>
+#include <rte_kvargs.h>
 
 #include "rte_mrvl_pmd_private.h"
 
Signature · 1 line
2.7.4
#2 lore raw

Re: [PATCH 1/6] crypto/mvsam: fix shared library build

Please add cc: [email protected] for the fixes patches in the next version.

Quoted 37 lines · Tomasz Duszynski

Add missing rte_kvargs library dependency. Without that shared library build fails due to unresolved rte_kvargs_* symbols.

Fixes 25b05a1c806b ("crypto/mvsam: parse max number of sessions")
---
  drivers/crypto/mvsam/Makefile       | 2 +-
  drivers/crypto/mvsam/rte_mrvl_pmd.c | 1 +
  2 files changed, 2 insertions(+), 1 deletion(-)
drivers/crypto/mvsam/Makefile +1 -1
index c3dc72c..3290147 100644
@@ -31,7 +31,7 @@ EXPORT_MAP := rte_pmd_mvsam_version.map
 
  # external library dependencies
  LDLIBS += -L$(LIBMUSDK_PATH)/lib -lmusdk
-LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool
+LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_kvargs
  LDLIBS += -lrte_cryptodev
  LDLIBS += -lrte_bus_vdev
 
drivers/crypto/mvsam/rte_mrvl_pmd.c +1 -0
index 73eff75..9d130b1 100644
@@ -11,6 +11,7 @@
  #include <rte_bus_vdev.h>
  #include <rte_malloc.h>
  #include <rte_cpuflags.h>
+#include <rte_kvargs.h>
 
  #include "rte_mrvl_pmd_private.h"
 
#3 lore raw

PATCH 2/6 crypto/mvsam: update hash digest sizes

In reply to Tomasz Duszynski

From: Szymon Sliwa <[email protected]>

Update hash digest sizes to match hardware capabilities.

---
 drivers/crypto/mvsam/rte_mrvl_pmd_ops.c | 46 ++++++++++++++++-----------------
 1 file changed, 23 insertions(+), 23 deletions(-)
drivers/crypto/mvsam/rte_mrvl_pmd_ops.c +23 -23
index c045562..e2cfc07 100644
@@ -30,9 +30,9 @@ static const struct rte_cryptodev_capabilities
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 16,
+					.min = 12,
 					.max = 16,
-					.increment = 0
+					.increment = 4
 				},
 			}, }
 		}, }
@@ -50,9 +50,9 @@ static const struct rte_cryptodev_capabilities
 						.increment = 0
 					},
 					.digest_size = {
-						.min = 16,
+						.min = 12,
 						.max = 16,
-						.increment = 0
+						.increment = 4
 					},
 				}, }
 			}, }
@@ -70,9 +70,9 @@ static const struct rte_cryptodev_capabilities
 						.increment = 1
 					},
 					.digest_size = {
-						.min = 20,
+						.min = 12,
 						.max = 20,
-						.increment = 0
+						.increment = 4
 					},
 				}, }
 			}, }
@@ -90,9 +90,9 @@ static const struct rte_cryptodev_capabilities
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 20,
+					.min = 12,
 					.max = 20,
-					.increment = 0
+					.increment = 4
 				},
 			}, }
 		}, }
@@ -110,9 +110,9 @@ static const struct rte_cryptodev_capabilities
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 28,
+					.min = 12,
 					.max = 28,
-					.increment = 0
+					.increment = 4
 				},
 			}, }
 		}, }
@@ -130,9 +130,9 @@ static const struct rte_cryptodev_capabilities
 						.increment = 1
 					},
 					.digest_size = {
-						.min = 32,
+						.min = 12,
 						.max = 32,
-						.increment = 0
+						.increment = 4
 					},
 				}, }
 			}, }
@@ -150,9 +150,9 @@ static const struct rte_cryptodev_capabilities
 						.increment = 0
 					},
 					.digest_size = {
-						.min = 32,
+						.min = 12,
 						.max = 32,
-						.increment = 0
+						.increment = 4
 					},
 				}, }
 			}, }
@@ -170,9 +170,9 @@ static const struct rte_cryptodev_capabilities
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 48,
+					.min = 12,
 					.max = 48,
-					.increment = 0
+					.increment = 4
 				},
 			}, }
 		}, }
@@ -190,9 +190,9 @@ static const struct rte_cryptodev_capabilities
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 48,
+					.min = 12,
 					.max = 48,
-					.increment = 0
+					.increment = 4
 				},
 			}, }
 		}, }
@@ -210,9 +210,9 @@ static const struct rte_cryptodev_capabilities
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 64,
-					.max = 64,
-					.increment = 0
+					.min = 12,
+					.max = 48,
+					.increment = 4
 				},
 			}, }
 		}, }
@@ -230,8 +230,8 @@ static const struct rte_cryptodev_capabilities
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 64,
-					.max = 64,
+					.min = 12,
+					.max = 48,
 					.increment = 0
 				},
 			}, }
Signature · 1 line
2.7.4
#4 lore raw

Re: [PATCH 2/6] crypto/mvsam: update hash digest sizes

Hi Tomasz,

Is this patch a fix which needs to be applied for stable as well or you have added some changes in the code which can support this.

-Akhil

Quoted 147 lines · Tomasz Duszynski

From: Szymon Sliwa <[email protected]>

Update hash digest sizes to match hardware capabilities.

---
  drivers/crypto/mvsam/rte_mrvl_pmd_ops.c | 46 ++++++++++++++++-----------------
  1 file changed, 23 insertions(+), 23 deletions(-)
drivers/crypto/mvsam/rte_mrvl_pmd_ops.c +23 -23
index c045562..e2cfc07 100644
@@ -30,9 +30,9 @@ static const struct rte_cryptodev_capabilities
  					.increment = 1
  				},
  				.digest_size = {
-					.min = 16,
+					.min = 12,
  					.max = 16,
-					.increment = 0
+					.increment = 4
  				},
  			}, }
  		}, }
@@ -50,9 +50,9 @@ static const struct rte_cryptodev_capabilities
  						.increment = 0
  					},
  					.digest_size = {
-						.min = 16,
+						.min = 12,
  						.max = 16,
-						.increment = 0
+						.increment = 4
  					},
  				}, }
  			}, }
@@ -70,9 +70,9 @@ static const struct rte_cryptodev_capabilities
  						.increment = 1
  					},
  					.digest_size = {
-						.min = 20,
+						.min = 12,
  						.max = 20,
-						.increment = 0
+						.increment = 4
  					},
  				}, }
  			}, }
@@ -90,9 +90,9 @@ static const struct rte_cryptodev_capabilities
  					.increment = 0
  				},
  				.digest_size = {
-					.min = 20,
+					.min = 12,
  					.max = 20,
-					.increment = 0
+					.increment = 4
  				},
  			}, }
  		}, }
@@ -110,9 +110,9 @@ static const struct rte_cryptodev_capabilities
  					.increment = 0
  				},
  				.digest_size = {
-					.min = 28,
+					.min = 12,
  					.max = 28,
-					.increment = 0
+					.increment = 4
  				},
  			}, }
  		}, }
@@ -130,9 +130,9 @@ static const struct rte_cryptodev_capabilities
  						.increment = 1
  					},
  					.digest_size = {
-						.min = 32,
+						.min = 12,
  						.max = 32,
-						.increment = 0
+						.increment = 4
  					},
  				}, }
  			}, }
@@ -150,9 +150,9 @@ static const struct rte_cryptodev_capabilities
  						.increment = 0
  					},
  					.digest_size = {
-						.min = 32,
+						.min = 12,
  						.max = 32,
-						.increment = 0
+						.increment = 4
  					},
  				}, }
  			}, }
@@ -170,9 +170,9 @@ static const struct rte_cryptodev_capabilities
  					.increment = 1
  				},
  				.digest_size = {
-					.min = 48,
+					.min = 12,
  					.max = 48,
-					.increment = 0
+					.increment = 4
  				},
  			}, }
  		}, }
@@ -190,9 +190,9 @@ static const struct rte_cryptodev_capabilities
  					.increment = 0
  				},
  				.digest_size = {
-					.min = 48,
+					.min = 12,
  					.max = 48,
-					.increment = 0
+					.increment = 4
  				},
  			}, }
  		}, }
@@ -210,9 +210,9 @@ static const struct rte_cryptodev_capabilities
  					.increment = 1
  				},
  				.digest_size = {
-					.min = 64,
-					.max = 64,
-					.increment = 0
+					.min = 12,
+					.max = 48,
+					.increment = 4
  				},
  			}, }
  		}, }
@@ -230,8 +230,8 @@ static const struct rte_cryptodev_capabilities
  					.increment = 0
  				},
  				.digest_size = {
-					.min = 64,
-					.max = 64,
+					.min = 12,
+					.max = 48,
  					.increment = 0
  				},
  			}, }
#5 lore raw

PATCH 3/6 crypto/mvsam: add support for HMAC SHA224

In reply to Tomasz Duszynski

Add support for the HMAC SHA224 authentication algorithm.

---
 drivers/crypto/mvsam/rte_mrvl_pmd.c     |  3 +++
 drivers/crypto/mvsam/rte_mrvl_pmd_ops.c | 21 +++++++++++++++++++++
 2 files changed, 24 insertions(+)
drivers/crypto/mvsam/rte_mrvl_pmd.c +3 -0
index 9d130b1..5ef4139 100644
@@ -113,6 +113,9 @@ struct auth_params_mapping auth_map[RTE_CRYPTO_AUTH_LIST_END] = {
 	[RTE_CRYPTO_AUTH_SHA1] = {
 		.supported = ALGO_SUPPORTED,
 		.auth_alg = SAM_AUTH_HASH_SHA1 },
+	[RTE_CRYPTO_AUTH_SHA224_HMAC] = {
+		.supported = ALGO_SUPPORTED,
+		.auth_alg = SAM_AUTH_HMAC_SHA2_224 },
 	[RTE_CRYPTO_AUTH_SHA224] = {
 		.supported = ALGO_SUPPORTED,
 		.auth_alg = SAM_AUTH_HASH_SHA2_224 },
drivers/crypto/mvsam/rte_mrvl_pmd_ops.c +21 -0
index e2cfc07..d253b8f 100644
@@ -97,6 +97,27 @@ static const struct rte_cryptodev_capabilities
 			}, }
 		}, }
 	},
+	{
+		/* SHA224 HMAC */
+		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
+		{.sym = {
+			.xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
+			{.auth = {
+				.algo = RTE_CRYPTO_AUTH_SHA224_HMAC,
+				.block_size = 64,
+				.key_size = {
+					.min = 1,
+					.max = 64,
+					.increment = 1
+				},
+				.digest_size = {
+					.min = 28,
+					.max = 28,
+					.increment = 0
+				},
+			}, }
+		}, }
+	},
 	{	/* SHA224 */
 		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
 		{.sym = {
Signature · 1 line
2.7.4
#6 lore raw

Re: [PATCH 3/6] crypto/mvsam: add support for HMAC SHA224

Hi Tomasz,

Quoted 45 lines · Tomasz Duszynski

Add support for the HMAC SHA224 authentication algorithm.

---
  drivers/crypto/mvsam/rte_mrvl_pmd.c     |  3 +++
  drivers/crypto/mvsam/rte_mrvl_pmd_ops.c | 21 +++++++++++++++++++++
  2 files changed, 24 insertions(+)
drivers/crypto/mvsam/rte_mrvl_pmd.c +3 -0
index 9d130b1..5ef4139 100644
@@ -113,6 +113,9 @@ struct auth_params_mapping auth_map[RTE_CRYPTO_AUTH_LIST_END] = {
  	[RTE_CRYPTO_AUTH_SHA1] = {
  		.supported = ALGO_SUPPORTED,
  		.auth_alg = SAM_AUTH_HASH_SHA1 },
+	[RTE_CRYPTO_AUTH_SHA224_HMAC] = {
+		.supported = ALGO_SUPPORTED,
+		.auth_alg = SAM_AUTH_HMAC_SHA2_224 },
  	[RTE_CRYPTO_AUTH_SHA224] = {
  		.supported = ALGO_SUPPORTED,
  		.auth_alg = SAM_AUTH_HASH_SHA2_224 },
drivers/crypto/mvsam/rte_mrvl_pmd_ops.c +14 -0
index e2cfc07..d253b8f 100644
@@ -97,6 +97,27 @@ static const struct rte_cryptodev_capabilities
  			}, }
  		}, }
  	},
+	{
+		/* SHA224 HMAC */
+		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
+		{.sym = {
+			.xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
+			{.auth = {
+				.algo = RTE_CRYPTO_AUTH_SHA224_HMAC,
+				.block_size = 64,
+				.key_size = {
+					.min = 1,
+					.max = 64,
+					.increment = 1
+				},
+				.digest_size = {

drivers/crypto/mvsam/rte_mrvl_pmd_ops.c static const struct rte_cryptodev_capabilities · line 123

Quoted 10 lines
drivers/crypto/mvsam/rte_mrvl_pmd_ops.c +7 -0
+					.min = 28,
+					.max = 28,
+					.increment = 0
+				},
+			}, }
+		}, }
+	},
  	{	/* SHA224 */
  		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
  		{.sym = {

doc shall also be updated for each of the new algorithm supported.

Also please rephrase the subject as
crypto/mvsam: support for HMAC SHA224

Please change the subject for other patches as well.

Thanks,
Akhil

#7 lore raw

Re: [PATCH 3/6] crypto/mvsam: add support for HMAC SHA224

Quoted 4 lines · Akhil Goyal

Hi Tomasz,

Quoted 1 line · Tomasz Duszynski

Add support for the HMAC SHA224 authentication algorithm.

[...]

Quoted 4 lines
Quoted 3 lines
  	{	/* SHA224 */
  		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
  		{.sym = {

doc shall also be updated for each of the new algorithm supported.

Doc is updated in pending patch:
http://patches.dpdk.org/patch/44253/

Quoted 4 lines

Also please rephrase the subject as
crypto/mvsam: support for HMAC SHA224

Please change the subject for other patches as well.

Changed.

#8 lore raw

PATCH 4/6 crypto/mvsam: add support for AES ECB

In reply to Tomasz Duszynski

Add support for AES128/192/256 in ECB mode.

---
 drivers/crypto/mvsam/rte_mrvl_pmd.c     |  5 +++++
 drivers/crypto/mvsam/rte_mrvl_pmd_ops.c | 20 ++++++++++++++++++++
 2 files changed, 25 insertions(+)
drivers/crypto/mvsam/rte_mrvl_pmd.c +5 -0
index 5ef4139..08d4a23 100644
@@ -94,6 +94,11 @@ struct cipher_params_mapping cipher_map[RTE_CRYPTO_CIPHER_LIST_END] = {
 		.cipher_alg = SAM_CIPHER_AES,
 		.cipher_mode = SAM_CIPHER_CTR,
 		.max_key_len = BITS2BYTES(256) },
+	[RTE_CRYPTO_CIPHER_AES_ECB] = {
+		.supported = ALGO_SUPPORTED,
+		.cipher_alg = SAM_CIPHER_AES,
+		.cipher_mode = SAM_CIPHER_ECB,
+		.max_key_len = BITS2BYTES(256) },
 };
 
 /**
drivers/crypto/mvsam/rte_mrvl_pmd_ops.c +20 -0
index d253b8f..3d3bbf1 100644
@@ -298,6 +298,26 @@ static const struct rte_cryptodev_capabilities
 			}, }
 		}, }
 	},
+	{	/* AES ECB */
+		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
+		{.sym = {
+			.xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
+			{.cipher = {
+				.algo = RTE_CRYPTO_CIPHER_AES_ECB,
+				.block_size = 16,
+				.key_size = {
+					.min = 16,
+					.max = 32,
+					.increment = 8
+				},
+				.iv_size = {
+					.min = 0,
+					.max = 0,
+					.increment = 0
+				}
+			}, }
+		}, }
+	},
 	{	/* AES GCM */
 		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
 		{.sym = {
Signature · 1 line
2.7.4
#9 lore raw

Re: [PATCH 4/6] crypto/mvsam: add support for AES ECB

Quoted 40 lines · Tomasz Duszynski

Add support for AES128/192/256 in ECB mode.

---
  drivers/crypto/mvsam/rte_mrvl_pmd.c     |  5 +++++
  drivers/crypto/mvsam/rte_mrvl_pmd_ops.c | 20 ++++++++++++++++++++
  2 files changed, 25 insertions(+)
drivers/crypto/mvsam/rte_mrvl_pmd.c +5 -0
index 5ef4139..08d4a23 100644
@@ -94,6 +94,11 @@ struct cipher_params_mapping cipher_map[RTE_CRYPTO_CIPHER_LIST_END] = {
  		.cipher_alg = SAM_CIPHER_AES,
  		.cipher_mode = SAM_CIPHER_CTR,
  		.max_key_len = BITS2BYTES(256) },
+	[RTE_CRYPTO_CIPHER_AES_ECB] = {
+		.supported = ALGO_SUPPORTED,
+		.cipher_alg = SAM_CIPHER_AES,
+		.cipher_mode = SAM_CIPHER_ECB,
+		.max_key_len = BITS2BYTES(256) },
  };
 
  /**
drivers/crypto/mvsam/rte_mrvl_pmd_ops.c +7 -0
index d253b8f..3d3bbf1 100644
@@ -298,6 +298,26 @@ static const struct rte_cryptodev_capabilities
  			}, }
  		}, }
  	},
+	{	/* AES ECB */
+		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
+		{.sym = {
+			.xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
+			{.cipher = {
+				.algo = RTE_CRYPTO_CIPHER_AES_ECB,
+				.block_size = 16,

drivers/crypto/mvsam/rte_mrvl_pmd_ops.c static const struct rte_cryptodev_capabilities · line 317

Quoted 10 lines
drivers/crypto/mvsam/rte_mrvl_pmd_ops.c +10 -0
+				.key_size = {
+					.min = 16,
+					.max = 32,
+					.increment = 8
+				},
+				.iv_size = {
+					.min = 0,
+					.max = 0,
+					.increment = 0
+				}

iv size may not be zero in this case and also in other patch for 3des. Please check

Quoted 6 lines
drivers/crypto/mvsam/rte_mrvl_pmd_ops.c +3 -0
+			}, }
+		}, }
+	},
  	{	/* AES GCM */
  		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
  		{.sym = {
#10 lore raw

Re: [PATCH 4/6] crypto/mvsam: add support for AES ECB

Akhil

This is ECB mode so AFAIU there is no need for IV as this is not feed forward/back type of algo and there is nothing extra needed by the first block (same thing in ccp driver).

I'm leaving this as it is (same for 3DES).

Quoted 1 line · Akhil Goyal

On 8/24/2018 7:24 PM, Tomasz Duszynski wrote:

[...]

Quoted 1 line
Quoted 1 line
drivers/crypto/mvsam/rte_mrvl_pmd.c +1 -0
+	[RTE_CRYPTO_CIPHER_AES_ECB] = {

[...]

Quoted 2 lines
Quoted 2 lines
drivers/crypto/mvsam/rte_mrvl_pmd_ops.c +2 -0
+				.algo = RTE_CRYPTO_CIPHER_AES_ECB,
+				.block_size = 16,

[...]

Quoted 7 lines

drivers/crypto/mvsam/rte_mrvl_pmd_ops.c static const struct rte_cryptodev_capabilities · line 317

Quoted 5 lines
drivers/crypto/mvsam/rte_mrvl_pmd_ops.c +5 -0
+				.iv_size = {
+					.min = 0,
+					.max = 0,
+					.increment = 0
+				}

iv size may not be zero in this case and also in other patch for 3des. Please check

#11 lore raw

PATCH 5/6 crypto/mvsam: add support for crypto/auth NULL algorithms

In reply to Tomasz Duszynski

Add support for both cipher and auth NULL algorithms.

---
 drivers/crypto/mvsam/rte_mrvl_pmd.c     |  6 +++++
 drivers/crypto/mvsam/rte_mrvl_pmd_ops.c | 45 +++++++++++++++++++++++++++++++++
 2 files changed, 51 insertions(+)
drivers/crypto/mvsam/rte_mrvl_pmd.c +6 -0
index 08d4a23..961802e 100644
@@ -69,6 +69,9 @@ __rte_aligned(32);
  */
 static const
 struct cipher_params_mapping cipher_map[RTE_CRYPTO_CIPHER_LIST_END] = {
+	[RTE_CRYPTO_CIPHER_NULL] = {
+		.supported = ALGO_SUPPORTED,
+		.cipher_alg = SAM_CIPHER_NONE },
 	[RTE_CRYPTO_CIPHER_3DES_CBC] = {
 		.supported = ALGO_SUPPORTED,
 		.cipher_alg = SAM_CIPHER_3DES,
@@ -106,6 +109,9 @@ struct cipher_params_mapping cipher_map[RTE_CRYPTO_CIPHER_LIST_END] = {
  */
 static const
 struct auth_params_mapping auth_map[RTE_CRYPTO_AUTH_LIST_END] = {
+	[RTE_CRYPTO_AUTH_NULL] = {
+		.supported = ALGO_SUPPORTED,
+		.auth_alg = SAM_AUTH_NONE },
 	[RTE_CRYPTO_AUTH_MD5_HMAC] = {
 		.supported = ALGO_SUPPORTED,
 		.auth_alg = SAM_AUTH_HMAC_MD5 },
drivers/crypto/mvsam/rte_mrvl_pmd_ops.c +45 -0

51 lines not on this page · raw message

Signature · 1 line
2.7.4
#12 lore raw

PATCH 6/6 crypto/mvsam: add 3DES ECB to the capabilities list

In reply to Tomasz Duszynski

3DES in ECB mode is supported by the PMD thus specific entry should exist in the crypto PMD capabilities list.

---
 drivers/crypto/mvsam/rte_mrvl_pmd_ops.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
drivers/crypto/mvsam/rte_mrvl_pmd_ops.c +20 -0
index f3251aa..62f5a2a 100644
@@ -413,6 +413,26 @@ static const struct rte_cryptodev_capabilities
 			}, }
 		}, }
 	},
+	{	/* 3DES ECB */
+		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
+		{.sym = {
+			.xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
+			{.cipher = {
+				.algo = RTE_CRYPTO_CIPHER_3DES_ECB,
+				.block_size = 8,
+				.key_size = {
+					.min = 24,
+					.max = 24,
+					.increment = 0
+				},
+				.iv_size = {
+					.min = 0,
+					.max = 0,
+					.increment = 0
+				}
+			}, }
+		}, }
+	},
 	{	/* NULL (AUTH) */
 		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
 		{.sym = {
Signature · 1 line
2.7.4
#13 lore raw

v2 cover crypto/mvsam: add new features and fixes

In reply to Tomasz Duszynski

This patch series introduces following changes:

* Add support for HMAC SHA224, AES ECB and NULL algorithms.
* Update hash digest sizes to match hardware capabilities.
* Fix a shared build.

v2:
* added Cc: [email protected] to couple of patches
* rephrased the subject/commit msgs

Szymon Sliwa (1):
crypto/mvsam: update hash digest sizes

Tomasz Duszynski (5):
crypto/mvsam: fix shared library build crypto/mvsam: support for HMAC SHA224 crypto/mvsam: support for AES ECB crypto/mvsam: support for crypto/auth NULL algorithms crypto/mvsam: add 3DES ECB to the capabilities list

 drivers/crypto/mvsam/Makefile           |   2 +-
 drivers/crypto/mvsam/rte_mrvl_pmd.c     |  15 ++++
 drivers/crypto/mvsam/rte_mrvl_pmd_ops.c | 150 +++++++++++++++++++++++++++-----
 3 files changed, 144 insertions(+), 23 deletions(-)
Signature · 1 line
2.7.4
#14 lore raw

PATCH v2 1/6 crypto/mvsam: fix shared library build

From: Tomasz Duszynski <[email protected]>

Add missing rte_kvargs library dependency. Without that shared library build fails due to unresolved rte_kvargs_* symbols.

Fixes 25b05a1c806b ("crypto/mvsam: parse max number of sessions")
---
 drivers/crypto/mvsam/Makefile       | 2 +-
 drivers/crypto/mvsam/rte_mrvl_pmd.c | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
drivers/crypto/mvsam/Makefile +1 -1
index c3dc72c..3290147 100644
@@ -31,7 +31,7 @@ EXPORT_MAP := rte_pmd_mvsam_version.map
 
 # external library dependencies
 LDLIBS += -L$(LIBMUSDK_PATH)/lib -lmusdk
-LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool
+LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_kvargs
 LDLIBS += -lrte_cryptodev
 LDLIBS += -lrte_bus_vdev
 
drivers/crypto/mvsam/rte_mrvl_pmd.c +1 -0
index 73eff75..9d130b1 100644
@@ -11,6 +11,7 @@
 #include <rte_bus_vdev.h>
 #include <rte_malloc.h>
 #include <rte_cpuflags.h>
+#include <rte_kvargs.h>
 
 #include "rte_mrvl_pmd_private.h"
 
Signature · 1 line
2.7.4
#15 lore raw

PATCH v2 2/6 crypto/mvsam: update hash digest sizes

In reply to Andrzej Ostruszka

From: Szymon Sliwa <[email protected]>

Update hash digest sizes to match hardware capabilities.

---
 drivers/crypto/mvsam/rte_mrvl_pmd_ops.c | 46 ++++++++++++++++-----------------
 1 file changed, 23 insertions(+), 23 deletions(-)
drivers/crypto/mvsam/rte_mrvl_pmd_ops.c +23 -23
index c045562..e2cfc07 100644
@@ -30,9 +30,9 @@ static const struct rte_cryptodev_capabilities
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 16,
+					.min = 12,
 					.max = 16,
-					.increment = 0
+					.increment = 4
 				},
 			}, }
 		}, }
@@ -50,9 +50,9 @@ static const struct rte_cryptodev_capabilities
 						.increment = 0
 					},
 					.digest_size = {
-						.min = 16,
+						.min = 12,
 						.max = 16,
-						.increment = 0
+						.increment = 4
 					},
 				}, }
 			}, }
@@ -70,9 +70,9 @@ static const struct rte_cryptodev_capabilities
 						.increment = 1
 					},
 					.digest_size = {
-						.min = 20,
+						.min = 12,
 						.max = 20,
-						.increment = 0
+						.increment = 4
 					},
 				}, }
 			}, }
@@ -90,9 +90,9 @@ static const struct rte_cryptodev_capabilities
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 20,
+					.min = 12,
 					.max = 20,
-					.increment = 0
+					.increment = 4
 				},
 			}, }
 		}, }
@@ -110,9 +110,9 @@ static const struct rte_cryptodev_capabilities
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 28,
+					.min = 12,
 					.max = 28,
-					.increment = 0
+					.increment = 4
 				},
 			}, }
 		}, }
@@ -130,9 +130,9 @@ static const struct rte_cryptodev_capabilities
 						.increment = 1
 					},
 					.digest_size = {
-						.min = 32,
+						.min = 12,
 						.max = 32,
-						.increment = 0
+						.increment = 4
 					},
 				}, }
 			}, }
@@ -150,9 +150,9 @@ static const struct rte_cryptodev_capabilities
 						.increment = 0
 					},
 					.digest_size = {
-						.min = 32,
+						.min = 12,
 						.max = 32,
-						.increment = 0
+						.increment = 4
 					},
 				}, }
 			}, }
@@ -170,9 +170,9 @@ static const struct rte_cryptodev_capabilities
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 48,
+					.min = 12,
 					.max = 48,
-					.increment = 0
+					.increment = 4
 				},
 			}, }
 		}, }
@@ -190,9 +190,9 @@ static const struct rte_cryptodev_capabilities
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 48,
+					.min = 12,
 					.max = 48,
-					.increment = 0
+					.increment = 4
 				},
 			}, }
 		}, }
@@ -210,9 +210,9 @@ static const struct rte_cryptodev_capabilities
 					.increment = 1
 				},
 				.digest_size = {
-					.min = 64,
-					.max = 64,
-					.increment = 0
+					.min = 12,
+					.max = 48,
+					.increment = 4
 				},
 			}, }
 		}, }
@@ -230,8 +230,8 @@ static const struct rte_cryptodev_capabilities
 					.increment = 0
 				},
 				.digest_size = {
-					.min = 64,
-					.max = 64,
+					.min = 12,
+					.max = 48,
 					.increment = 0
 				},
 			}, }
Signature · 1 line
2.7.4
#16 lore raw

PATCH v2 3/6 crypto/mvsam: support for HMAC SHA224

In reply to Andrzej Ostruszka

From: Tomasz Duszynski <[email protected]>

Add support for the HMAC SHA224 authentication algorithm.

---
 drivers/crypto/mvsam/rte_mrvl_pmd.c     |  3 +++
 drivers/crypto/mvsam/rte_mrvl_pmd_ops.c | 21 +++++++++++++++++++++
 2 files changed, 24 insertions(+)
drivers/crypto/mvsam/rte_mrvl_pmd.c +3 -0
index 9d130b1..5ef4139 100644
@@ -113,6 +113,9 @@ struct auth_params_mapping auth_map[RTE_CRYPTO_AUTH_LIST_END] = {
 	[RTE_CRYPTO_AUTH_SHA1] = {
 		.supported = ALGO_SUPPORTED,
 		.auth_alg = SAM_AUTH_HASH_SHA1 },
+	[RTE_CRYPTO_AUTH_SHA224_HMAC] = {
+		.supported = ALGO_SUPPORTED,
+		.auth_alg = SAM_AUTH_HMAC_SHA2_224 },
 	[RTE_CRYPTO_AUTH_SHA224] = {
 		.supported = ALGO_SUPPORTED,
 		.auth_alg = SAM_AUTH_HASH_SHA2_224 },
drivers/crypto/mvsam/rte_mrvl_pmd_ops.c +21 -0
index e2cfc07..d253b8f 100644
@@ -97,6 +97,27 @@ static const struct rte_cryptodev_capabilities
 			}, }
 		}, }
 	},
+	{
+		/* SHA224 HMAC */
+		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
+		{.sym = {
+			.xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
+			{.auth = {
+				.algo = RTE_CRYPTO_AUTH_SHA224_HMAC,
+				.block_size = 64,
+				.key_size = {
+					.min = 1,
+					.max = 64,
+					.increment = 1
+				},
+				.digest_size = {
+					.min = 28,
+					.max = 28,
+					.increment = 0
+				},
+			}, }
+		}, }
+	},
 	{	/* SHA224 */
 		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
 		{.sym = {
Signature · 1 line
2.7.4
#17 lore raw

PATCH v2 4/6 crypto/mvsam: support for AES ECB

In reply to Andrzej Ostruszka

From: Tomasz Duszynski <[email protected]>

Add support for AES128/192/256 in ECB mode.

---
 drivers/crypto/mvsam/rte_mrvl_pmd.c     |  5 +++++
 drivers/crypto/mvsam/rte_mrvl_pmd_ops.c | 20 ++++++++++++++++++++
 2 files changed, 25 insertions(+)
drivers/crypto/mvsam/rte_mrvl_pmd.c +5 -0
index 5ef4139..08d4a23 100644
@@ -94,6 +94,11 @@ struct cipher_params_mapping cipher_map[RTE_CRYPTO_CIPHER_LIST_END] = {
 		.cipher_alg = SAM_CIPHER_AES,
 		.cipher_mode = SAM_CIPHER_CTR,
 		.max_key_len = BITS2BYTES(256) },
+	[RTE_CRYPTO_CIPHER_AES_ECB] = {
+		.supported = ALGO_SUPPORTED,
+		.cipher_alg = SAM_CIPHER_AES,
+		.cipher_mode = SAM_CIPHER_ECB,
+		.max_key_len = BITS2BYTES(256) },
 };
 
 /**
drivers/crypto/mvsam/rte_mrvl_pmd_ops.c +20 -0
index d253b8f..3d3bbf1 100644
@@ -298,6 +298,26 @@ static const struct rte_cryptodev_capabilities
 			}, }
 		}, }
 	},
+	{	/* AES ECB */
+		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
+		{.sym = {
+			.xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
+			{.cipher = {
+				.algo = RTE_CRYPTO_CIPHER_AES_ECB,
+				.block_size = 16,
+				.key_size = {
+					.min = 16,
+					.max = 32,
+					.increment = 8
+				},
+				.iv_size = {
+					.min = 0,
+					.max = 0,
+					.increment = 0
+				}
+			}, }
+		}, }
+	},
 	{	/* AES GCM */
 		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
 		{.sym = {
Signature · 1 line
2.7.4
#18 lore raw

PATCH v2 5/6 crypto/mvsam: support for crypto/auth NULL algorithms

In reply to Andrzej Ostruszka

From: Tomasz Duszynski <[email protected]>

Add support for both cipher and auth NULL algorithms.

---
 drivers/crypto/mvsam/rte_mrvl_pmd.c     |  6 +++++
 drivers/crypto/mvsam/rte_mrvl_pmd_ops.c | 45 +++++++++++++++++++++++++++++++++
 2 files changed, 51 insertions(+)
drivers/crypto/mvsam/rte_mrvl_pmd.c +6 -0
index 08d4a23..961802e 100644
@@ -69,6 +69,9 @@ __rte_aligned(32);
  */
 static const
 struct cipher_params_mapping cipher_map[RTE_CRYPTO_CIPHER_LIST_END] = {
+	[RTE_CRYPTO_CIPHER_NULL] = {
+		.supported = ALGO_SUPPORTED,
+		.cipher_alg = SAM_CIPHER_NONE },
 	[RTE_CRYPTO_CIPHER_3DES_CBC] = {
 		.supported = ALGO_SUPPORTED,
 		.cipher_alg = SAM_CIPHER_3DES,
@@ -106,6 +109,9 @@ struct cipher_params_mapping cipher_map[RTE_CRYPTO_CIPHER_LIST_END] = {
  */
 static const
 struct auth_params_mapping auth_map[RTE_CRYPTO_AUTH_LIST_END] = {
+	[RTE_CRYPTO_AUTH_NULL] = {
+		.supported = ALGO_SUPPORTED,
+		.auth_alg = SAM_AUTH_NONE },
 	[RTE_CRYPTO_AUTH_MD5_HMAC] = {
 		.supported = ALGO_SUPPORTED,
 		.auth_alg = SAM_AUTH_HMAC_MD5 },
drivers/crypto/mvsam/rte_mrvl_pmd_ops.c +45 -0

51 lines not on this page · raw message

Signature · 1 line
2.7.4
#19 lore raw

PATCH v2 6/6 crypto/mvsam: add 3DES ECB to the capabilities list

In reply to Andrzej Ostruszka

From: Tomasz Duszynski <[email protected]>

3DES in ECB mode is supported by the PMD thus specific entry should exist in the crypto PMD capabilities list.

---
 drivers/crypto/mvsam/rte_mrvl_pmd_ops.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
drivers/crypto/mvsam/rte_mrvl_pmd_ops.c +20 -0
index f3251aa..62f5a2a 100644
@@ -413,6 +413,26 @@ static const struct rte_cryptodev_capabilities
 			}, }
 		}, }
 	},
+	{	/* 3DES ECB */
+		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
+		{.sym = {
+			.xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
+			{.cipher = {
+				.algo = RTE_CRYPTO_CIPHER_3DES_ECB,
+				.block_size = 8,
+				.key_size = {
+					.min = 24,
+					.max = 24,
+					.increment = 0
+				},
+				.iv_size = {
+					.min = 0,
+					.max = 0,
+					.increment = 0
+				}
+			}, }
+		}, }
+	},
 	{	/* NULL (AUTH) */
 		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
 		{.sym = {
Signature · 1 line
2.7.4
#20 lore raw
In reply to Andrzej Ostruszka

Hi Andrzej,

Quoted 20 lines · Andrzej Ostruszka

This patch series introduces following changes:

* Add support for HMAC SHA224, AES ECB and NULL algorithms.
* Update hash digest sizes to match hardware capabilities.
* Fix a shared build.

v2:
* added Cc: [email protected] to couple of patches
* rephrased the subject/commit msgs

Szymon Sliwa (1):
crypto/mvsam: update hash digest sizes

Tomasz Duszynski (5):
crypto/mvsam: fix shared library build crypto/mvsam: support for HMAC SHA224 crypto/mvsam: support for AES ECB crypto/mvsam: support for crypto/auth NULL algorithms crypto/mvsam: add 3DES ECB to the capabilities list

Quoted 5 lines
  drivers/crypto/mvsam/Makefile           |   2 +-
  drivers/crypto/mvsam/rte_mrvl_pmd.c     |  15 ++++
  drivers/crypto/mvsam/rte_mrvl_pmd_ops.c | 150 +++++++++++++++++++++++++++-----
  3 files changed, 144 insertions(+), 23 deletions(-)

I am not able to cleanly apply your 3 patchsets.
http://patches.dpdk.org/user/todo/dpdk/?series=1172
http://patches.dpdk.org/user/todo/dpdk/?series=1440
http://patches.dpdk.org/user/todo/dpdk/?series=1442

Could you please rebase and send a single patchset if possible. Also, I believe http://patches.dpdk.org/patch/44254/
can be squashed with http://patches.dpdk.org/patch/45104/

Thanks,
Akhil

#21 lore raw

Hello Akhil

Quoted 1 line · Akhil Goyal

Hi Andrzej,

[...]

Quoted 6 lines

I am not able to cleanly apply your 3 patchsets.
http://patches.dpdk.org/user/todo/dpdk/?series=1172
http://patches.dpdk.org/user/todo/dpdk/?series=1440
http://patches.dpdk.org/user/todo/dpdk/?series=1442

Could you please rebase and send a single patchset if possible.

The problem is that next-crypto is not in sync with next-net. In particular it is missing this commit:

7a39d1b common/mvep: add common code for Marvell drivers

Could you rebase/merge next-crypto with next-net to have this commit?

Quoted 2 lines

Also, I believe http://patches.dpdk.org/patch/44254/
can be squashed with http://patches.dpdk.org/patch/45104/

No problem I can package all patches into one set but as mentioned above some of them depend on common mvep code introduced already in next-net.

Best regards
Andrzej

#22 lore raw
Quoted 10 lines · Andrzej Ostruszka

Hello Akhil

Quoted 1 line · Akhil Goyal

Hi Andrzej,

[...]

Quoted 5 lines

I am not able to cleanly apply your 3 patchsets.
http://patches.dpdk.org/user/todo/dpdk/?series=1172
http://patches.dpdk.org/user/todo/dpdk/?series=1440
http://patches.dpdk.org/user/todo/dpdk/?series=1442

Quoted 7 lines
Quoted 1 line

Could you please rebase and send a single patchset if possible.

The problem is that next-crypto is not in sync with next-net. In particular it is missing this commit:

7a39d1b common/mvep: add common code for Marvell drivers

Could you rebase/merge next-crypto with next-net to have this commit?

If it is dependent on net-next, then I will defer this set to be applied next week when the master is in sync with net-next.

Quoted 5 lines
Quoted 3 lines

Also, I believe http://patches.dpdk.org/patch/44254/
can be squashed with http://patches.dpdk.org/patch/45104/

No problem I can package all patches into one set but as mentioned above some of them depend on common mvep code introduced already in next-net.

No need for now.. I will wait for master to get in sync and then apply the dependent patches. Is there any series which can be applied without any dependency?
And it would be a good practice to mention the dependencies in the cover note in future.

-Akhil

#23 lore raw
In reply to Andrzej Ostruszka
Quoted 20 lines · Andrzej Ostruszka

This patch series introduces following changes:

* Add support for HMAC SHA224, AES ECB and NULL algorithms.
* Update hash digest sizes to match hardware capabilities.
* Fix a shared build.

v2:
* added Cc: [email protected] to couple of patches
* rephrased the subject/commit msgs

Szymon Sliwa (1):
crypto/mvsam: update hash digest sizes

Tomasz Duszynski (5):
crypto/mvsam: fix shared library build crypto/mvsam: support for HMAC SHA224 crypto/mvsam: support for AES ECB crypto/mvsam: support for crypto/auth NULL algorithms crypto/mvsam: add 3DES ECB to the capabilities list

Quoted 4 lines
  drivers/crypto/mvsam/Makefile           |   2 +-
  drivers/crypto/mvsam/rte_mrvl_pmd.c     |  15 ++++
  drivers/crypto/mvsam/rte_mrvl_pmd_ops.c | 150 +++++++++++++++++++++++++++-----
  3 files changed, 144 insertions(+), 23 deletions(-)

Series applied to dpdk-next-crypto

Thanks