From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0061.outbound.protection.outlook.com [104.47.37.61]) by dpdk.org (Postfix) with ESMTP id C962D1B474 for ; Tue, 10 Jul 2018 16:43:26 +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=j1ovcAwD557zSq09q554pgKWixGxgL1cWirU10QOr2Y=; b=m+vDyLLl9Nstt/M0wW6e3UYhxiBoidARohV308cqU31xZ4bJe1bRIM428QuZG/8PNHz6fT+WPQLPjfGDDGiyq2Es5ZzaCJR7rOVOG8z+JAH5fe/oldDWONjV4CxwjcNKNTIWjBGZrSfezXoS2OPc2IqK1bVVnaoGpZVd5wpvl7k= 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 DM6PR07MB4905.namprd07.prod.outlook.com (2603:10b6:5:a3::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.930.20; Tue, 10 Jul 2018 14:43:22 +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, 10 Jul 2018 20:12:38 +0530 Message-Id: <1531233760-4929-3-git-send-email-anoob.joseph@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1531233760-4929-1-git-send-email-anoob.joseph@caviumnetworks.com> References: <1530712550-18099-1-git-send-email-anoob.joseph@caviumnetworks.com> <1531233760-4929-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: BM1PR01CA0100.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00::16) To DM6PR07MB4905.namprd07.prod.outlook.com (2603:10b6:5:a3::10) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bcd1f266-3bbf-424c-9ed2-08d5e6737e11 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(8990107)(5600053)(711020)(2017052603328)(7153060)(7193020); SRVR:DM6PR07MB4905; X-Microsoft-Exchange-Diagnostics: 1; DM6PR07MB4905; 3:SV/JPxKZS31hQ0cB0FmlSQQ8SOOkUVgHtxqkgCCsRuGAvFRjsxDzZuj8p39IztzubvJXIuxLGTT/VtcmnlHWoyeTQurkJ2SlB9XbGOmw/ez/X6/q3HL2BBetWjamG3McVjAk7fWIuqrhKrf3gN/Jfc6jm3uIHHNXBINGYafuEA4KBheUpFdzDzkjmfnOl/dDhbaitPs/NrnYskReTn/xMLPmUnkXcB9GEI6PL6kEsoFhuataD3bsRTIW6eyqb59T; 25:MAcXgRNB1xyMly1QP45M13UyxpV1XvIi7MW/InVuZ+qQ0Dq1Karg2uaDL90jIpmjzal2T1PqI++na9+Vz21DI2YihDpepvmZClmTs5TRNnl+8oXopWAh5ZMjxK13tIQQDBXPfkxpChTkYqzY4gYwgSNqA7DulhFXV6Ky/o1t/vc2GFtolmUNiPJmk+zWDocHeIxo5Sktu8dilbc7TAEwtVQBZqHT390HpKZoaXi7CsRCoOVxfgO76a71B/1/vTTN1NPI4oS6ksoJzoZJdY3TrZo29BQiI3iX+IiEDjWicl6WNW1s81HZNrVWOAq9lHfjF59hrDP03hHcRNwGrSkPFg==; 31:XSDAlSyFFEqS3Evo0zupgjwd0ncEwX5HiyqEWsURcMbW00zsyNKKJRO9DXQA65+a4sx18V8hFKFYDR1uxOrCRzforlXyAK8Z/T34kFNEDrzZqOANkp3di6W0jvtf7DdbQQiaM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ispam-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)(93006095)(3002001)(3231311)(944501410)(52105095)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:DM6PR07MB4905; BCL:0; PCL:0; RULEID:; SRVR:DM6PR07MB4905; X-Forefront-PRVS: 0729050452 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(136003)(376002)(346002)(39860400002)(396003)(366004)(199004)(189003)(14444005)(476003)(26005)(3846002)(16526019)(386003)(54906003)(55236004)(110136005)(2616005)(6506007)(186003)(16586007)(51416003)(6116002)(7736002)(478600001)(105586002)(25786009)(106356001)(305945005)(8676002)(81156014)(81166006)(76176011)(44832011)(486006)(956004)(42882007)(68736007)(11346002)(446003)(52116002)(2906002)(316002)(50226002)(8936002)(6666003)(97736004)(5660300001)(50466002)(66066001)(72206003)(36756003)(6512007)(48376002)(6486002)(4326008)(53936002)(47776003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR07MB4905; 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; DM6PR07MB4905; 23:223FezRBPzPnNW84g/S4abgFhQygVXDXZ70xN9Ryn?= =?us-ascii?Q?bELpMIChSyOO37oxyQKwyg/UNuRDMBtG4zch46Jl18One2u6zV0faZpO+CD6?= =?us-ascii?Q?tMumDKCsEDEldOcj8mBRzPEH1RR5VmVN4neUQjOxcSli6LYciAnRoJNPvMCX?= =?us-ascii?Q?vb+wBvg0s38u8op+gmGHyE5d1scCMWScAm3eGWh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FCKKanyUxUUeMvTiub8nL6dnIToLB/tDuvLyhVYGLu9GxQ7oeQ3ubN5Ut/HCSmIkaFTw66KjdCITfo0A==; 5:yOXCsPomIVZ6yHWWEXR3yZmU4ev/vBNVBM0+52FSApGCsbUU5En/Ciqu4skvJIOUkJD9dUa54Ec+bE+ziZ0KdZd7m13EhKVmjTsUYpslNbMowPRK+nEVZOKaai3dcGxJiUyJEzy8LCTFEOLEoGstU9AbcL2jhpQEWn+Ro5Ly4Rs=; 24:MNSpwEj3xVk7z0CNxwKMPBRzQL/9K+Afep0BsFdxgTCmrROSbXR3nwcgfThGCiBGhXzdK9YsWZdTE5VlX77M5xiEjbWyZbkBoLXqiJ1mNk0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM6PR07MB4905; 7:ElSQAraiK1/eEvkAhzhqeyFjtPrFsu+tCNHB/V+lXd9/Do2nvI7XOOvSY74+3h6A6YfaRhQbjHp6nASqZlt+lU17JWQ2HxbnaEh7Lx4Cvb6pQp/sEmIcJMev0HTHurpEBRQM5dplIpUWA02frSfgEOcvEIPdJ4hQQXpXV4Q6DH0GXuMm7hMcM3m9SXfWVgTDz73CzlMlX3hjkx9IiUM9gGLT0Y/16ZV6rjjyR7P62qvVCyNB/zp4/2TmxieBMPui X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2018 14:43:22.7254 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bcd1f266-3bbf-424c-9ed2-08d5e6737e11 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR07MB4905 Subject: [dpdk-dev] [PATCH v2 2/4] 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, 10 Jul 2018 14:43:27 -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 --- v2: * No change 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