From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id C818B29CF for ; Thu, 10 Mar 2016 18:11:54 +0100 (CET) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP; 10 Mar 2016 09:11:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,316,1455004800"; d="scan'208";a="63668029" Received: from sie-lab-212-116.ir.intel.com ([10.237.212.116]) by fmsmga004.fm.intel.com with ESMTP; 10 Mar 2016 09:11:53 -0800 From: Pablo de Lara To: dev@dpdk.org Date: Thu, 10 Mar 2016 17:14:09 +0000 Message-Id: <1457630049-17469-1-git-send-email-pablo.de.lara.guarch@intel.com> X-Mailer: git-send-email 2.5.0 Subject: [dpdk-dev] [PATCH] aesni_mb: remove params from config file X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Mar 2016 17:11:55 -0000 Parse the device parameters from rte_eal_vdev_init, instead of the config file, so user can change the parameters at runtime. Signed-off-by: Pablo de Lara --- This patch depends on "cryptodev: add capabilities discovery mechanism" (http://dpdk.org/dev/patchwork/patch/11430/) config/common_base | 2 -- drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c | 30 ++++++++++++++++++++++-------- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/config/common_base b/config/common_base index 73ca7bb..c7634e5 100644 --- a/config/common_base +++ b/config/common_base @@ -334,8 +334,6 @@ CONFIG_RTE_QAT_PMD_MAX_NB_SESSIONS=2048 # CONFIG_RTE_LIBRTE_PMD_AESNI_MB=n CONFIG_RTE_LIBRTE_PMD_AESNI_MB_DEBUG=n -CONFIG_RTE_AESNI_MB_PMD_MAX_NB_QUEUE_PAIRS=8 -CONFIG_RTE_AESNI_MB_PMD_MAX_NB_SESSIONS=2048 # # Compile PMD for AESNI GCM device diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c index bd273ec..bc44f67 100644 --- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c +++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c @@ -593,7 +593,8 @@ aesni_mb_pmd_dequeue_burst(void *queue_pair, struct rte_crypto_op **ops, static int cryptodev_aesni_mb_uninit(const char *name); static int -cryptodev_aesni_mb_create(const char *name, unsigned socket_id) +cryptodev_aesni_mb_create(const char *name, + struct rte_crypto_vdev_init_params *init_params) { struct rte_cryptodev *dev; char crypto_dev_name[RTE_CRYPTODEV_NAME_MAX_LEN]; @@ -627,7 +628,7 @@ cryptodev_aesni_mb_create(const char *name, unsigned socket_id) dev = rte_cryptodev_pmd_virtual_dev_init(crypto_dev_name, - sizeof(struct aesni_mb_private), socket_id); + sizeof(struct aesni_mb_private), init_params->socket_id); if (dev == NULL) { MB_LOG_ERR("failed to create cryptodev vdev"); goto init_error; @@ -662,8 +663,8 @@ cryptodev_aesni_mb_create(const char *name, unsigned socket_id) internals = dev->data->dev_private; internals->vector_mode = vector_mode; - internals->max_nb_queue_pairs = RTE_AESNI_MB_PMD_MAX_NB_QUEUE_PAIRS; - internals->max_nb_sessions = RTE_AESNI_MB_PMD_MAX_NB_SESSIONS; + internals->max_nb_queue_pairs = init_params->max_nb_queue_pairs; + internals->max_nb_sessions = init_params->max_nb_sessions; return 0; init_error: @@ -676,11 +677,24 @@ init_error: static int cryptodev_aesni_mb_init(const char *name, - const char *params __rte_unused) + const char *input_args) { - RTE_LOG(INFO, PMD, "Initialising %s\n", name); - - return cryptodev_aesni_mb_create(name, rte_socket_id()); + struct rte_crypto_vdev_init_params init_params = { + RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_QUEUE_PAIRS, + RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_SESSIONS, + rte_socket_id() + }; + + rte_cryptodev_parse_vdev_init_params(&init_params, input_args); + + RTE_LOG(INFO, PMD, "Initialising %s on NUMA node %d\n", name, + init_params.socket_id); + RTE_LOG(INFO, PMD, " Max number of queue pairs = %d\n", + init_params.max_nb_queue_pairs); + RTE_LOG(INFO, PMD, " Max number of sessions = %d\n", + init_params.max_nb_sessions); + + return cryptodev_aesni_mb_create(name, &init_params); } static int -- 2.5.0