From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40045.outbound.protection.outlook.com [40.107.4.45]) by dpdk.org (Postfix) with ESMTP id 318AFDE0 for ; Tue, 6 Mar 2018 07:45:11 +0100 (CET) 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; bh=eOewqPSDOIMzZNi4h0pG5Wwigi6H7Kkh427RPHko7+k=; b=nWy02Akixfgms2Xilxs+KAeXeFiJ53rMYEsm3OK3r21s7Pfsu/s0wkSrse6FOv+HRpxN5P6Ewvp7QR3e7hdMQLBTE9JX0jiZzmKiKDK3zEVucq/GXrHflXdbOIWUHNjeF87Yi81juaSdq11LN46BPAroC4pmJ17pJxCYWHAy5w8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=akhil.goyal@nxp.com; Received: from [IPv6:2402:3a80:922:ec7d:f02a:5b86:31ec:af4] (2402:3a80:922:ec7d:f02a:5b86:31ec:af4) by DB5PR04MB1381.eurprd04.prod.outlook.com (2a01:111:e400:58da::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.548.13; Tue, 6 Mar 2018 06:45:06 +0000 To: "Gujjar, Abhinandan S" , Jerin Jacob Cc: "dev@dpdk.org" , "Vangati, Narender" , "Rao, Nikhil" , "Eads, Gage" , "hemant.agrawal@nxp.com" , "narayanaprasad.athreya@cavium.com" , "nidadavolu.murthy@cavium.com" , "nithin.dabilpuram@cavium.com" References: <1516013630-146114-1-git-send-email-abhinandan.gujjar@intel.com> <20180216193348.GA8882@jerin> <5612CB344B05EE4F95FC5B729939F7807069B737@PGSMSX102.gar.corp.intel.com> <20180220135920.GA23970@jerin> <5612CB344B05EE4F95FC5B729939F780706A30FA@PGSMSX102.gar.corp.intel.com> From: Akhil Goyal Message-ID: Date: Tue, 6 Mar 2018 12:14:42 +0530 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <5612CB344B05EE4F95FC5B729939F780706A30FA@PGSMSX102.gar.corp.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [2402:3a80:922:ec7d:f02a:5b86:31ec:af4] X-ClientProxiedBy: BM1PR0101CA0057.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:19::19) To DB5PR04MB1381.eurprd04.prod.outlook.com (2a01:111:e400:58da::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 98d210e9-4c8d-4113-54bb-08d5832dce22 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:DB5PR04MB1381; X-Microsoft-Exchange-Diagnostics: 1; DB5PR04MB1381; 3:Rfh5guoVoh2gn+4xtOavscnIS1+V08RhbUMx8q73/fn4QpAoWyWzR0sAcvPZmd33hx4I16yNO21lKXZ5B4e8ut+jQK21FIXzbfedW0zuaVTVcoOIb8mD9SwHtjIhSUU4S/0LNOenJNOG6hnb7u1f+qaTyEdlsKICkIHpPO4Ctzza+EZdwL3KCABv7O7exEjZl07nI4hR2ynxLZ1qDoN/4Y5TL3c2jj5Xd5/0VaJaBsp3WtULk/EsupWZQSlwfKor; 25:sqDxF1vcAcJYcKQowATnTQJCd701Alr/sUhwb9TlEaPS2FtqvP8+ieIzUCKPOjwysoIfeHBmhTebBkMm1X2vMY2m1Ygj6ID1ptTThH2egIMzLzf7UcUbMklTE8MkJqLa+BfQO1roGG67aQDiAgKYdAxJ5FZ+fvYjDH8vZn6AQyBV8niRr4v8bbXc/w7fxcqcDin3RrNEMw+O8MWXWmS6f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WySlLIb0+vG25wPbnLdI7f0pUjum+gJv+jRMW7uJ6+X1pnmvfMa8DoExMWtSUslrxAnwQ5pH6l5zx1cTq2MSR0himegMj6NgU77O7GthDw6dF4RH9wSJMuB5T3dH8FXUH8eR5q1FFM2V+7d+O3ZttfVQnAA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040501)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(10201501046)(3231220)(944501244)(52105095)(6055026)(6041288)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123560045)(6072148)(201708071742011); SRVR:DB5PR04MB1381; BCL:0; PCL:0; RULEID:; SRVR:DB5PR04MB1381; X-Forefront-PRVS: 06036BD506 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(366004)(346002)(39380400002)(39860400002)(376002)(189003)(199004)(386003)(31686004)(53936002)(23676004)(67846002)(76176011)(6666003)(52396003)(2486003)(105586002)(97736004)(52116002)(54906003)(68736007)(16526019)(110136005)(106356001)(58126008)(6116002)(478600001)(50466002)(52146003)(47776003)(229853002)(31696002)(1706002)(6246003)(2950100002)(186003)(8936002)(7736002)(305945005)(6486002)(561944003)(8676002)(81156014)(81166006)(316002)(36756003)(25786009)(5660300001)(46003)(4326008)(65956001)(86362001)(53546011)(2906002)(59450400001)(65806001)(230700001)(64126003)(65826007)(93886005); DIR:OUT; SFP:1101; SCL:1; SRVR:DB5PR04MB1381; H:[IPv6:2402:3a80:922:ec7d:f02a:5b86:31ec:af4]; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtEQjVQUjA0TUIxMzgxOzIzOkx0R0tZcHZyZFJ6NFMrd0dWRUJtbXpLYXF2?= =?ut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Jbzjl3471QWGP4AigX+YwnYViRJFdhl9mkFC+ZuAKBnOoQQoCbBpAP1lyopzNFdMEyBrolQr0O+JPEslYqwM4N8FwhN+MRIyblEOY9ThiqdKPUU25LESDpxvBdHFV00HVTf/lCDMUCvLyrP1LwUeq SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2018 06:45:06.3227 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 98d210e9-4c8d-4113-54bb-08d5832dce22 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR04MB1381 Subject: Re: [dpdk-dev] [RFC v2, 2/2] eventdev: add crypto adapter API header 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, 06 Mar 2018 06:45:11 -0000 Hi Abhinandan, Sorry for the delayed response, my office network had some issues wrt NNTP, so couldn't reply. On 2/28/2018 2:31 PM, Gujjar, Abhinandan S wrote: > Hi Akhil, > ...... >>>>> >>>>>> + * crypto operation directly to cryptodev or send it to the >>>>>> + cryptodev >>>>>> + * adapter via eventdev, the cryptodev adapter then submits the >>>>>> + crypto >>>>>> + * operation to the crypto device. The first mode is known as the >>>>> >>>>> The first mode (DEQ) is very clear. In the second mode(ENQ_DEQ), >>>>> - How does "worker" submits the crypto work through crypto-adapter? >>>>> If I understand it correctly, "workers" always deals with only >>>>> cryptodev's >>>>> rte_cryptodev_enqueue_burst() API and "service" function in crypto >>>>> adapter would be responsible for dequeue() from cryptodev and enqueue to >> eventdev? >>>>> >>>>> I understand the need for OP_NEW vs OP_FWD mode difference in both >> modes. >>>>> Other than that, What makes ENQ_DEQ different? Could you share the >>>>> flow for ENQ_DEQ mode with APIs. >>>> >>>> /* >>>> Application changes for ENQ_DEQ mode: >>>> ------------------------------------------------- >>>> /* In ENQ_DEQ mode, to enqueue to adapter app >>>> * has to fill out following details. >>>> */ >>>> struct rte_event_crypto_request *req; >>>> struct rte_crypto_op *op = rte_crypto_op_alloc(); >>>> >>>> /* fill request info */ >>>> req = (void *)((char *)op + op.private_data_offset); >>>> req->cdev_id = 1; >>>> req->queue_pair_id = 1; >>>> >>>> /* fill response info */ >>>> ... >>>> >>>> /* send event to crypto adapter */ >>>> ev->event_ptr = op; >>>> ev->queue_id = dst_event_qid; >>>> ev->priority = dst_priority; >>>> ev->sched_type = dst_sched_type; >>>> ev->event_type = RTE_EVENT_TYPE_CRYPTODEV; >>>> ev->sub_event_type = sub_event_type; >>>> ev->flow_id = dst_flow_id; >>>> ret = rte_event_enqueue_burst(event_dev_id, event_port_id, ev, 1); >>>> >>>> >>>> Adapter in ENQ_DEQ mode, submitting crypto ops to cryptodev: >>>> ----------------------------------------------------------------------------- >>>> n = rte_event_dequeue_burst(event_dev_id, event_port_id, ev, >> BATCH_SIZE, time_out); >>>> struct rte_crypto_op *op = ev->event_ptr; >>>> struct rte_event_crypto_request *req = (void *)op + >> op.private_data_offset; >>>> cdev_id = req->cdev_id; >>>> qp_id = req->queue_pair_id >>>> >>>> ret = rte_cryptodev_enqueue_burst(cdev_id, qp_id, op, 1); >>> >>> This mode wont work for the HW implementations that I know. As in HW >>> implementations, The Adapter is embedded in HW. >>> The DEQ mode works. But, This would call for to have two separate >>> application logic for DEQ and ENQ_DEQ mode. >>> I think, it is unavoidable as SW scheme has better performance with ENQ_DEQ >> MODE. >>> >>> If you think, there is no option other than introducing a capability >>> in adapter then please create capability in Rx adapter to inform the >>> adapter capability to the application. >>> >>> Do we think, it possible to have scheme with ENQ_DEQ mode, Where >>> application still enqueue to cryptodev like DEQ mode but using >>> cryptodev. ie. Adapter patches the cryptodev dev->enqueue_burst() to >>> "eventdev enqueue burst" followed by "exiting dev->enqueue_burst". >>> Something like exiting ethdev rx_burst callback scheme. >>> This will enable application to have unified flow IMO. >>> >>> Any thoughts from NXP folks? >> >> I see that there is performance gain in sw side while using ENQ_DEQ mode. But >> since we already have many modes in the application already, can we make this >> one with some callback to cryptodev. >> >> So the application can call the rte_cryptodev_enqueue_burst() as it is doing, and >> if the ENQ_DEQ mode is supported by the underneath implementation then, it >> can register a callback to the implementation that is required in the driver layer >> itself. > In ENQ-DEQ mode, crypto request are sent through the eventdev. > With your proposal, it is not clear how crypto request can be hidden under rte_cryptodev_enqueue_burst()! > Can you please share flow diagram or pseudo code? > > -Abhinandan > The code flow is what Jerin also suggested. "Adapter patches the cryptodev dev->enqueue_burst() to "eventdev enqueue burst" followed by "exiting dev->enqueue_burst". Something like exiting ethdev rx_burst callback scheme." The suggestion was just to simplify the flow in the application. My main concern is that the ipsec-secgw application is already having a lot of modes and we are about to add two more cases. >> >> In this way, the application will become less complex as compared to the >> 2 parallel implementations for SW and HW. It will also give more flexibility to the >> driver implementation as well. >> >> -Akhil >>> >>>> */ >>>>> >>>>>> + * dequeue only (DEQ) mode and the second as the enqueue - >>>>>> + dequeue >>>>> >>>>> extra space between "mode" and "and" >>>> Ok >>>>> >>>>>> + * (ENQ_DEQ) mode. The choice of mode can be specified when >>>>>> + creating >>>>>> + * the adapter. >>>>>> + * In the latter choice, the cryptodev adapter is able to use >>>>>> + * RTE_OP_FORWARD as the event dev enqueue type, this has a >>>>>> + performance >>>>>> + * advantage in "closed system" eventdevs like the eventdev SW PMD >>>>>> + and >>>>> >>> >