From: Jan Blunck <jblunck@infradead.org>
To: dev@dpdk.org
Cc: declan.doherty@intel.com, pablo.de.lara.guarch@intel.com
Subject: [dpdk-dev] [PATCH v2 4/4] cryptodev: move parameter parsing to its own header
Date: Wed, 12 Jul 2017 15:58:46 -0400 [thread overview]
Message-ID: <20170712195846.65286-5-jblunck@infradead.org> (raw)
In-Reply-To: <20170712195846.65286-1-jblunck@infradead.org>
This moves the parameter parsing functions out of the
rte_cryptodev_vdev.h header to not require the rte_vdev.h header
at build time of the library.
Signed-off-by: Jan Blunck <jblunck@infradead.org>
---
lib/librte_cryptodev/Makefile | 1 +
lib/librte_cryptodev/rte_cryptodev_pmd.c | 2 +-
lib/librte_cryptodev/rte_cryptodev_vdev.h | 44 +-----------
lib/librte_cryptodev/rte_cryptodev_vdev_params.h | 89 ++++++++++++++++++++++++
4 files changed, 93 insertions(+), 43 deletions(-)
create mode 100644 lib/librte_cryptodev/rte_cryptodev_vdev_params.h
diff --git a/lib/librte_cryptodev/Makefile b/lib/librte_cryptodev/Makefile
index 6ac331bc9..59d9a4e2e 100644
--- a/lib/librte_cryptodev/Makefile
+++ b/lib/librte_cryptodev/Makefile
@@ -49,6 +49,7 @@ SYMLINK-y-include += rte_crypto_sym.h
SYMLINK-y-include += rte_cryptodev.h
SYMLINK-y-include += rte_cryptodev_pmd.h
SYMLINK-y-include += rte_cryptodev_vdev.h
+SYMLINK-y-include += rte_cryptodev_vdev_params.h
SYMLINK-y-include += rte_cryptodev_pci.h
# versioning export map
diff --git a/lib/librte_cryptodev/rte_cryptodev_pmd.c b/lib/librte_cryptodev/rte_cryptodev_pmd.c
index eaeddf74b..d6eaa2a90 100644
--- a/lib/librte_cryptodev/rte_cryptodev_pmd.c
+++ b/lib/librte_cryptodev/rte_cryptodev_pmd.c
@@ -32,7 +32,7 @@
#include <rte_malloc.h>
-#include "rte_cryptodev_vdev.h"
+#include "rte_cryptodev_vdev_params.h"
#include "rte_cryptodev_pci.h"
#include "rte_cryptodev_pmd.h"
diff --git a/lib/librte_cryptodev/rte_cryptodev_vdev.h b/lib/librte_cryptodev/rte_cryptodev_vdev.h
index 04d0796d4..94df46cab 100644
--- a/lib/librte_cryptodev/rte_cryptodev_vdev.h
+++ b/lib/librte_cryptodev/rte_cryptodev_vdev.h
@@ -36,33 +36,8 @@
#include <rte_vdev.h>
#include <inttypes.h>
-#include "rte_cryptodev.h"
-
-#define RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_QUEUE_PAIRS 8
-#define RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_SESSIONS 2048
-
-#define RTE_CRYPTODEV_VDEV_NAME ("name")
-#define RTE_CRYPTODEV_VDEV_MAX_NB_QP_ARG ("max_nb_queue_pairs")
-#define RTE_CRYPTODEV_VDEV_MAX_NB_SESS_ARG ("max_nb_sessions")
-#define RTE_CRYPTODEV_VDEV_SOCKET_ID ("socket_id")
-
-static const char * const cryptodev_vdev_valid_params[] = {
- RTE_CRYPTODEV_VDEV_NAME,
- RTE_CRYPTODEV_VDEV_MAX_NB_QP_ARG,
- RTE_CRYPTODEV_VDEV_MAX_NB_SESS_ARG,
- RTE_CRYPTODEV_VDEV_SOCKET_ID
-};
-
-/**
- * @internal
- * Initialisation parameters for virtual crypto devices
- */
-struct rte_crypto_vdev_init_params {
- unsigned int max_nb_queue_pairs;
- unsigned int max_nb_sessions;
- uint8_t socket_id;
- char name[RTE_CRYPTODEV_NAME_MAX_LEN];
-};
+#include "rte_cryptodev_pmd.h"
+#include "rte_cryptodev_vdev_params.h"
/**
* @internal
@@ -107,19 +82,4 @@ rte_cryptodev_vdev_pmd_init(const char *name, size_t dev_private_size,
return cryptodev;
}
-/**
- * @internal
- * Parse virtual device initialisation parameters input arguments
- *
- * @params params Initialisation parameters with defaults set.
- * @params input_args Command line arguments
- *
- * @return
- * 0 on successful parse
- * <0 on failure to parse
- */
-int
-rte_cryptodev_vdev_parse_init_params(struct rte_crypto_vdev_init_params *params,
- const char *input_args);
-
#endif /* _RTE_CRYPTODEV_VDEV_H_ */
diff --git a/lib/librte_cryptodev/rte_cryptodev_vdev_params.h b/lib/librte_cryptodev/rte_cryptodev_vdev_params.h
new file mode 100644
index 000000000..66ba0d482
--- /dev/null
+++ b/lib/librte_cryptodev/rte_cryptodev_vdev_params.h
@@ -0,0 +1,89 @@
+/*-
+ * BSD LICENSE
+ *
+ * Copyright(c) 2017 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of the copyright holder nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _RTE_CRYPTODEV_VDEV_PARAMS_H_
+#define _RTE_CRYPTODEV_VDEV_PARAMS_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <inttypes.h>
+
+#include "rte_cryptodev.h"
+
+#define RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_QUEUE_PAIRS 8
+#define RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_SESSIONS 2048
+
+#define RTE_CRYPTODEV_VDEV_NAME ("name")
+#define RTE_CRYPTODEV_VDEV_MAX_NB_QP_ARG ("max_nb_queue_pairs")
+#define RTE_CRYPTODEV_VDEV_MAX_NB_SESS_ARG ("max_nb_sessions")
+#define RTE_CRYPTODEV_VDEV_SOCKET_ID ("socket_id")
+
+static const char * const cryptodev_vdev_valid_params[] = {
+ RTE_CRYPTODEV_VDEV_NAME,
+ RTE_CRYPTODEV_VDEV_MAX_NB_QP_ARG,
+ RTE_CRYPTODEV_VDEV_MAX_NB_SESS_ARG,
+ RTE_CRYPTODEV_VDEV_SOCKET_ID
+};
+
+/**
+ * @internal
+ * Initialisation parameters for virtual crypto devices
+ */
+struct rte_crypto_vdev_init_params {
+ unsigned int max_nb_queue_pairs;
+ unsigned int max_nb_sessions;
+ uint8_t socket_id;
+ char name[RTE_CRYPTODEV_NAME_MAX_LEN];
+};
+
+/**
+ * @internal
+ * Parse virtual device initialisation parameters input arguments
+ *
+ * @params params Initialisation parameters with defaults set.
+ * @params input_args Command line arguments
+ *
+ * @return
+ * 0 on successful parse
+ * <0 on failure to parse
+ */
+int
+rte_cryptodev_vdev_parse_init_params(struct rte_crypto_vdev_init_params *params,
+ const char *input_args);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _RTE_CRYPTODEV_VDEV_PARAMS_H_ */
--
2.13.2
next prev parent reply other threads:[~2017-07-12 19:59 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-12 7:59 [dpdk-dev] [PATCH 0/2] cryptodev vdev changes for -rc2 Jan Blunck
2017-07-12 7:59 ` [dpdk-dev] [PATCH 1/2] cryptodev: remove obsolete include Jan Blunck
2017-07-12 12:35 ` De Lara Guarch, Pablo
2017-07-12 7:59 ` [dpdk-dev] [PATCH 2/2] cryptodev: rework cryptodev PMD init to not require rte_vdev.h Jan Blunck
2017-07-12 12:39 ` De Lara Guarch, Pablo
2017-07-12 13:07 ` De Lara Guarch, Pablo
2017-07-12 19:58 ` [dpdk-dev] [PATCH v2 0/4] cryptodev vdev changes for -rc2 Jan Blunck
2017-07-12 19:58 ` [dpdk-dev] [PATCH v2 1/4] cryptodev: remove obsolete include Jan Blunck
2017-07-12 19:58 ` [dpdk-dev] [PATCH v2 2/4] cryptodev: move initialization Jan Blunck
2017-07-12 19:58 ` [dpdk-dev] [PATCH v2 3/4] cryptodev: rework PMD init to not require rte_vdev.h Jan Blunck
2017-07-15 11:04 ` De Lara Guarch, Pablo
2017-09-04 14:32 ` De Lara Guarch, Pablo
2017-10-05 14:52 ` Jan Blunck
2017-10-05 15:19 ` De Lara Guarch, Pablo
2017-07-12 19:58 ` Jan Blunck [this message]
2017-07-19 13:31 ` [dpdk-dev] [PATCH v2 0/4] cryptodev vdev changes for -rc2 De Lara Guarch, Pablo
2017-07-27 19:31 ` Jan Blunck
2017-08-01 10:39 ` De Lara Guarch, Pablo
2017-10-06 8:39 ` [dpdk-dev] [PATCH v3 0/4] cryptodev vdev changes for 17.11-rc1 Jan Blunck
2017-10-25 14:33 ` De Lara Guarch, Pablo
2017-10-25 16:05 ` De Lara Guarch, Pablo
2017-10-06 8:39 ` [dpdk-dev] [PATCH v3 1/4] cryptodev: remove obsolete include Jan Blunck
2017-10-06 8:39 ` [dpdk-dev] [PATCH v3 2/4] cryptodev: move initialization Jan Blunck
2017-10-10 8:45 ` De Lara Guarch, Pablo
2017-10-06 8:39 ` [dpdk-dev] [PATCH v3 3/4] cryptodev: rework dependency on vdev header Jan Blunck
2017-10-10 8:47 ` De Lara Guarch, Pablo
2017-10-10 11:29 ` Jan Blunck
2017-10-10 12:49 ` De Lara Guarch, Pablo
2017-10-11 14:45 ` De Lara Guarch, Pablo
2017-10-06 8:39 ` [dpdk-dev] [PATCH v3 4/4] cryptodev: move parameter parsing to its own header Jan Blunck
2017-10-10 8:48 ` De Lara Guarch, Pablo
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=20170712195846.65286-5-jblunck@infradead.org \
--to=jblunck@infradead.org \
--cc=declan.doherty@intel.com \
--cc=dev@dpdk.org \
--cc=pablo.de.lara.guarch@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).