From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0071.outbound.protection.outlook.com [104.47.36.71]) by dpdk.org (Postfix) with ESMTP id 83DD95F57 for ; Wed, 3 Oct 2018 11:37:44 +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=rV9fpvR5h3zmj9XtFzCcaEzl5KcgvqzHxFIlK+2jUDQ=; b=fl65YNEh42th2AOl65Z7QogpviVZlIbKDIt0cxzJGdqMNdRB6tA/I8lTygDqgbpuW6C7IPRXXSLdz8ryFRIqBLKDc+oUvns1nmyHXcOIWh9O/VZBZ5mjJukBnxNBh3FHSaNPz/N8FZR18nE7zKNA6Tn6fGgit732LXM74NDTyuo= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.JacobKollanukkaran@cavium.com; Received: from jerin (111.93.218.67) by BYAPR07MB4997.namprd07.prod.outlook.com (2603:10b6:a03:5b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1185.23; Wed, 3 Oct 2018 09:37:39 +0000 Date: Wed, 3 Oct 2018 15:07:19 +0530 From: Jerin Jacob To: "Ananyev, Konstantin" Cc: "Joseph, Anoob" , "dev@dpdk.org" , "Awal, Mohammad Abdul" , "Doherty, Declan" , Narayana Prasad , "akhil.goyal@nxp.com" , "hemant.agrawal@nxp.com" , "shreyansh.jain@nxp.com" Message-ID: <20181003093718.GA14844@jerin> References: <475cf471-b46a-671a-5485-0042c652430c@caviumnetworks.com> <2601191342CEEE43887BDE71AB977258EA954BAD@irsmsx105.ger.corp.intel.com> <2601191342CEEE43887BDE71AB977258EA954E9D@irsmsx105.ger.corp.intel.com> <20180916105640.GA4803@jerin> <2601191342CEEE43887BDE71AB977258EA95724C@irsmsx105.ger.corp.intel.com> <20180918175433.GA16116@jerin> <2601191342CEEE43887BDE71AB977258EA95A68A@irsmsx105.ger.corp.intel.com> <20180926180256.GA3069@jerin> <2601191342CEEE43887BDE71AB9772580102FE113C@IRSMSX106.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2601191342CEEE43887BDE71AB9772580102FE113C@IRSMSX106.ger.corp.intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: BM1PR01CA0096.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00::12) To BYAPR07MB4997.namprd07.prod.outlook.com (2603:10b6:a03:5b::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a52417a2-b7cd-4e2d-8764-08d62913ddea X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:BYAPR07MB4997; X-Microsoft-Exchange-Diagnostics: 1; BYAPR07MB4997; 3:EvhyGXjaca8cxpTGFsANzV8TCWBDY03zHS5l/ntcPK+4MdWGijarGDtOB4lAK8rLJDEq6oCLyXEkId8zkFDeqWsEFZujirjXDwzvBklNpay6Abvcs4BoHXliS0GbktdiiiMXHGoizIa7n1S0CVYtjHSbfFWbBlGgnwZVxh1AjqOSKyjlqbFQ3S3o3P+EhWpfFhPyGABc3Eu7K3Ptniw0AL5hMyoEDrmeEUQaMDI951AkYDC2I7TGSxu2H2FGdEPg; 25:xQ6I/D6zcR2HMWYwwn9l/joKqoVrtpiselg4BtV1IZP8icAx8OClxdiTlWmMkhuxYbsvbUl+KWqktD+ybsr8GEWjyco+xS2gQqjPGJm5L73LqWmL0VnRKdwZidOoai/aW1fsz7NJJkKmN/rxgtdnYT7H6VvPnew344A//4LkNYu7I19eh5E0GRnL7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YdiCGDTPYtAuZ7g0tTsqg= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699)(185117386973197)(163750095850); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(3002001)(3231355)(944501410)(52105095)(10201501046)(149066)(150057)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(20161123560045)(201708071742011)(7699051); SRVR:BYAPR07MB4997; BCL:0; PCL:0; RULEID:; SRVR:BYAPR07MB4997; X-Microsoft-Exchange-Diagnostics: 1; BYAPR07MB4997; 4:sEUdeRveWUy1tRVyq+nqg/naar5l5+Bnrxagd3lnlD7p3kl8A7xoEANq2Pj1XRpXi29hQt1kw1aYaulEcc5GA3vTqRY5uWfiSNxTnbwTsL2wVy+gloyYjgTlMMllkE9FlVB+LIfgSlY50IPsz2DvvdKO9uSyDwca1sqwVFxXoIuQMU/bKs4cLLEqh/akcu4FxKoOp9vSzwAxOslaRd+I8zO772XKBRWYkPnCCqGXMFjh89yzin1OfHtn1LwQgXco9Y0v3LD9edoRFUQ7ODnK1apGYtH691rB5a0igpcCpTf2ZZRVF3OihBERP6Bf+b9InVJDG38KipxON2hL9Y1l5wBmN0LldUA08Umfep7kXlzXrtyJwfJZ1wbVh7u2mv6r X-Forefront-PRVS: 0814A2C7A3 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(346002)(376002)(39860400002)(366004)(136003)(13464003)(199004)(189003)(66066001)(16526019)(33656002)(16586007)(6916009)(42882007)(81166006)(54906003)(72206003)(47776003)(316002)(25786009)(305945005)(68736007)(966005)(478600001)(14444005)(23726003)(6666003)(33896004)(386003)(2906002)(106356001)(33716001)(6116002)(3846002)(8936002)(105586002)(8676002)(76176011)(81156014)(229853002)(1076002)(5009440100003)(7736002)(58126008)(50466002)(44832011)(6306002)(9686003)(5660300001)(55016002)(52116002)(4326008)(97736004)(93886005)(186003)(6496006)(6246003)(486006)(26005)(446003)(956004)(476003)(53936002)(11346002)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR07MB4997; H:jerin; 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; BYAPR07MB4997; 23:kPt2gPeQuHgw77YiFeTieZ61+lH77n7MZ66OCzpBc?= =?us-ascii?Q?GaNboyyZSiGLpEzd8gUhdEsVnhvK1Oj8thkxOngmjd0LJFO/ImkToPOnYyPE?= =?us-ascii?Q?jNOcEZDYOV73ebfwuv82m9vn6JNxPS8uLVN1lEePHQh+j3XUruPfBTJRSHXd?= =?us-ascii?Q?z/tJdVZG2A3sDzQKXyoRbyzaDj57XbHMHNOdE486E6ChbREn/pMcci85J7y4?= =?us-ascii?Q?QSglgGC02eWVm9m0NGlAiBuP+lpZQZ/u0G1qyC7EdIPyLYDFhxHW9qQX9hO1?= =?us-ascii?Q?fcsbmfFAqEbnsE8sGRuSwlj63QHhryZ12oEZ7WdQPSNIWBIyz56yLvYIE31V?= =?us-ascii?Q?OXd8mXc47nusoeru5r7LP2CceGIUc71UVzOd7zACt14qvNuImI+xiwwtWUGS?= =?us-ascii?Q?MDm3W3GuS3hSy2HMsfvUu1/dmx3qdXrkqmSUkDmVkJ96wkkGVhiLhBbPsMot?= =?us-ascii?Q?Pu6e2jbAXEq8D4wAAf+JgBO5miK9BtwGBQsKw0tpeKsG67LkS74xkfmiG1EG?= =?us-ascii?Q?f2fg/jh3GMf2+IvBObvtW+bAy+9MTPKqJuWxMQEDp17eAjTMbwVK5Jy6hxel?= =?us-ascii?Q?x7EAaus2SrP+QGFIhGR1ZxhIMhZaudmkQJZNMSTrwizQL7VAvZTeJWOG2/w5?= =?us-ascii?Q?HKxouOkhZnaCczQTDRVps5LrF32AmHJPS40UHgYEmY4aGshS2QLjNEawGSzv?= =?us-ascii?Q?Wn5tywvF6RiaJAMsWeOET83Lg8FDx/Aropm4med6en6KnWzN68sOPkddIyHw?= =?us-ascii?Q?KzVh28nhvUKunGNpi6l2CQqxoRqOsEjqPkyrVdP2H13i7LJ+IBeTASIOJT8S?= =?us-ascii?Q?JQt9Mp+CQy/Uk5/L4IgVDECHiZFx7tXyZdtHjfClmYUIz5LOPqIylJCeYIe5?= =?us-ascii?Q?TaILumJ/5bA9f9RnK7J5p9RjtPVPKTqzu9AyyiXnCsxB42sEvFLvQC1EDGyi?= =?us-ascii?Q?Dm/G1poG7PQKnG2xXDuf8RD+vcSpa3yM8134U4NWVxnZQjFUgSG4iwhGH0ME?= =?us-ascii?Q?1Is2ynBhF7LCpJZBBPzU/WRZMFUXCStDYvxMtQeXYFhI+fKnVcjNOWFrhR02?= =?us-ascii?Q?2FKcqGSDyeGLIdev9LrWVMautTMD8jTSnyakqrftNs3zHTtXZd2HAI/886ey?= =?us-ascii?Q?9HqCfMuT5iph0qQnRUPtdJ3VQtJLUEceBE1YQpMjxZlWBunBmHpmi+OjNrcA?= =?us-ascii?Q?7xDrJxxQFs7EtxYABYu7V4OxtI4euO2zvktCr+BA/wTS+tHHnbbtnEMpfClW?= =?us-ascii?Q?eu7+RpJj8EcwL3pHnrZAb1NTkqbONI+cy5UaJJCsB39TFtYhDD74FM8P+Y2F?= =?us-ascii?Q?4jNKgHkaQnbf+NJBiatb85WEO54wsejWLEzr5HWLo985uYKAuydqDJrOIos5?= =?us-ascii?Q?wE0yNZ8mJJ2KgfaUAnKiRu4Omzzod8ej8MsXIQdX5GnOJegWLKxq/ssn2qcf?= =?us-ascii?Q?4tJbIpKsy9cypizjk2nIitlWbol4Xs=3D?= X-Microsoft-Antispam-Message-Info: FAcp5wl9AETlHItDv6/qZv4GO84m0MaKUzqCOzhhPmnvsXknr1EMFnhmYpO52TGrdjcrYaVPp61xXano3krQ5DkLoHsM83WzunVCNIamK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wAzYPjuEA3G0TyZpI+r5a2EZysbQFF5JoT9xk/Hk09fqDigyxSvxMow0ufxnUO0FnOZFyzxdjonddDzMXRFp4uCLz4r0RmYLT7mHEbVlz804JLvO4eOPS4cMw SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2018 09:37:39.3536 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a52417a2-b7cd-4e2d-8764-08d62913ddea X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR07MB4997 Subject: Re: [dpdk-dev] [RFC] ipsec: new library for IPsec data-path processing 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, 03 Oct 2018 09:37:45 -0000 -----Original Message----- > Date: Tue, 2 Oct 2018 23:56:23 +0000 > From: "Ananyev, Konstantin" > To: Jerin Jacob > CC: "Joseph, Anoob" , "dev@dpdk.org" > , "Awal, Mohammad Abdul" , > "Doherty, Declan" , Narayana Prasad > , "akhil.goyal@nxp.com" > , "hemant.agrawal@nxp.com" , > "shreyansh.jain@nxp.com" > Subject: RE: [dpdk-dev] [RFC] ipsec: new library for IPsec data-path > processing > > External Email > > Hi Jerin, Hi Konstantin, > > > static inline rte_ipsec_add_tunnel_hdr(struct rte_mbuf *mbuf); > > static inline rte_ipsec_update_sqn(struct rte_mbuf *mbuf, &seq_no); > > ... > > > > For the regular use case, a fat > > rte_ipsec_(inbound/outbound)_(prepare/process) can be provided. The > > worker implemented for that case can directly call the function and > > forget about the other modes. For other vendors with varying > > capabilities, there can be multiple workers taking advantage of the hw > > features. For such workers, the static inline functions can be used as > > required. This gives vendors opportunity to pick and choose what they > > want from the ipsec lib. The worker to be used for that case will be > > determined based on the capabilities exposed by the PMDs. > > > > https://mails.dpdk.org/archives/dev/2018-June/103828.html > > > > The above email explains how multiple workers can be used with l2fwd. > > > > For this to work, the application & library code need to be modularised. > > Like what is being done in the following series, > > https://mails.dpdk.org/archives/dev/2018-June/103786.html > > > > This way one application can be made to run on multiple platforms, with > > the app being optimized for the platform on which it would run. > > > > /* ST SA - RTE_SECURITY_ACTION_TYPE_NONE - CRYPTODEV - NO EVENTDEV*/ > > worker1() > > { > > while(true) { > > nb_pkts = rte_eth_rx_burst(); > > > > if (nb_pkts != 0) { > > /* Do lookup */ > > rte_ipsec_inbound_prepare(); > > rte_cryptodev_enqueue_burst(); > > /* Update in-flight */ > > } > > > > if (in_flight) { > > rte_cryptodev_dequeue_burst(); > > rte_ipsec_outbound_process(); > > } > > /* route packet */ > > } > > > > #include /* For IPsec lib static inlines */ > > > > static inline rte_event_enqueue(struct rte_event *ev) > > { > > ... > > } > > > > /* MT safe SA - RTE_SECURITY_ACTION_TYPE_NONE - CRYPTODEV - EVENTDEV) > > worker2() > > { > > while(true) { > > nb_pkts = rte_eth_rx_burst(); > > > > if (nb_pkts != 0) { > > /* Do lookup */ > > rte_ipsec_add tunnel(ev->mbuf); > > rte_event_enqueue(ev) > > rte_cryptodev_enqueue_burst(ev->mbuf); > > /* Update in-flight */ > > } > > > > if (in_flight) { > > rte_cryptodev_dequeue_burst(); > > rte_ipsec_outbound_process(); > > } > > /* route packet */ > > } > > Hmm, not sure how these 2 cases really differs in terms of ipsec processing. > I do understand the in second one we use events to propagate packets through the system, > and that eventdev might be smart enough to preserve packet ordering, etc. > But in terms of ipsec processing we have to do exactly the same for both cases. > Let say for the example above (outbound, crytpodev): > a) lookup an SA > b) increment SA.SQN and check for overflow > d) generate IV > e) generate & fill ESP header/trailer, tunnel header > f) perform actual encrypt, generate digest > > So crypto_prepare() - deals with b)-e). > f) is handled by cryptodev. > Yes, step b) might need to be atomic, or might not - > depends on particular application design. > But in both cases (polling/eventdev) we do need all these steps to be performed. The real question, Is the new library should be aware of eventdev or application decides it? If it is former, in order to complete step (b), we need rte_event also passed to _process() API and process() API needs to be function pointer in order to accommodate all combinations of different HW/SW capabilities. > Konstantin > > > > > In short, > > > > 1) Have separate small inline functions in library > > 2) If something can be grouped, it can be exposed a specific function > > to address a specific usecases > > 3) Let remaining code, can go in application as different worker() to > > address all the usecases. > > > > >