From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40079.outbound.protection.outlook.com [40.107.4.79]) by dpdk.org (Postfix) with ESMTP id 5BE155B36 for ; Wed, 4 Jul 2018 14:04:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=s1Fsez62HPpaxvX149xzhjTXAGWNkQVZL+p/VxZ3hyc=; b=V39U03WCZZxhRqkDYFCnhd/iJbNjH+pYki4UtuiTBXv44jcdi1tSu00zqF2Kf03FtLxPTFSEKeGvysRhdicLUcwdVxUxZcXpu95mCxhwahkgwPDiTG/1tHixjeb2X8jgp5RIa3BDZBtc7xwSmqcvMdNTgKmc0qFdT3q9MunH+9Y= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=akhil.goyal@nxp.com; Received: from [10.232.134.144] (14.142.187.166) by VI1PR04MB1391.eurprd04.prod.outlook.com (2a01:111:e400:5348::22) 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 12:04:47 +0000 To: Pablo de Lara , declan.doherty@intel.com, shally.verma@caviumnetworks.com, ravi1.kumar@amd.com, jerin.jacob@caviumnetworks.com, roy.fan.zhang@intel.com, fiona.trahe@intel.com, tdu@semihalf.com, jianjay.zhou@huawei.com Cc: dev@dpdk.org References: <20180608220234.10170-1-pablo.de.lara.guarch@intel.com> <20180628005304.26544-1-pablo.de.lara.guarch@intel.com> <20180628005304.26544-6-pablo.de.lara.guarch@intel.com> From: Akhil Goyal Message-ID: Date: Wed, 4 Jul 2018 17:34:30 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180628005304.26544-6-pablo.de.lara.guarch@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: BM1PR01CA0118.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00::34) To VI1PR04MB1391.eurprd04.prod.outlook.com (2a01:111:e400:5348::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c9e84053-7d23-42a3-a546-08d5e1a65768 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(48565401081)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020); SRVR:VI1PR04MB1391; X-Microsoft-Exchange-Diagnostics: 1; VI1PR04MB1391; 3:vxFH4zU5mnWfubL778Ej6o1CNps+9LW1evJMB4m3lZHX07TdJSXHlOcS75ROeRfMXlFyctMYBn/WyBMMatb+gy6SFwT12ebSGa8YiJl6YKetfmiq2fKHNnFYs1IGj9Nb2RiakCffIoxgWfhDMa43yl2ZuKysX2V4I9sb3z0Dr32PaIFIb1fkCW4nxFMDEmCs/TEpke4re0y8VkKYxxltQD6sOmCe+fy+QVCfZsxB0kFKN87pxuh6h4cw4iLBk4DW; 25:15XB/0XvYqDRhh/oZVDXvOmzfyY/W1uqF02f8zNQZwtImvKRpeOpTQHsW0/ReQo4B3z9AiwXlJfh2/owGTb1lwL/xAzlDcpwsVmNfLEvZTDlVeNQwdQykk6WQp1CQHXBYiQPHZf67r6DsxLmSIA6Ip9W6b5PXBiH9l387bUS7stPDS7VTrZoBmeuw0RxX6r2tixWbAEMOa68o3/9/ogi46uYUITYRw6W54jlG+ekOIubZWzN9OHsLwuviBkLl1dY9DrxjSPclo4XBMzCM4FsLwzt5gI5F+OONidTERU/Ehwg0i2vhJHorR3znmvBOFLvpgjftnnUlyvPX0CJajjYMA==; 31:Ywl5xqJJCjsw+rG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4bT8OCJFE3COHGIrSmpq0gu9EJ4ArdRbmsL6mg X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); 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)(93001095)(10201501046)(3002001)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(20161123560045)(20161123562045)(6072148)(201708071742011)(7699016); SRVR:VI1PR04MB1391; BCL:0; PCL:0; RULEID:; SRVR:VI1PR04MB1391; X-Forefront-PRVS: 0723A02764 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6049001)(396003)(136003)(366004)(376002)(39860400002)(346002)(199004)(189003)(3846002)(316002)(8936002)(7736002)(16576012)(81156014)(3260700006)(68736007)(25786009)(229853002)(6486002)(26005)(31696002)(5660300001)(5009440100003)(305945005)(6116002)(64126003)(81166006)(7416002)(2906002)(8676002)(105586002)(6666003)(230700001)(4326008)(106356001)(65826007)(65806001)(36756003)(97736004)(52116002)(86362001)(23676004)(76176011)(486006)(67846002)(65956001)(66066001)(47776003)(2486003)(478600001)(53936002)(31686004)(52146003)(53546011)(386003)(16526019)(575784001)(55236004)(44832011)(2616005)(77096007)(186003)(6246003)(956004)(50466002)(446003)(58126008)(11346002)(476003)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR04MB1391; H:[10.232.134.144]; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtWSTFQUjA0TUIxMzkxOzIzOmlqSk1qcklTbFdwU1lqMDVGVUU3ZklVTmU4?= =?utf-8?B?NDVlWVJ4ZFFJM0FOd1k3Y1JjYTZYbGh3MUVNWktCRTYvZ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YN7YNGuKq8FAKvGCB8d8hpzFJU5fpxmiyh552nFLha6bdeASZsZtq/zzU/IR+z2ueyk/kbOtpkePZNA+0Z6vXvprSguBL9rp6Eq6BRRyc5op8vqixeIMkTXEpH/IQ==; 5:nCbhQqpua4zMZ41gFoiUjLMUgnJtMkfsVPkQnNDfSEXJKtlnChLFIM80vN4dYa/2KtAHu58HkaxzI5aroBYPJ0/vO2SJje69N9/QtsC5rYGbz2Z6ruuJLZFsLlGTj/Q5O0YBQDtXAOoYayKEPyln1/YalnBuGSt8/FLg/ewY4fo=; 24:ODika8FgGkFFZs/ZJIwvc/X1W3ol1s8oNe/RscdaTWUPZkWZ+nj7DeK+FevaEMYNrnZeencUUtBeDYh6+wSEIY9UdhirYCl3+5YxIoWlwf4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR04MB1391; 7:hAeRVzPUmLZdGJylKQyo9w6RWzNDfr/xDiW+OW9lR/HQ4IstSGcuM/LghgROlhPy3ierRCfoH89ORFsEBe5ItM5i/6hhgir6w0kNOYLbkdRj25L9/hY0jaQPhAvmvHyuxTf/kJb6WQFIfCH0SeCMC0p0IIvCyL+N81gXPd76cTYYyRgUMTtbuRh8uV+uSJv9j2leYnfDmF7KttidjGjj/cKVYg8TUp/4WaqV3/OTTZhaOth8nBfI2ekuoGvGRUmr X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2018 12:04:47.1612 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c9e84053-7d23-42a3-a546-08d5e1a65768 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB1391 Subject: Re: [dpdk-dev] [PATCH v3 05/16] examples/l2fwd-crypto: limit number of sessions 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 12:04:51 -0000 On 6/28/2018 6:22 AM, Pablo de Lara wrote: > Calculate the number of sessions required for the application, > knowing that there is only one session required per device. > > Signed-off-by: Pablo de Lara > --- > examples/l2fwd-crypto/main.c | 19 +++++++++++++++++-- > 1 file changed, 17 insertions(+), 2 deletions(-) > > diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c > index 4bca87b19..e8384b0c1 100644 > --- a/examples/l2fwd-crypto/main.c > +++ b/examples/l2fwd-crypto/main.c > @@ -42,6 +42,9 @@ > #include > #include > #include > +#ifdef RTE_LIBRTE_PMD_CRYPTO_SCHEDULER > +#include > +#endif > > enum cdev_type { > CDEV_TYPE_ANY, > @@ -59,7 +62,6 @@ enum cdev_type { > #define MAX_AAD_SIZE 65535 > #define MAX_PKT_BURST 32 > #define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */ > -#define MAX_SESSIONS 32 > #define SESSION_POOL_CACHE_SIZE 0 > > #define MAXIMUM_IV_LENGTH 16 > @@ -2010,6 +2012,19 @@ initialize_cryptodevs(struct l2fwd_crypto_options *options, unsigned nb_ports, > > rte_cryptodev_info_get(cdev_id, &dev_info); > > + /* Two sessions objects are required for each session > + * (one for the header, one for the private data) > + */ > + uint32_t sessions_needed = 2 * enabled_cdev_count; Should we do this in #else of RTE_LIBRTE_PMD_CRYPTO_SCHEDULER ? Otherwise, Acked. > +#ifdef RTE_LIBRTE_PMD_CRYPTO_SCHEDULER > + if (!strcmp(dev_info.driver_name, "crypto_scheduler")) { > + uint32_t nb_slaves = > + rte_cryptodev_scheduler_slaves_get(cdev_id, > + NULL); > + > + sessions_needed = 2 * enabled_cdev_count * nb_slaves; > + } > +#endif > if (session_pool_socket[socket_id] == NULL) { > char mp_name[RTE_MEMPOOL_NAMESIZE]; > struct rte_mempool *sess_mp; > @@ -2022,7 +2037,7 @@ initialize_cryptodevs(struct l2fwd_crypto_options *options, unsigned nb_ports, > * device private data > */ > sess_mp = rte_mempool_create(mp_name, > - MAX_SESSIONS * 2, > + sessions_needed, > max_sess_sz, > SESSION_POOL_CACHE_SIZE, > 0, NULL, NULL, NULL, >