From patchwork Tue Sep 12 09:36:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anatoly Burakov X-Patchwork-Id: 28615 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 347D11B192; Tue, 12 Sep 2017 11:36:56 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 141B8199B0 for ; Tue, 12 Sep 2017 11:36:52 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Sep 2017 02:36:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,382,1500966000"; d="scan'208";a="899419720" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by FMSMGA003.fm.intel.com with ESMTP; 12 Sep 2017 02:36:27 -0700 Received: from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com [10.237.217.45]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id v8C9aQti006125; Tue, 12 Sep 2017 10:36:26 +0100 Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id v8C9aQgI032364; Tue, 12 Sep 2017 10:36:26 +0100 Received: (from aburakov@localhost) by sivswdev01.ir.intel.com with LOCAL id v8C9aQlS032360; Tue, 12 Sep 2017 10:36:26 +0100 From: Anatoly Burakov To: dev@dpdk.org Cc: declan.doherty@intel.com, pablo.de.lara.guarch@intel.com Date: Tue, 12 Sep 2017 10:36:25 +0100 Message-Id: <1e72f8bffcb0ea6215c03eed7e08e68482a0d551.1505142622.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 1.7.0.7 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v2 1/2] app/crypto-perf: add nb-desc parameter 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" This parameter makes number of cryptodev descriptors adjustable and defaults to earlier hardcoded default of 2048. Signed-off-by: Anatoly Burakov Reviewed-by: Pablo de Lara --- v2: squashed documentation into code patch fixed commit message fixed documentation app/test-crypto-perf/cperf_options.h | 2 ++ app/test-crypto-perf/cperf_options_parsing.c | 21 +++++++++++++++++++++ app/test-crypto-perf/main.c | 2 +- doc/guides/tools/cryptoperf.rst | 4 ++++ 4 files changed, 28 insertions(+), 1 deletion(-) diff --git a/app/test-crypto-perf/cperf_options.h b/app/test-crypto-perf/cperf_options.h index 10cd2d8..edd6b79 100644 --- a/app/test-crypto-perf/cperf_options.h +++ b/app/test-crypto-perf/cperf_options.h @@ -12,6 +12,7 @@ #define CPERF_BURST_SIZE ("burst-sz") #define CPERF_BUFFER_SIZE ("buffer-sz") #define CPERF_SEGMENTS_NB ("segments-nb") +#define CPERF_DESC_NB ("desc-nb") #define CPERF_DEVTYPE ("devtype") #define CPERF_OPTYPE ("optype") @@ -68,6 +69,7 @@ struct cperf_options { uint32_t total_ops; uint32_t segments_nb; uint32_t test_buffer_size; + uint32_t nb_descriptors; uint32_t sessionless:1; uint32_t out_of_place:1; diff --git a/app/test-crypto-perf/cperf_options_parsing.c b/app/test-crypto-perf/cperf_options_parsing.c index 085aa8f..f4097d9 100644 --- a/app/test-crypto-perf/cperf_options_parsing.c +++ b/app/test-crypto-perf/cperf_options_parsing.c @@ -340,6 +340,24 @@ parse_segments_nb(struct cperf_options *opts, const char *arg) } static int +parse_desc_nb(struct cperf_options *opts, const char *arg) +{ + int ret = parse_uint32_t(&opts->nb_descriptors, arg); + + if (ret) { + RTE_LOG(ERR, USER1, "failed to parse descriptors number\n"); + return -1; + } + + if (opts->nb_descriptors == 0) { + RTE_LOG(ERR, USER1, "invalid descriptors number specified\n"); + return -1; + } + + return 0; +} + +static int parse_device_type(struct cperf_options *opts, const char *arg) { if (strlen(arg) > (sizeof(opts->device_type) - 1)) @@ -641,6 +659,7 @@ static struct option lgopts[] = { { CPERF_BURST_SIZE, required_argument, 0, 0 }, { CPERF_BUFFER_SIZE, required_argument, 0, 0 }, { CPERF_SEGMENTS_NB, required_argument, 0, 0 }, + { CPERF_DESC_NB, required_argument, 0, 0 }, { CPERF_DEVTYPE, required_argument, 0, 0 }, { CPERF_OPTYPE, required_argument, 0, 0 }, @@ -684,6 +703,7 @@ cperf_options_default(struct cperf_options *opts) opts->pool_sz = 8192; opts->total_ops = 10000000; + opts->nb_descriptors = 2048; opts->buffer_size_list[0] = 64; opts->buffer_size_count = 1; @@ -740,6 +760,7 @@ cperf_opts_parse_long(int opt_idx, struct cperf_options *opts) { CPERF_BURST_SIZE, parse_burst_sz }, { CPERF_BUFFER_SIZE, parse_buffer_sz }, { CPERF_SEGMENTS_NB, parse_segments_nb }, + { CPERF_DESC_NB, parse_desc_nb }, { CPERF_DEVTYPE, parse_device_type }, { CPERF_OPTYPE, parse_op_type }, { CPERF_SESSIONLESS, parse_sessionless }, diff --git a/app/test-crypto-perf/main.c b/app/test-crypto-perf/main.c index 99f5d3e..7e6ca8e 100644 --- a/app/test-crypto-perf/main.c +++ b/app/test-crypto-perf/main.c @@ -123,7 +123,7 @@ cperf_initialize_cryptodev(struct cperf_options *opts, uint8_t *enabled_cdevs, }; struct rte_cryptodev_qp_conf qp_conf = { - .nb_descriptors = 2048 + .nb_descriptors = opts->nb_descriptors }; diff --git a/doc/guides/tools/cryptoperf.rst b/doc/guides/tools/cryptoperf.rst index 457f817..d2a6f82c 100644 --- a/doc/guides/tools/cryptoperf.rst +++ b/doc/guides/tools/cryptoperf.rst @@ -325,6 +325,10 @@ The following are the appication command-line options: Set the size of digest. +* ``--desc-nb `` + + Set number of descriptors for each crypto device. + * ``--csv-friendly`` Enable test result output CSV friendly rather than human friendly.