From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0079.outbound.protection.outlook.com [104.47.36.79]) by dpdk.org (Postfix) with ESMTP id 3E1C71AFF for ; Tue, 19 Jun 2018 08:28:13 +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=UkQqX92Lv+g6gRJ1wUu5xS0OMMYLjxPBwENLQVzDw+0=; b=DwBdjpHkCoJ1WwPCdxUsfxWh/XfTRPkCP88Awu8sFlINQNFexm+FR2jbJYjpkeNQ2YLp45gAajVgSrkcQXY811iEbLoKgom4XsCWS4/JlVf6UB20XrsMjXK73P3cLp9clhHuKgtj7mJAYP/1bxOVtC5lonw+deeAUKXTkWmNh6s= 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 DM6PR07MB4907.namprd07.prod.outlook.com (2603:10b6:5:a3::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.863.16; Tue, 19 Jun 2018 06:28:09 +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: Tue, 19 Jun 2018 11:56:14 +0530 Message-Id: <1529389574-6643-3-git-send-email-anoob.joseph@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1529389574-6643-1-git-send-email-anoob.joseph@caviumnetworks.com> References: <1529389574-6643-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: BM1PR0101CA0026.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:1a::12) To DM6PR07MB4907.namprd07.prod.outlook.com (2603:10b6:5:a3::12) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f7107e68-c56d-407a-ad9c-08d5d5add4ad X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(5600026)(711020)(2017052603328)(7153060)(7193020); SRVR:DM6PR07MB4907; X-Microsoft-Exchange-Diagnostics: 1; DM6PR07MB4907; 3:26HXMyoqk6hrd6snlXA1Sl5YaTcJx0Mq9ozDjAGd8b0qM2ShCtZ/vuOKllxRlIZs6i2wCVj5IeklxKCswmX1aYTSa+YDtMUKPugMF87NJRApXsk5Fn7zMEowno3mNs+nnWevGtNb7bGq8d0anG8VQLiFFXQnB8god+xdefSGg7nmjRzbFS8uNHsbtstl1Rk28dyzetTQR/kbnPmbCiZjPntzfHYDMQ9tS3cyKPtL2L0C8LyCR1HUdj6qndjSa5lB; 25:wkJUQKEMBcoyl9a97xB45MoNe/toPxsmw86xBoAL01YderxMrEFTzrC4oW+/aCiapOfQzgW+mEHS3sIc2EhEvHST9AFujNZzn52NYA0Z78EPwsRLn7Y8oD5DnYja0KmdtKzPhiWP+HLsydCenEpz8R8ZZs0bKxm950L8VMhZxK6VIcJ12fcpVVYQyMcc+gLU1oTf+deK800zXJeWzlSKju8QCwXWsr5zVKmXLZXwlwyEhOu6lLrgYoF5F8GDO/zXp3z1cyUvti9tCjw91SYqVZLvGuyN9vg6vHLZLxiwDsWz3g1FF19SjgPRytFr+sVOJIXlWEIcEHTRqnarc6wHpA==; 31:nzOsAWBn6F6YBtyaVHZFMjIlsuuck8FcE5e4V+G9Hg0Pc/GBSn5WgZOakY0wYR1pYlooFmSBwjbdwepGRDXHiuF+zCWOrf7jTRB19VR22Siq7EJuxrZ3XuwLAb/JoKx9vnjxep95GVX/pIhY6chyb87K6g2N7Ro0HKMkExyE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-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231254)(944501410)(52105095)(93006095)(10201501046)(3002001)(149027)(150027)(6041310)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(6072148)(201708071742011)(7699016); SRVR:DM6PR07MB4907; BCL:0; PCL:0; RULEID:; SRVR:DM6PR07MB4907; X-Forefront-PRVS: 07083FF734 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(376002)(396003)(39380400002)(366004)(39860400002)(199004)(189003)(16586007)(11346002)(36756003)(26005)(478600001)(25786009)(44832011)(2616005)(42882007)(16526019)(53936002)(54906003)(186003)(48376002)(476003)(956004)(6512007)(6666003)(305945005)(51416003)(316002)(52116002)(50226002)(68736007)(72206003)(486006)(6486002)(7736002)(76176011)(4326008)(110136005)(50466002)(5660300001)(3846002)(6116002)(105586002)(81166006)(8936002)(59450400001)(446003)(386003)(8676002)(8656006)(2906002)(106356001)(81156014)(47776003)(6506007)(97736004)(66066001)(55236004); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR07MB4907; 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; DM6PR07MB4907; 23:y/t2wN/5tyKQXRxB+wxP7lu1prpy2j9WUHCVHJ7xf?= =?us-ascii?Q?Tv7p8aS6Z8Tz/aV315r2JYHYjdDsGPVfvdRCjHOJzmnsSTSZLTxbMQm9Ubga?= =?us-ascii?Q?x4GAcQhEYvil5bo955hV7p8AbfuHvwye3P6mbWQADosZ5VeynxEBon+mAVlX?= =?us-ascii?Q?cpb6F5m2516O5gswrIFwgbc/k8vov0JcE3XMr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DRLt4yApv3Ck2AhqIQwZQ0DA5rLLQdMdIYvnu9BQTJ9CbkLUZgWZEWHOuha63+rTOGv7CyLJTHunt682w0+nFUnpNbw+PVdny65Ju8m0uzNy1ckg==; 5:i8R17/KZtpd/iqG2SRaTQp+TjXfK5WHeRolUvLBNjy4SgB1I4ZcZC6XFIXALuJYvavvhmik/5R/+WF6SeMPPZTQ02aZ7hglK6FKL4uWuaQvRXP/hfSCq5JgfkYD0cTAnjU/syIkH2PMZwv4gH9FDTNEbSKfvA+K7J8ucCEsyY/0=; 24:ZkPhqg+2hrZ0/FyNyRvXdPPN5knPsglbXiPZg8lXXJveEspejT6J0bQIdsXYY14fHfNNRvRmJcXXA5C/agOOzzk3vK231R5YyGWDfI382BU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM6PR07MB4907; 7:FddeFgdlFs+HVmngk0jBrY8c+Jxy587qXdhYbSragISuJDNbvdg/c5TdCTGKNXPjXGpL4aBxkaIhrfAlCd+IJ0h9i7BCZ07T+eHLNLVhJwzn/jyw/yPn6gwUfhZOJI4L6qyCnt23WRbVk8PKbVqotEuLPcQvk7rUblC1RS156okZNgCMi47SPpsEMVEaazNx3/xSXSGo0428yTXvCYcOTbwylP90W/EI3LUL2yWWZHu1YCodtCkywLRQtSzOcYyx X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jun 2018 06:28:09.0374 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f7107e68-c56d-407a-ad9c-08d5d5add4ad X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR07MB4907 Subject: [dpdk-dev] [PATCH 2/2] 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: Tue, 19 Jun 2018 06:28:13 -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 --- 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..9d9154e 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_headroom_req) { + /* Update headroom */ + opts->headroom_sz = cdev_info.min_headroom_req; + } + if (opts->tailroom_sz < cdev_info.min_tailroom_req) { + /* Update tailroom */ + opts->tailroom_sz = cdev_info.min_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