DPDK patches and discussions
 help / color / mirror / Atom feed
From: Fiona Trahe <fiona.trahe@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH v9 3/5] cryptodev: remove unused phys_addr field from key
Date: Thu, 10 Mar 2016 15:41:11 +0000	[thread overview]
Message-ID: <1457624473-11138-4-git-send-email-fiona.trahe@intel.com> (raw)
In-Reply-To: <1457617381-8296-1-git-send-email-fiona.trahe@intel.com>

Remove unused phys_addr field from key in crypto_xform, simplifiy struct
and fix knock-on impacts in l2fwd-crypto app

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
---
 examples/l2fwd-crypto/main.c          | 42 ++++++++++++++++++++++++++---------
 lib/librte_cryptodev/rte_crypto_sym.h | 16 ++++++-------
 2 files changed, 39 insertions(+), 19 deletions(-)

diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c
index ee519e7..9b6b7ef 100644
--- a/examples/l2fwd-crypto/main.c
+++ b/examples/l2fwd-crypto/main.c
@@ -112,6 +112,12 @@ enum l2fwd_crypto_xform_chain {
 	L2FWD_CRYPTO_HASH_CIPHER
 };
 
+struct l2fwd_key {
+	uint8_t *data;
+	uint32_t length;
+	phys_addr_t phys_addr;
+};
+
 /** l2fwd crypto application command line options */
 struct l2fwd_crypto_options {
 	unsigned portmask;
@@ -127,7 +133,7 @@ struct l2fwd_crypto_options {
 	struct rte_crypto_sym_xform cipher_xform;
 	uint8_t ckey_data[32];
 
-	struct rte_crypto_key iv_key;
+	struct l2fwd_key iv_key;
 	uint8_t ivkey_data[16];
 
 	struct rte_crypto_sym_xform auth_xform;
@@ -141,7 +147,7 @@ struct l2fwd_crypto_params {
 
 	unsigned digest_length;
 	unsigned block_size;
-	struct rte_crypto_key iv_key;
+	struct l2fwd_key iv_key;
 	struct rte_cryptodev_sym_session *session;
 };
 
@@ -744,7 +750,7 @@ parse_cipher_op(enum rte_crypto_cipher_operation *op, char *optarg)
 
 /** Parse crypto key command line argument */
 static int
-parse_key(struct rte_crypto_key *key __rte_unused,
+parse_key(struct l2fwd_key *key __rte_unused,
 		unsigned length __rte_unused, char *arg __rte_unused)
 {
 	printf("Currently an unsupported argument!\n");
@@ -820,11 +826,18 @@ l2fwd_crypto_parse_args_long_options(struct l2fwd_crypto_options *options,
 		return parse_cipher_op(&options->cipher_xform.cipher.op,
 				optarg);
 
-	else if (strcmp(lgopts[option_index].name, "cipher_key") == 0)
-		return parse_key(&options->cipher_xform.cipher.key,
-				sizeof(options->ckey_data), optarg);
+	else if (strcmp(lgopts[option_index].name, "cipher_key") == 0) {
+		struct l2fwd_key key = { 0 };
+		int retval = 0;
+
+		retval = parse_key(&key, sizeof(options->ckey_data), optarg);
+
+		options->cipher_xform.cipher.key.data = key.data;
+		options->cipher_xform.cipher.key.length = key.length;
 
-	else if (strcmp(lgopts[option_index].name, "iv") == 0)
+		return retval;
+
+	} else if (strcmp(lgopts[option_index].name, "iv") == 0)
 		return parse_key(&options->iv_key, sizeof(options->ivkey_data),
 				optarg);
 
@@ -837,11 +850,18 @@ l2fwd_crypto_parse_args_long_options(struct l2fwd_crypto_options *options,
 		return parse_auth_op(&options->auth_xform.auth.op,
 				optarg);
 
-	else if (strcmp(lgopts[option_index].name, "auth_key") == 0)
-		return parse_key(&options->auth_xform.auth.key,
-				sizeof(options->akey_data), optarg);
+	else if (strcmp(lgopts[option_index].name, "auth_key") == 0) {
+		struct l2fwd_key key = { 0 };
+		int retval = 0;
+
+		retval = parse_key(&key, sizeof(options->akey_data), optarg);
+
+		options->auth_xform.auth.key.data = key.data;
+		options->auth_xform.auth.key.length = key.length;
+
+		return retval;
 
-	else if (strcmp(lgopts[option_index].name, "sessionless") == 0) {
+	} else if (strcmp(lgopts[option_index].name, "sessionless") == 0) {
 		options->sessionless = 1;
 		return 0;
 	}
diff --git a/lib/librte_cryptodev/rte_crypto_sym.h b/lib/librte_cryptodev/rte_crypto_sym.h
index de6c701..270510e 100644
--- a/lib/librte_cryptodev/rte_crypto_sym.h
+++ b/lib/librte_cryptodev/rte_crypto_sym.h
@@ -111,12 +111,6 @@ enum rte_crypto_cipher_operation {
 	/**< Decrypt cipher operation */
 };
 
-/** Crypto key structure */
-struct rte_crypto_key {
-	uint8_t *data;  /**< pointer to key data */
-	phys_addr_t phys_addr;
-	size_t length;  /**< key length in bytes */
-};
 
 /**
  * Symmetric Cipher Setup Data.
@@ -133,7 +127,10 @@ struct rte_crypto_cipher_xform {
 	enum rte_crypto_cipher_algorithm algo;
 	/**< Cipher algorithm */
 
-	struct rte_crypto_key key;
+	struct {
+		uint8_t *data;  /**< pointer to key data */
+		size_t length;  /**< key length in bytes */
+	} key;
 	/**< Cipher key
 	 *
 	 * For the RTE_CRYPTO_CIPHER_AES_F8 mode of operation, key.data will
@@ -257,7 +254,10 @@ struct rte_crypto_auth_xform {
 	enum rte_crypto_auth_algorithm algo;
 	/**< Authentication algorithm selection */
 
-	struct rte_crypto_key key;
+	struct {
+		uint8_t *data;  /**< pointer to key data */
+		size_t length;  /**< key length in bytes */
+	} key;
 	/**< Authentication key data.
 	 * The authentication key length MUST be less than or equal to the
 	 * block size of the algorithm. It is the callers responsibility to
-- 
2.5.0

  parent reply	other threads:[~2016-03-10 15:49 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-30 13:07 [dpdk-dev] [PATCH] cryptodev: API change to rte_crypto_op bursts Declan Doherty
2016-02-08 17:50 ` Trahe, Fiona
2016-02-19 11:01 ` [dpdk-dev] [PATCH v2 0/2] cryptodev API changes Declan Doherty
2016-02-19 11:01   ` [dpdk-dev] [PATCH v2 1/2] cryptodev: API tidy and changes to support future extensions Declan Doherty
2016-02-19 11:01   ` [dpdk-dev] [PATCH v2 2/2] cryptodev: change burst API to be crypto op oriented Declan Doherty
2016-02-22 11:17     ` Trahe, Fiona
2016-02-22 18:23     ` Trahe, Fiona
2016-02-22 18:56     ` Trahe, Fiona
2016-02-26 17:30   ` [dpdk-dev] [PATCH v3 0/2] cryptodev API changes Declan Doherty
2016-02-26 17:30     ` [dpdk-dev] [PATCH v3 1/2] cryptodev: API tidy and changes to support future extensions Declan Doherty
2016-02-26 17:30     ` [dpdk-dev] [PATCH v3 2/2] cryptodev: change burst API to be crypto op oriented Declan Doherty
2016-02-29 16:00     ` [dpdk-dev] [PATCH v3 0/2] cryptodev API changes Declan Doherty
2016-02-29 16:52     ` [dpdk-dev] [PATCH v4 " Declan Doherty
2016-02-29 16:52       ` [dpdk-dev] [PATCH v4 1/2] cryptodev: API tidy and changes to support future extensions Declan Doherty
2016-03-04 14:43         ` Thomas Monjalon
2016-02-29 16:52       ` [dpdk-dev] [PATCH v4 2/2] cryptodev: change burst API to be crypto op oriented Declan Doherty
2016-02-29 17:47       ` [dpdk-dev] [PATCH v4 0/2] cryptodev API changes Trahe, Fiona
2016-03-04 17:17       ` [dpdk-dev] [PATCH v5 " Fiona Trahe
2016-03-04 17:38         ` Thomas Monjalon
2016-03-04 17:43           ` Trahe, Fiona
2016-03-04 17:45             ` Thomas Monjalon
2016-03-04 18:01               ` Trahe, Fiona
2016-03-04 17:39         ` Trahe, Fiona
2016-03-15  6:48         ` Cao, Min
2016-03-04 17:17       ` [dpdk-dev] [PATCH v5 1/2] This patch splits symmetric specific definitions and functions away from the common crypto APIs to facilitate the future extension and expansion of the cryptodev framework, in order to allow asymmetric crypto operations to be introduced at a later date, as well as to clean the logical structure of the public includes. The patch also introduces the _sym prefix to symmetric specific structure and functions to improve clarity in the API Fiona Trahe
2016-03-04 17:17       ` [dpdk-dev] [PATCH v5 2/2] This patch modifies the crypto burst enqueue/dequeue APIs to operate on bursts rte_crypto_op's rather than the current implementation which operates on rte_mbuf bursts, this simplifies the burst processing in the crypto PMDs and the use of crypto operations in general Fiona Trahe
2016-03-04 18:29       ` [dpdk-dev] [PATCH v6 0/2] cryptodev API changes Fiona Trahe
2016-03-07 11:50         ` [dpdk-dev] [PATCH v7 " Fiona Trahe
2016-03-07 13:23           ` De Lara Guarch, Pablo
2016-03-07 13:53           ` Jain, Deepak K
2016-03-10 13:42           ` [dpdk-dev] [PATCH v8 0/5] " Fiona Trahe
2016-03-10 14:05             ` De Lara Guarch, Pablo
2016-03-10 15:41             ` [dpdk-dev] [PATCH v9 " Fiona Trahe
2016-03-10 16:14               ` Thomas Monjalon
2016-03-10 15:41             ` [dpdk-dev] [PATCH v9 1/5] cryptodev: code cleanup Fiona Trahe
2016-03-10 15:41             ` [dpdk-dev] [PATCH v9 2/5] cryptodev: refactor to partition common from symmetric-specific code Fiona Trahe
2016-03-10 15:41             ` Fiona Trahe [this message]
2016-03-10 15:41             ` [dpdk-dev] [PATCH v9 4/5] cryptodev: change burst API to be crypto op oriented Fiona Trahe
2016-03-10 16:03               ` Thomas Monjalon
2016-03-10 16:13                 ` Trahe, Fiona
2016-03-10 15:41             ` [dpdk-dev] [PATCH v9 5/5] mbuf_offload: remove library Fiona Trahe
2016-03-14  8:59             ` [dpdk-dev] [PATCH v8 0/5] cryptodev API changes Cao, Min
2016-03-10 13:42           ` [dpdk-dev] [PATCH v8 1/5] cryptodev: code cleanup Fiona Trahe
2016-03-10 13:42           ` [dpdk-dev] [PATCH v8 2/5] cryptodev: refactor to partition common from symmetric-specific code Fiona Trahe
2016-03-10 13:42           ` [dpdk-dev] [PATCH v8 3/5] cryptodev: remove unused phys_addr field from key Fiona Trahe
2016-03-10 13:43           ` [dpdk-dev] [PATCH v8 4/5] cryptodev: change burst API to be crypto op oriented Fiona Trahe
2016-03-10 14:03             ` Thomas Monjalon
2016-03-10 13:43           ` [dpdk-dev] [PATCH v8 5/5] mbuf_offload: remove library Fiona Trahe
2016-03-15  5:21           ` [dpdk-dev] [PATCH v7 0/2] cryptodev API changes Cao, Min
2016-03-07 11:50         ` [dpdk-dev] [PATCH v7 1/2] cryptodev: API tidy and changes to support future extensions Fiona Trahe
2016-03-08 14:10           ` Thomas Monjalon
2016-03-10 10:30             ` Trahe, Fiona
2016-03-07 11:50         ` [dpdk-dev] [PATCH v7 2/2] cryptodev: change burst API to be crypto op oriented Fiona Trahe
2016-03-08 14:32           ` Thomas Monjalon
2016-03-09 12:55             ` Trahe, Fiona
2016-03-10 10:28               ` Trahe, Fiona
2016-03-15  6:46         ` [dpdk-dev] [PATCH v6 0/2] cryptodev API changes Cao, Min
2016-03-04 18:29       ` [dpdk-dev] [PATCH v6 1/2] cryptodev: API tidy and changes to support future extensions Fiona Trahe
2016-03-04 18:29       ` [dpdk-dev] [PATCH v6 2/2] cryptodev: change burst API to be crypto op oriented Fiona Trahe
2016-03-15  6:57       ` [dpdk-dev] [PATCH v4 0/2] cryptodev API changes Cao, Min
2016-03-15  7:07     ` [dpdk-dev] [PATCH v3 " Cao, Min
2016-03-15  7:48   ` [dpdk-dev] [PATCH v2 " Cao, Min

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=1457624473-11138-4-git-send-email-fiona.trahe@intel.com \
    --to=fiona.trahe@intel.com \
    --cc=dev@dpdk.org \
    /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).