DPDK patches and discussions
 help / color / mirror / Atom feed
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 v3 3/4] cryptodev: rework dependency on vdev header
Date: Fri,  6 Oct 2017 10:39:33 +0200	[thread overview]
Message-ID: <20171006083934.34819-4-jblunck@infradead.org> (raw)
In-Reply-To: <20171006083934.34819-1-jblunck@infradead.org>
In-Reply-To: <20170712195846.65286-1-jblunck@infradead.org>

The rte_cryptodev_vdev_pmd_init() is a helper for vdev-based drivers.
By moving the helper to the header we don't require rte_vdev.h at
build-time of the librte_cryptodev library. This is a preparation to
move the vdev bus into a standalone library.

Signed-off-by: Jan Blunck <jblunck@infradead.org>
---
 lib/librte_cryptodev/rte_cryptodev_pmd.c       | 29 ------------------------
 lib/librte_cryptodev/rte_cryptodev_vdev.h      | 31 +++++++++++++++++++++++---
 lib/librte_cryptodev/rte_cryptodev_version.map |  1 -
 3 files changed, 28 insertions(+), 33 deletions(-)

diff --git a/lib/librte_cryptodev/rte_cryptodev_pmd.c b/lib/librte_cryptodev/rte_cryptodev_pmd.c
index ec6eeffa1..eaeddf74b 100644
--- a/lib/librte_cryptodev/rte_cryptodev_pmd.c
+++ b/lib/librte_cryptodev/rte_cryptodev_pmd.c
@@ -75,35 +75,6 @@ rte_cryptodev_vdev_parse_integer_arg(const char *key __rte_unused,
 	return 0;
 }
 
-struct rte_cryptodev *
-rte_cryptodev_vdev_pmd_init(const char *name, size_t dev_private_size,
-		int socket_id, struct rte_vdev_device *vdev)
-{
-	struct rte_cryptodev *cryptodev;
-
-	/* allocate device structure */
-	cryptodev = rte_cryptodev_pmd_allocate(name, socket_id);
-	if (cryptodev == NULL)
-		return NULL;
-
-	/* allocate private device structure */
-	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
-		cryptodev->data->dev_private =
-				rte_zmalloc_socket("cryptodev device private",
-						dev_private_size,
-						RTE_CACHE_LINE_SIZE,
-						socket_id);
-
-		if (cryptodev->data->dev_private == NULL)
-			rte_panic("Cannot allocate memzone for private device"
-					" data");
-	}
-
-	cryptodev->device = &vdev->device;
-
-	return cryptodev;
-}
-
 int
 rte_cryptodev_vdev_parse_init_params(struct rte_crypto_vdev_init_params *params,
 		const char *input_args)
diff --git a/lib/librte_cryptodev/rte_cryptodev_vdev.h b/lib/librte_cryptodev/rte_cryptodev_vdev.h
index 94ab9d33d..c6bafd01b 100644
--- a/lib/librte_cryptodev/rte_cryptodev_vdev.h
+++ b/lib/librte_cryptodev/rte_cryptodev_vdev.h
@@ -36,7 +36,7 @@
 #include <rte_vdev.h>
 #include <inttypes.h>
 
-#include "rte_cryptodev.h"
+#include "rte_cryptodev_pmd.h"
 
 #define RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_QUEUE_PAIRS	8
 #define RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_SESSIONS	2048
@@ -78,9 +78,34 @@ struct rte_crypto_vdev_init_params {
  *   - Cryptodev pointer if device is successfully created.
  *   - NULL if device cannot be created.
  */
-struct rte_cryptodev *
+static inline struct rte_cryptodev *
 rte_cryptodev_vdev_pmd_init(const char *name, size_t dev_private_size,
-		int socket_id, struct rte_vdev_device *vdev);
+		int socket_id, struct rte_vdev_device *dev)
+{
+	struct rte_cryptodev *cryptodev;
+
+	/* allocate device structure */
+	cryptodev = rte_cryptodev_pmd_allocate(name, socket_id);
+	if (cryptodev == NULL)
+		return NULL;
+
+	/* allocate private device structure */
+	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
+		cryptodev->data->dev_private =
+				rte_zmalloc_socket("cryptodev device private",
+						dev_private_size,
+						RTE_CACHE_LINE_SIZE,
+						socket_id);
+
+		if (cryptodev->data->dev_private == NULL)
+			rte_panic("Cannot allocate memzone for private device"
+					" data");
+	}
+
+	cryptodev->device = &dev->device;
+
+	return cryptodev;
+}
 
 /**
  * @internal
diff --git a/lib/librte_cryptodev/rte_cryptodev_version.map b/lib/librte_cryptodev/rte_cryptodev_version.map
index e9ba88ac5..abdbbdada 100644
--- a/lib/librte_cryptodev/rte_cryptodev_version.map
+++ b/lib/librte_cryptodev/rte_cryptodev_version.map
@@ -74,7 +74,6 @@ DPDK_17.08 {
 	rte_cryptodev_sym_session_init;
 	rte_cryptodev_sym_session_clear;
 	rte_cryptodev_vdev_parse_init_params;
-	rte_cryptodev_vdev_pmd_init;
 	rte_crypto_aead_algorithm_strings;
 	rte_crypto_aead_operation_strings;
 
-- 
2.13.2

  parent reply	other threads:[~2017-10-06  8:40 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   ` [dpdk-dev] [PATCH v2 4/4] cryptodev: move parameter parsing to its own header Jan Blunck
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   ` Jan Blunck [this message]
2017-10-10  8:47     ` [dpdk-dev] [PATCH v3 3/4] cryptodev: rework dependency on vdev header 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=20171006083934.34819-4-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).