From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM04-BN3-obe.outbound.protection.outlook.com (mail-eopbgr680089.outbound.protection.outlook.com [40.107.68.89]) by dpdk.org (Postfix) with ESMTP id B02471BF2E for ; Wed, 4 Jul 2018 15:56:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bjo01mUqItaA3RGy49D+euLg7XLuGI/uw1ncQrl1sZc=; b=L4M21fbnu5nbhsP0TEOmIRGDKahaKSpOTIqkMpIKuIakS0bjt41qh03DjmsIj+ypEErSfbE2LWG66VmbBFg9qvlSMRCTN1XSYcG18wRUyoOX/hDSNgmS4eZxSgCOvbUAI2uUNR/KPKTq5jL/CgNAYbrCMRiFS7o2Nsu8UZGcR1s= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Anoob.Joseph@cavium.com; Received: from ajoseph83.caveonetworks.com.caveonetworks.com (115.113.156.2) by BN7PR07MB4897.namprd07.prod.outlook.com (2603:10b6:406:ef::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.906.26; Wed, 4 Jul 2018 13:56:24 +0000 From: Anoob Joseph To: Declan Doherty , Pablo de Lara Cc: Anoob Joseph , Akhil Goyal , Ankur Dwivedi , Jerin Jacob , Narayana Prasad , dev@dpdk.org Date: Wed, 4 Jul 2018 19:25:49 +0530 Message-Id: <1530712550-18099-3-git-send-email-anoob.joseph@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1530712550-18099-1-git-send-email-anoob.joseph@caviumnetworks.com> References: <1529389574-6643-1-git-send-email-anoob.joseph@caviumnetworks.com> <1530712550-18099-1-git-send-email-anoob.joseph@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [115.113.156.2] X-ClientProxiedBy: BM1PR0101CA0041.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:1a::27) To BN7PR07MB4897.namprd07.prod.outlook.com (2603:10b6:406:ef::26) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f95b35f8-bfc6-4733-25b2-08d5e1b5efa8 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020); SRVR:BN7PR07MB4897; X-Microsoft-Exchange-Diagnostics: 1; BN7PR07MB4897; 3:wDeEZSqV/e6mte7Ac83BQeNbPTmte9s+MgvmZVmsQGyHAtxWbmWW9FwRXRBjWzsDKM9cZmEwJvZqHCHrcVdTT8rAF9wJskd1pQuqpzaJ16aIBVQKqRMWaIB8KOhkub/HIluLoSXPpbSIrjGyg+B28UCx6qWhksKxTAS1d6XOdzUTWfzndOQ9LUt2ke0Q95MwBqLZZZ+xFur2UEel45IKRS54K3feefTMdxtcKkQGwLJ74cuxc3dJuA8LHy+7fBkN; 25:80YkHLkxb/xJCMaj1qFQH1w9nkwcKZHlJGHs553pPwG6kEwPQLmTzu7cHWmxvatzk5iJDVYDIEu//S6V2jQl7eaajVg+ZpZJ1CRbyYXkEdG3vtHoKP2kYWgILB5NXYNkOSwioHyfCS3pZfZuIm9dJ4Mf7Q3ot4FcqQT7d6xTsFLTAU4ecSyamyzJZWLvnuZB5e5PC577oTUgIi2hbSxUJMFbEFlvQm8a5J85ekIhbX6DqgxX4Pv3eDtAxJGIHR1SIJU4AfDid5bZkfOboS4YGQIGyuq8Rh4uFDsW5gnx7g72GDPa73sjCwWY1zXO0y3uFuNCr3HcqROJ5MV/DM+puw==; 31:wculzIk1wpRjBo45OP2LGjwgPqSZ460ITc9DJaziLWz6cEcTvgws+bmK47cY5R6Uy81l19JykcfFhHqbh+xBHfOGHQtec8YTA21ZJSiXtMjm3y3j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MjpsjTRw0Q4U/iwlCXCRg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(3002001)(93006095)(3231254)(944501410)(52105095)(149027)(150027)(6041310)(20161123560045)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011)(7699016); SRVR:BN7PR07MB4897; BCL:0; PCL:0; RULEID:; SRVR:BN7PR07MB4897; X-Forefront-PRVS: 0723A02764 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(346002)(396003)(39850400004)(366004)(136003)(199004)(189003)(316002)(6512007)(11346002)(110136005)(16526019)(54906003)(478600001)(6116002)(2616005)(4326008)(956004)(53936002)(72206003)(186003)(3846002)(486006)(47776003)(25786009)(446003)(26005)(66066001)(16586007)(105586002)(44832011)(476003)(106356001)(2906002)(50226002)(55236004)(42882007)(8936002)(52116002)(51416003)(6486002)(76176011)(97736004)(48376002)(50466002)(68736007)(5660300001)(7736002)(386003)(8676002)(6666003)(81156014)(81166006)(6506007)(36756003)(14444005)(305945005); DIR:OUT; SFP:1101; SCL:1; SRVR:BN7PR07MB4897; H:ajoseph83.caveonetworks.com.caveonetworks.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN7PR07MB4897; 23:1Nj8hpacD4V4LXmC3aS1Vm/vqsG+axxPECkzEoBSS?= =?us-ascii?Q?19OmeYcxfX+6UFJKD0DIGhIn1t3rHzb7fmcad/RqzD8h9JFjZS9P/n4CNBHD?= =?us-ascii?Q?iNp9JBCarQgxK6r6V8MwM+We/aHRzXvUKp/qhkbodID2hL2Ft9Eq7SPsStLw?=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vewWSnPB2wwpK3neoQDztO01n6cEX?= =?us-ascii?Q?yu9gzYulDGT9zwM9Sbrj0y6x081IFYdcoLbuejRiWSOPrUnqjYsubdQxjRVY?= =?us-ascii?Q?ibWmQqbrpyXASdFwYzApB2w1jCVNrmlXqKJqZ9Ox9ZwstFVp9ScHCP/jlvZB?= =?us-ascii?Q?fLnAOTUEqbnYmtXizNRGZXnc7umRbQegGVusMIeJDxmOOJT1cSeZtywOehJG?= =?us-ascii?Q?WC/QzD02ReJB0G3P2UwE+1uu3q5ry6c1EGAPF7U?= X-Microsoft-Antispam-Message-Info: 3Q+jTa9LL9YyMKAZgylP1NNqxZRgB7Q15P2cybku+QjPtjTzmorE5YpAIRg6gEt651GbonwHJHrV9ewg5YdlgjPtgS/735Q1y6/k3S/6rVEcyW2acxrSrBan0tiiZ48rGEJzwCSGc/EjWNt6/ggaxmxVPe4OnGljVZfUmr4de+UsNJkhg0x2rdTUR1C/2UsIyAU02FJGSVpJb232txnXA4bDLMudNwesg0BkFIv1Evijl5owHGhR7LK/919aAG7ZvxDmutSxiQ9/PDFtSiT+ab+9Q4CttzECksG2HYgavO7Waykd5jHfM2+s0q6r2IplaLnIjQ8nAkTpysnPao3aSxvjekLgVxBZG2b8sngQxjk= X-Microsoft-Exchange-Diagnostics: 1; BN7PR07MB4897; 6:j6csJj+JF1AfBoIguqKvmG+cmEtExResxWQD4h6UBcqN2Yw3FSjOQ+afTmvAWbdRouQefBTx8sdBFEzLppF8kKOiSEa5aCdJ4ybA1TqNG+mB/Qly7JpBgjhSBiejI/LnapkaKvZiJdlCz1oSWHZdkgdxxwGgZBB7lCNrbYT0+qU+DvGAGYav+uJO5WY9xPuwp90dnShq8GOwnpC9oo3h9vZVjEqBLgVeYeLw3rroBns8WJvxYV9zLvxCkhfiDiIOdImpPjUuJ2QM6SKunzYmuTJDcU2IvoTLeQIwNbNSG4OYPzUmA/6EXCM0ZlFuzxUArioQo6ZaQXQRwFbdTuS00eCvtG4zRqMI4kSvbbxd+Bn4cu4AlWSzCjX9ADAPwsnNBey/8qi0bL3hewrHC/44YFKiVFGG/yoT4XkiYuZbe+pm/FaxUEmGfob9nXi1YlTKP0MdgqafGOBaokNmGHYylA==; 5:ouOEW//pNvB73TGYRSXyXuFtdEIlXAnA7SiJpV0MFYxGlUFt6qFW7i+El96fG0eEJruxBSkAQaO+Ph57Q9yKPQerCzniCgCJg4C8FP0Wh2NYkI2mvuU20WLYctGYuYDMzpmj5sjqbWnp1x7mg8V0bvGN8UkL/RpFKVNdVBdpEXo=; 24:4JEGEnY11E5ZhaBJbY1FeVhkw6lxOeR2KlPV4LfLxnPrTCK9+jSOCDYIVG88cHp7kDPEeqxlB//fclBj10Bje5SFPf9oKTbfqXNGrhl+etg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN7PR07MB4897; 7:HzZxlKITXh2PdO+wVGXNwC3t5EswkhHV0Ez598MsnfKWDXSxZ7cmHdWInenxeSXNuvtZ7G7gH6v+rHrV2YU7yU8bvpGonhX0mIU9fnJlBa6YVfqQ2nqH1s0xO5NNV/3nS4CeAojLl5k5EJ9vAemWNmAR+09ALukuByUKVg32GILPY0z8zEATu/Ceb+x+/3vltctFdDhakuYi4K35YeNyFgg3KIP+tROaNh8TACU9L/WT9fTKDUHbv+DE/Fr/HZkM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2018 13:56:24.7112 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f95b35f8-bfc6-4733-25b2-08d5e1b5efa8 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR07MB4897 Subject: [dpdk-dev] [PATCH v1 2/3] app/crypto-perf: honour cryptodev's min headroom/tailroom 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: , X-List-Received-Date: Wed, 04 Jul 2018 13:56:29 -0000 Crypto dev would specify its headroom and tailroom requirement and the application is expected to honour this while creating buffers. Signed-off-by: Anoob Joseph --- v1: * Accomodated the name change of new fields app/test-crypto-perf/cperf_options.h | 2 ++ app/test-crypto-perf/cperf_test_common.c | 33 +++++++++++++++++++++----------- app/test-crypto-perf/main.c | 17 ++++++++++++++++ 3 files changed, 41 insertions(+), 11 deletions(-) diff --git a/app/test-crypto-perf/cperf_options.h b/app/test-crypto-perf/cperf_options.h index 350ad7e..f5bf03c 100644 --- a/app/test-crypto-perf/cperf_options.h +++ b/app/test-crypto-perf/cperf_options.h @@ -76,6 +76,8 @@ struct cperf_options { uint32_t pool_sz; uint32_t total_ops; + uint32_t headroom_sz; + uint32_t tailroom_sz; uint32_t segment_sz; uint32_t test_buffer_size; uint32_t *imix_buffer_sizes; diff --git a/app/test-crypto-perf/cperf_test_common.c b/app/test-crypto-perf/cperf_test_common.c index 423782c..e803dc1 100644 --- a/app/test-crypto-perf/cperf_test_common.c +++ b/app/test-crypto-perf/cperf_test_common.c @@ -11,12 +11,15 @@ struct obj_params { uint32_t src_buf_offset; uint32_t dst_buf_offset; uint16_t segment_sz; + uint16_t headroom_sz; + uint16_t data_len; uint16_t segments_nb; }; static void fill_single_seg_mbuf(struct rte_mbuf *m, struct rte_mempool *mp, - void *obj, uint32_t mbuf_offset, uint16_t segment_sz) + void *obj, uint32_t mbuf_offset, uint16_t segment_sz, + uint16_t headroom, uint16_t data_len) { uint32_t mbuf_hdr_size = sizeof(struct rte_mbuf); @@ -26,10 +29,10 @@ fill_single_seg_mbuf(struct rte_mbuf *m, struct rte_mempool *mp, m->buf_iova = rte_mempool_virt2iova(obj) + mbuf_offset + mbuf_hdr_size; m->buf_len = segment_sz; - m->data_len = segment_sz; + m->data_len = data_len; - /* No headroom needed for the buffer */ - m->data_off = 0; + /* Use headroom specified for the buffer */ + m->data_off = headroom; /* init some constant fields */ m->pool = mp; @@ -42,7 +45,7 @@ fill_single_seg_mbuf(struct rte_mbuf *m, struct rte_mempool *mp, static void fill_multi_seg_mbuf(struct rte_mbuf *m, struct rte_mempool *mp, void *obj, uint32_t mbuf_offset, uint16_t segment_sz, - uint16_t segments_nb) + uint16_t headroom, uint16_t data_len, uint16_t segments_nb) { uint16_t mbuf_hdr_size = sizeof(struct rte_mbuf); uint16_t remaining_segments = segments_nb; @@ -57,10 +60,10 @@ fill_multi_seg_mbuf(struct rte_mbuf *m, struct rte_mempool *mp, m->buf_iova = next_seg_phys_addr; next_seg_phys_addr += mbuf_hdr_size + segment_sz; m->buf_len = segment_sz; - m->data_len = segment_sz; + m->data_len = data_len; - /* No headroom needed for the buffer */ - m->data_off = 0; + /* Use headroom specified for the buffer */ + m->data_off = headroom; /* init some constant fields */ m->pool = mp; @@ -99,10 +102,12 @@ mempool_obj_init(struct rte_mempool *mp, op->sym->m_src = m; if (params->segments_nb == 1) fill_single_seg_mbuf(m, mp, obj, params->src_buf_offset, - params->segment_sz); + params->segment_sz, params->headroom_sz, + params->data_len); else fill_multi_seg_mbuf(m, mp, obj, params->src_buf_offset, - params->segment_sz, params->segments_nb); + params->segment_sz, params->headroom_sz, + params->data_len, params->segments_nb); /* Set destination buffer */ @@ -110,7 +115,8 @@ mempool_obj_init(struct rte_mempool *mp, m = (struct rte_mbuf *) ((uint8_t *) obj + params->dst_buf_offset); fill_single_seg_mbuf(m, mp, obj, params->dst_buf_offset, - params->segment_sz); + params->segment_sz, params->headroom_sz, + params->data_len); op->sym->m_dst = m; } else op->sym->m_dst = NULL; @@ -172,6 +178,11 @@ cperf_alloc_common_memory(const struct cperf_options *options, struct obj_params params = { .segment_sz = options->segment_sz, + .headroom_sz = options->headroom_sz, + /* Data len = segment size - (headroom + tailroom) */ + .data_len = options->segment_sz - + options->headroom_sz - + options->tailroom_sz, .segments_nb = segments_nb, .src_buf_offset = crypto_op_total_size_padded, .dst_buf_offset = 0 diff --git a/app/test-crypto-perf/main.c b/app/test-crypto-perf/main.c index 4ae1439..2c46525 100644 --- a/app/test-crypto-perf/main.c +++ b/app/test-crypto-perf/main.c @@ -149,6 +149,23 @@ cperf_initialize_cryptodev(struct cperf_options *opts, uint8_t *enabled_cdevs, .nb_descriptors = opts->nb_descriptors }; + /** + * Device info specifies the min headroom and tailroom + * requirement for the crypto PMD. This need to be honoured + * by the application, while creating mbuf. + */ + if (opts->headroom_sz < cdev_info.min_mbuf_headroom_req) { + /* Update headroom */ + opts->headroom_sz = cdev_info.min_mbuf_headroom_req; + } + if (opts->tailroom_sz < cdev_info.min_mbuf_tailroom_req) { + /* Update tailroom */ + opts->tailroom_sz = cdev_info.min_mbuf_tailroom_req; + } + + /* Update segment size to include headroom & tailroom */ + opts->segment_sz += (opts->headroom_sz + opts->tailroom_sz); + if (session_pool_socket[socket_id] == NULL) { char mp_name[RTE_MEMPOOL_NAMESIZE]; struct rte_mempool *sess_mp; -- 2.7.4