From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM04-SN1-obe.outbound.protection.outlook.com (mail-eopbgr700046.outbound.protection.outlook.com [40.107.70.46]) by dpdk.org (Postfix) with ESMTP id 6F33F1B084 for ; Mon, 17 Sep 2018 16:40:41 +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=8OJu5mNm7vd1AcGYOSIm8h5/JwaX3f74joU2Ws8yBAI=; b=G8XFi7orXfaLVvyO2xtOfJKlg0YNohzHtBNIYJZBuvIrWUT3LisQZt6QEWqNgjANMv+SXIxvn7i9223K9SuhzVgpYv5s3oABeke7NMtomA2deXih/RVlPtU+PEAD6ps3TA79H78Pr+OrNJAUiEngeTlXR2ItLrN+xbDmrLhpfK0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Anoob.Joseph@cavium.com; Received: from [192.168.1.9] (223.230.22.245) by SN6PR07MB4910.namprd07.prod.outlook.com (2603:10b6:805:39::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.15; Mon, 17 Sep 2018 14:40:36 +0000 To: "Ananyev, Konstantin" , "dev@dpdk.org" Cc: "Awal, Mohammad Abdul" , "Doherty, Declan" , "Jerin Jacob (jerin.jacob@caviumnetworks.com)" , Narayana Prasad References: <1535129598-27301-1-git-send-email-konstantin.ananyev@intel.com> <358d1b6c-26f2-b125-07a4-cfb1c0e2a57b@caviumnetworks.com> <2601191342CEEE43887BDE71AB977258EA95089D@irsmsx105.ger.corp.intel.com> <475cf471-b46a-671a-5485-0042c652430c@caviumnetworks.com> <2601191342CEEE43887BDE71AB977258EA954BAD@irsmsx105.ger.corp.intel.com> <2601191342CEEE43887BDE71AB977258EA954E9D@irsmsx105.ger.corp.intel.com> <2601191342CEEE43887BDE71AB977258EA956E8E@irsmsx105.ger.corp.intel.com> From: "Joseph, Anoob" Message-ID: <49d5d008-14d5-0ceb-ad21-d7cd269bbc7b@caviumnetworks.com> Date: Mon, 17 Sep 2018 20:11:31 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <2601191342CEEE43887BDE71AB977258EA956E8E@irsmsx105.ger.corp.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [223.230.22.245] X-ClientProxiedBy: BM1PR0101CA0063.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:19::25) To SN6PR07MB4910.namprd07.prod.outlook.com (2603:10b6:805:39::16) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 91c4cb23-befb-43d3-369a-08d61cab8958 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:SN6PR07MB4910; X-Microsoft-Exchange-Diagnostics: 1; SN6PR07MB4910; 3:2H719+XtJfEC39p2LBaYQpm1i8t9bpi63RlpMbIZXOiXh03B7H/4goVaOnsFhnIGTPCoisyjWh+qQsIoFjKGY5CClu9CvUKPE71ySu1bEwXUHJ8bXVJwansRs/UDDPAwptgKkq2VtCYW4OktXcdZ4dC+kKVZ495rMyrMVcc0fcefSuoDFj6oYSanYhncIU4+xwlksD/CYTfs24vTJmsi7Lq5uOD5vY/s5QyEqacNbgGc+jwYos59EpEgJTkpxknx; 25:EVZzlY8/V4sYYiNPuPMlD4UxE4AlHCPSciYspedPCbvhJORYUyrqncy1o8o2eArBCvpwMM4J2Ox1zuHum2b1VOtsS4hgddSki83gRwcEjxQD5BaVMaCG16QLlQ23FlMWi+Ql9yv1sYpNsJ2gzLyrDRIneD2VUg3pnIzXLOqCv2GtwUHGBDljlwJymUWutYKK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Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(242903309895634)(192374486261705)(131110393319338)(228905959029699); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(3002001)(3231355)(944501410)(52105095)(93006095)(149027)(150027)(6041310)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699050); SRVR:SN6PR07MB4910; BCL:0; PCL:0; RULEID:; SRVR:SN6PR07MB4910; X-Microsoft-Exchange-Diagnostics: 1; SN6PR07MB4910; 4:L4XeHwgUG7YS++Z/Q4esrxdAzxMRoGjWwGW2rh2WFMdExpQM9t/jaBTaJ6XyCTuD4bXZkZyZ8nHnGvhgzvN0pmu6T44cWI/Hp0OCT+j5dnq8lhO4Ou5pMS1DOBgrnwWJBweL3V4vKdfTQHQEU8tsMvIBnwfdwDkpbhun/FCUffX+KsPZXlF+5N4Sg+H1QYViLBWob8MgKTafPw7QWDCVFUh9y2ToL++TsE3d79yd0uJtI8K5RrLRr0bsqKdPKAIU2ecZ9q9wpcIWJINIecNz9FVoBkZRlRtAHv9/yTCxjmoc6TpTcC0yW5ooNE/v0vaHbV4Tdg2weU/m6pZEbeaUSOil5ua5hLROdVzbxGijHTYeqEDWQxXCnWti5ydqaMpkRcvZNEsi4URuebPcifsCPoC83HJU6bKH9P+hFgJtWLE= X-Forefront-PRVS: 0798146F16 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(979002)(6049001)(366004)(376002)(346002)(396003)(39860400002)(136003)(189003)(51444003)(199004)(15404003)(52314003)(57704003)(81156014)(446003)(2616005)(105586002)(8676002)(230700001)(42882007)(36756003)(5024004)(316002)(2501003)(6306002)(81166006)(6116002)(956004)(3846002)(58126008)(476003)(68736007)(65826007)(486006)(54906003)(8936002)(6666003)(16576012)(11346002)(97736004)(93886005)(5660300001)(110136005)(106356001)(31686004)(107886003)(6246003)(14444005)(67846002)(53936002)(25786009)(16526019)(65806001)(65956001)(66066001)(72206003)(478600001)(53546011)(6486002)(305945005)(386003)(64126003)(229853002)(7736002)(50466002)(2486003)(23676004)(76176011)(52116002)(4326008)(31696002)(47776003)(77096007)(2906002)(966005)(117156002)(3260700006)(26005)(52146003)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN6PR07MB4910; H:[192.168.1.9]; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtTTjZQUjA3TUI0OTEwOzIzOkxlaG00MWtEMjdxTlJEQjNOdDFyTnl0eHVq?= =?utf-8?B?ekt0cXlBTm5GSXJsd25Ob0dFZ2pXVEtLeEFhOXZvMU05UWdDWEkyWmFpUld6?= =?utf-8?B?d1R5YkN1SUpXdzVzUHJrU3RjT2lXcERqazdHUlhsS21Nb0MxKzdrcmpmbFBJ?= =?utf-8?B?alVpQndNQ2tpWXJ6aUdxK3RpMkdUaVc0cWo5cGxoOFFmN2NZczBScTBON2R0?= =?utf-8?B?UStGVDRJMGhIdUlZVXFOKyt1TjcwZjVHa3JwZGdXNFRNSzdyQktCcU5SV0RE?= =?utf-8?B?WjUveVMxY00wTFFtblEvQTVZMG4wc042c3ZtNTRydUl5YWxTOWNWZkw1U1N4?= =?utf-8?B?c0ErZjhVUU55Z1FWNFcwU1ZEby9rZ0dBcHc4dStDQTJOakpQVWNITytNanNs?= =?utf-8?B?KzBYY1BlS3gxWEJNUzhsdms1UDg5R0NtTHdSSEZzQWQrQVdmcGh3NzlJM1hs?= =?utf-8?B?R29DMjRhbjdqSktzNHcxMmVrWHNRSXJ0RWlUYVNJMVlrNlNBODc1WVY5V29x?= =?utf-8?B?TjgrdzFEcnRQWkFnWm5zcGQ0cVNPSGNRT0hrM3lJU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h5XENvMxRod9pasbCUng1mvEzBD5Bhdwx383cNUNNolmkjjMWi7geBvkZ09BhCxKdGdGP53apfL+2XqLjfgkbCPOEoHSyFXc=; 7:sisthhGdmKStS6xtbjXW+4tSzozXI5nRl+LbGaGp0DV/8hqWZhITRABkjOA6mQV68KtchwoSlm1ZOaEAVcZvsaWVNAQcxqzmvBcncIMvOvkvpD2HjP7N5KYLV5dWb7+4p0s4LkOnkt593sM9odVqt0AK2GfwI9Svi01icVXtG+oiEyrqe35U/z2NLAXD5ZyL1LfVEjaB8p0n0jkUFXzpwJ+c2iJ+acXnMdYvDJutbtMdiWihndAxOk/D7L7VGtty SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Sep 2018 14:40:36.7498 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 91c4cb23-befb-43d3-369a-08d61cab8958 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR07MB4910 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: Mon, 17 Sep 2018 14:40:42 -0000 Hi Konstantin, On 17-09-2018 16:06, Ananyev, Konstantin wrote: > External Email > > Hi Anoob, > >> Hi Konstantin, >> Please see inline. >> >> >> This RFC introduces a new library within DPDK: librte_ipsec. >> The aim is to provide DPDK native high performance library for IPsec >> data-path processing. >> The library is supposed to utilize existing DPDK crypto-dev and >> security API to provide application with transparent IPsec processing API. >> The library is concentrated on data-path protocols processing (ESP and AH), >> IKE protocol(s) implementation is out of scope for that library. >> Though hook/callback mechanisms will be defined to allow integrate it >> with existing IKE implementations. >> Due to quite complex nature of IPsec protocol suite and variety of user >> requirements and usage scenarios a few API levels will be provided: >> 1) Security Association (SA-level) API >> Operates at SA level, provides functions to: >> - initialize/teardown SA object >> - process inbound/outbound ESP/AH packets associated with the given SA >> (decrypt/encrypt, authenticate, check integrity, >> add/remove ESP/AH related headers and data, etc.). >> 2) Security Association Database (SAD) API >> API to create/manage/destroy IPsec SAD. >> While DPDK IPsec library plans to have its own implementation, >> the intention is to keep it as independent from the other parts >> of IPsec library as possible. >> That is supposed to give users the ability to provide their own >> implementation of the SAD compatible with the other parts of the >> IPsec library. >> 3) IPsec Context (CTX) API >> This is supposed to be a high-level API, where each IPsec CTX is an >> abstraction of 'independent copy of the IPsec stack'. >> CTX owns set of SAs, SADs and assigned to it crypto-dev queues, etc. >> and provides: >> - de-multiplexing stream of inbound packets to particular SAs and >> further IPsec related processing. >> - IPsec related processing for the outbound packets. >> - SA add/delete/update functionality >> [Anoob]: Security Policy is an important aspect of IPsec. An IPsec >> library without Security Policy API would be incomplete. For inline >> protocol offload, the final SP-SA check(selector check) is the only >> IPsec part being done by ipsec-secgw now. Would make sense to add that >> also in the library. >> >> You mean here, that we need some sort of SPD implementation, correct? >> [Anoob] Yes. >> >> Ok, I see. >> Our thought was that just something based on librte_acl would be enough here... >> But if you think that a special defined SPD API (and implementation) is needed - >> we can probably discuss it along with SAD API (#2 above). >> Though if you'd like to start to work on RFC for it right-away - please feel free to do so :) >> >> >> >> >> Current RFC concentrates on SA-level API only (1), >> detailed discussion for 2) and 3) will be subjects for separate RFC(s). >> >> SA (low) level API >> ================== >> >> API described below operates on SA level. >> It provides functionality that allows user for given SA to process >> inbound and outbound IPsec packets. >> To be more specific: >> - for inbound ESP/AH packets perform decryption, authentication, >> integrity checking, remove ESP/AH related headers >> [Anoob] Anti-replay check would also be required. >> >> Yep, anti-replay and ESN support is implied as part of "integrity checking". >> Probably I have to be more specific here. >> [Anoob] This is fine. >> >> >> >> - for outbound packets perform payload encryption, attach ICV, >> update/add IP headers, add ESP/AH headers/trailers, >> setup related mbuf felids (ol_flags, tx_offloads, etc.). >> [Anoob] Do we have any plans to handle ESN expiry? Some means to >> initiate an IKE renegotiation? I'm assuming application won't be aware >> of the sequence numbers, in this case. >> [Anoob] What is your plan with events like ESN expiry? IPsec spec talks about byte and time expiry as well. >> >> At current moment, for SA level: rte_ipsec_crypto_prepare()/rte_ipsec_inline_process() will set rte_errno >> to special value (EOVERFLOW) to signal upper layer that limit is reached. >> Upper layer can decide to start re-negotiation, or just destroy an SA. >> >> Future plans for IPsec Context (CTX) API (#3 above): >> Introduce a special function, something like: >> rte_ipsec_get_expired(rte_ipsec_ctx *ctx, rte_ipsec_sa *expired_sa[], uint32_t num); >> It would return up-to *num* of SAs for given ipsec context, that are expired/limit reached. >> Then upper layer again might decide for each SA should renegotiation be started, >> or just wipe given SA. >> It would be upper layer responsibility to call this function periodically. >> >> >> >> - initialize/un-initialize given SA based on user provided parameters. >> >> Processed inbound/outbound packets could be grouped by user provided >> flow id (opaque 64-bit number associated by user with given SA). >> >> SA-level API is based on top of crypto-dev/security API and relies on them >> to perform actual cipher and integrity checking. >> Due to the nature of crypto-dev API (enqueue/deque model) we use >> asynchronous API for IPsec packets destined to be processed >> by crypto-device: >> rte_ipsec_crypto_prepare()->rte_cryptodev_enqueue_burst()-> >> rte_cryptodev_dequeue_burst()->rte_ipsec_crypto_process(). >> Though for packets destined for inline processing no extra overhead >> is required and simple and synchronous API: rte_ipsec_inline_process() >> is introduced for that case. >> [Anoob] The API should include event-delivery as a crypto-op completion >> mechanism as well. The application could configure the event crypto >> adapter and then enqueue and dequeue to crypto device using events (via >> event dev). >> >> Not sure what particular extra API you think is required here? >> As I understand in both cases (with or without event crypto-adapter) we still have to: >> 1) fill crypto-op properly >> 2) enqueue it to crypto-dev (via eventdev or directly) >> 3) receive processed by crypto-dev crypto-op (either via eventdev or directly) >> 4) check crypto-op status, do further post-processing if any >> >> So #1 and #4 (SA-level API respnibility) remain the same for both cases. >> [Anoob] rte_ipsec_inline_process works on packets not events. We might need a similar API which processes events. >> >> Ok, I still don't get you here. >> Could you specify what exactly function you'd like to add to the API here with parameter list >> and brief behavior description? >> >> >> The following functionality: >> - match inbound/outbound packets to particular SA >> - manage crypto/security devices >> - provide SAD/SPD related functionality >> - determine what crypto/security device has to be used >> for given packet(s) >> is out of scope for SA-level API. >> >> Below is the brief (and simplified) overview of expected SA-level >> API usage. >> >> /* allocate and initialize SA */ >> size_t sz = rte_ipsec_sa_size(); >> struct rte_ipsec_sa *sa = rte_malloc(sz); >> struct rte_ipsec_sa_prm prm; >> /* fill prm */ >> rc = rte_ipsec_sa_init(sa, &prm); >> if (rc != 0) { /*handle error */} >> ..... >> >> /* process inbound/outbound IPsec packets that belongs to given SA */ >> >> /* inline IPsec processing was done for these packets */ >> if (use_inline_ipsec) >> n = rte_ipsec_inline_process(sa, pkts, nb_pkts); >> /* use crypto-device to process the packets */ >> else { >> struct rte_crypto_op *cop[nb_pkts]; >> struct rte_ipsec_group grp[nb_pkts]; >> >> .... >> /* prepare crypto ops */ >> n = rte_ipsec_crypto_prepare(sa, pkts, cops, nb_pkts); >> /* enqueue crypto ops to related crypto-dev */ >> n = rte_cryptodev_enqueue_burst(..., cops, n); >> if (n != nb_pkts) { /*handle failed packets */} >> /* dequeue finished crypto ops from related crypto-dev */ >> n = rte_cryptodev_dequeue_burst(..., cops, nb_pkts); >> /* finish IPsec processing for associated packets */ >> n = rte_ipsec_crypto_process(cop, pkts, grp, n); >> [Anoob] Does the SA based grouping apply to both inbound and outbound? >> >> Yes, the plan is to have it available for both cases. >> [Anoob] On the inbound, shouldn't the packets be grouped+ordered based on inner L3+inner L4? >> >> I think that's up to the user decide based on what criteria wants to group it and does he wants >> to do any grouping at all. >> That's why flowid is user-defined and totally transparent to the lib. >> >> >> >> >> /* now we have group of packets grouped by SA flow id */ >> .... >> } >> ... >> >> /* uninit given SA */ >> rte_ipsec_sa_fini(sa); >> >> Planned scope for 18.11: >> ======================== >> >> - SA-level API definition >> - ESP tunnel mode support (both IPv4/IPv6) >> - Supported algorithms: AES-CBC, AES-GCM, HMAC-SHA1, NULL. >> - UT >> [Anoob] What is UT? >> >> Unit-Test >> >> >> Note: Still WIP, so not all planned for 18.11 functionality is in place. >> >> Post 18.11: >> =========== >> - ESP transport mode support (both IPv4/IPv6) >> - update examples/ipsec-secgw to use librte_ipsec >> - SAD and high-level API definition and implementation >> >> >> Signed-off-by: Mohammad Abdul Awal >> Signed-off-by: Declan Doherty >> Signed-off-by: Konstantin Ananyev >> --- >> config/common_base | 5 + >> lib/Makefile | 2 + >> lib/librte_ipsec/Makefile | 24 + >> lib/librte_ipsec/meson.build | 10 + >> lib/librte_ipsec/pad.h | 45 ++ >> lib/librte_ipsec/rte_ipsec.h | 245 +++++++++ >> lib/librte_ipsec/rte_ipsec_version.map | 13 + >> lib/librte_ipsec/sa.c | 921 +++++++++++++++++++++++++++++++++ >> lib/librte_net/rte_esp.h | 10 +- >> lib/meson.build | 2 + >> mk/rte.app.mk | 2 + >> 11 files changed, 1278 insertions(+), 1 deletion(-) >> create mode 100644 lib/librte_ipsec/Makefile >> create mode 100644 lib/librte_ipsec/meson.build >> create mode 100644 lib/librte_ipsec/pad.h >> create mode 100644 lib/librte_ipsec/rte_ipsec.h >> create mode 100644 lib/librte_ipsec/rte_ipsec_version.map >> create mode 100644 lib/librte_ipsec/sa.c >> >> +static inline uint16_t >> +esp_outb_tun_prepare(struct rte_ipsec_sa *sa, struct rte_mbuf *mb[], >> + struct rte_crypto_op *cop[], uint16_t num) >> +{ >> + int32_t rc; >> + uint32_t i, n; >> + union sym_op_data icv; >> + >> + n = esn_outb_check_sqn(sa, num); >> + >> + for (i = 0; i != n; i++) { >> + >> + sa->sqn++; >> [Anoob] Shouldn't this be done atomically? >> >> If we want to have MT-safe API for SA-datapath API, then yes. >> Though it would make things more complicated here, especially for inbound with anti-replay support. >> I think it is doable (spin-lock?), but would cause extra overhead and complexity. >> Right now I am not sure it really worth it - comments/suggestions are welcome. >> What probably could be a good compromise - runtime decision per SA basis (at sa_init()), >> do we need an ST or MT behavior for given SA. >> [Anoob] Going with single thread approach would significantly limit the scope of this library. Single thread approach would mean >> one SA on one core. This would not work on practical cases. >> Suppose we have two flows which are supposed to use the same SA. With RSS, these flows could end up on different cores. Now >> only one core would be able to process, as SA will not be shared. We have the same problem in ipsec-secgw too. >> >> Just for my curiosity - how do you plan to use RSS for ipsec packet distribution? >> Do you foresee a common situation when there would be packets that belongs to the same SA >> (same SPI) but with multiple source(destination) IP addresses? >> If so, probably some examples would be helpful. >> I think IPsec RFCs doesn't prevent such situation, but AFAIK the most common case - single source/destination IPs for the same SPI. >> >> sp ipv4 out esp protect 6 pri 1 dst 192.168.1.0/24 sport 0:65535 dport 0:65535 >> sp ipv4 out esp protect 6 pri 1 dst 192.168.2.0/24 sport 0:65535 dport 0:65535 >> sa out 6 cipher_algo aes-128-cbc cipher_key 22:33:44:55:66:77:88:99:aa:bb:cc:dd:ee:ff:00:11 auth_algo sha1-hmac auth_key >> 22:33:44:55:66:77:88:99:aa:bb:cc:dd:ee:ff:00:11:22:33:44:55 mode ipv4-tunnel src 172.16.2.1 dst 172.16.1.1 >> Isn't this a valid configuration? Wouldn't this be a common use case when we have site-to-site tunneling? >> https://tools.ietf.org/html/rfc4301#section-4.4.1.1 > Ok, I think I understand what was my confusion here - above you talked about using RSS to distribute incoming *outbound* traffic, correct? > If so, then yes I think such scheme would work without problems. > My original thought was that we are talking about inbound traffic distribution here - in that case standard RSS wouldn't help much. Agreed. RSS won't be of much use in that case (inbound). But fat flow hitting one core would be a problem which we should solve. RSS will help in solving the same problem with outbound, to an extent. >> Anyway, let's pretend we found some smart way to distribute inbound packets for the same SA to multiple HW queues/CPU cores. >> To make ipsec processing for such case to work correctly just atomicity on check/update segn/replay_window is not enough. >> I think it would require some extra synchronization: >> make sure that we do final packet processing (seq check/update) at the same order as we received the packets >> (packets entered ipsec processing). >> I don't really like to introduce such heavy mechanisms on SA level, after all it supposed to be light and simple. >> Though we plan CTX level API to support such scenario. >> What I think would be useful addition for SA level API - have an ability to do one update seqn/replay_window and multiple checks >> concurrently. >> >> In case of ingress also, the same problem exists. We will not be able to use RSS and spread the traffic to multiple cores. Considering >> IPsec being CPU intensive, this would limit the net output of the chip. >> >> That's true - but from other side implementation can offload heavy part >> (encrypt/decrypt, auth) to special HW (cryptodev). >> In that case single core might be enough for SA and extra synchronization would just slowdown things. >> That's why I think it should be configurable what behavior (ST or MT) to use. >> I do agree that these are the issues that we need to address to make the library MT safe. Whether the extra synchronization would >> slow down things is a very subjective question and will heavily depend on the platform. The library should have enough provisions >> to be able to support MT without causing overheads to ST. Right now, the library assumes ST. > Ok, I suppose we both agree that we need ST and MT case supported. > I didn't want to introduce MT related code right now (for 18.11), but as you guys seems very concerned about it, > we will try to add MT related stuff into v1, so you can review it at early stages. > Konstantin Glad that we are on the same page. As you had pointed out, MT is not just about adding some locks. It's more complicated than that. And again for solving it, there could be multiple ways. Using locks and software queues etc would definitely be one way. But that's not the only solution. As Jerin had pointed out, there are parts in IPsec flow which can be offloaded to hardware. http://mails.dpdk.org/archives/dev/2018-September/111770.html Can you share your thoughts on the above approach? Anoob