From patchwork Fri Oct 6 08:39:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Blunck X-Patchwork-Id: 29794 X-Patchwork-Delegate: pablo.de.lara.guarch@intel.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CFF2B1B297; Fri, 6 Oct 2017 10:40:21 +0200 (CEST) Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by dpdk.org (Postfix) with ESMTP id 5DE0B1B29D for ; Fri, 6 Oct 2017 10:40:19 +0200 (CEST) Received: by mail-wm0-f65.google.com with SMTP id q124so11082591wmb.5 for ; Fri, 06 Oct 2017 01:40:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=B2dr4Cxvu4Ys76UDMiXtZA34ejrrsBZA60Pw4sGEB5Y=; b=KlkJ0FA115JyDzlhVsbXSHxMmp93NuxTmRR9UmWv6XhEfMXJgUJSuuupNvs6leyb+7 voWjix0BZTA6+b/WtK7ro7UGUGPsFqIibvc2ATjoWmMOYMxEjfQ9tOp6TC9Gb6QdqRqp /rIWwR01eRWLLwwfhrcneMzc0oWw1Qyc/Rj2zUCclYTtWcws2UnauviX5IgD/qQStYN7 DdoIPx6mTpitLN1/51cHQ3VxzI8Q5BtRscmp9wOlJE1Cfdr+3f6WUJ2EWaV6dN45phCX YvIILDSvrTYWu2zA/TmrKSSlwAnSzmMyk9XkkUcYEleH5ls0tCqlz+UED9qe4x9ddKDI PLoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:in-reply-to:references; bh=B2dr4Cxvu4Ys76UDMiXtZA34ejrrsBZA60Pw4sGEB5Y=; b=ZKGlcqh0A4RtpslzcN1/l/HaiHFsE4IAPnCLXyBHavjgK/UcSXXXQ4RSBi7AmC12FJ dyef+rRLQmgrIZ4GqUU5A13hVfBLfpKwR/dcmVfkDDyqF/7e4cvGdrEFAiqkvlCYJi6q RpG3acdSH13Tvax8rBUJaL4fgEbtK8T9MLO10nfoaCRKwN5pIHabAnVnLGpWE1MkACkt b8aqXJSaapOASGSCE1k4YjEwcMgKS+yYDeVgblFDXm0ruz6A+YEiovaojPSVthQdnIkw lW6nAsiOvJ/pQLmF6/pwPeXXCLhyEq8ZYrVOJGzS+RlovSu3qKM+hNO+1cN50SghyqQf wLOw== X-Gm-Message-State: AMCzsaWhgnKEHvlPomLKFuegtrZVvLa+JNDaaby3htHMjdNyRqKm/3Fb +y8u9x0XfrPKTScYSL7ihJ6Ei7+obbA= X-Google-Smtp-Source: AOwi7QCLxjWQ8YqvAhhILYZJOdhZJ+jE59exOQqQBi8CKjdnunBT8NHWjToG/kPSYK7uHJPAnb/z0w== X-Received: by 10.80.163.101 with SMTP id 92mr2319514edn.100.1507279218913; Fri, 06 Oct 2017 01:40:18 -0700 (PDT) Received: from localhost.localdomain ([37.228.147.16]) by smtp.gmail.com with ESMTPSA id e2sm622871edi.65.2017.10.06.01.40.17 (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 06 Oct 2017 01:40:17 -0700 (PDT) From: Jan Blunck To: dev@dpdk.org Cc: declan.doherty@intel.com, pablo.de.lara.guarch@intel.com Date: Fri, 6 Oct 2017 10:39:33 +0200 Message-Id: <20171006083934.34819-4-jblunck@infradead.org> X-Mailer: git-send-email 2.13.2 In-Reply-To: <20171006083934.34819-1-jblunck@infradead.org> References: <20171006083934.34819-1-jblunck@infradead.org> In-Reply-To: <20170712195846.65286-1-jblunck@infradead.org> References: <20170712195846.65286-1-jblunck@infradead.org> Subject: [dpdk-dev] [PATCH v3 3/4] cryptodev: rework dependency on vdev header X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 Acked-by: Pablo de Lara --- 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 #include -#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;