From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0073.outbound.protection.outlook.com [104.47.42.73]) by dpdk.org (Postfix) with ESMTP id 11534293B for ; Tue, 12 Dec 2017 14:51:09 +0100 (CET) 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; bh=ZAab5HCrnDRABo67KvRjXaqyFj4mxfERrIPLcbp1Ciw=; b=k16JQIVSp5/QKM2d2Ss+Lt+ydIg1Ppz8Wtka4vfqkxUD2fx8Tn7rMz9bUD+Kf6JAPTa2ZVWe6I5No2XogPj9AmuzhV7GQy21f3SdD4fc523WWScqG7banU/TEX4N4SbM7Bqiaefy1usmWlyHUfyjLGjjLNU7jRWbc0LaUgrydxk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Anoob.Joseph@cavium.com; Received: from hyd1ajoseph-dt.caveonetworks.com (115.113.156.2) by SN4PR0701MB3646.namprd07.prod.outlook.com (2603:10b6:803:4d::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Tue, 12 Dec 2017 13:51:04 +0000 Cc: anoob.joseph@caviumnetworks.com, Jerin Jacob , Narayana Prasad , dev@dpdk.org To: Akhil Goyal , Radu Nicolau , Declan Doherty , Sergio Gonzalez Monroy References: <1511333716-11955-1-git-send-email-anoob.joseph@caviumnetworks.com> <1511435969-5887-1-git-send-email-anoob.joseph@caviumnetworks.com> <1511435969-5887-2-git-send-email-anoob.joseph@caviumnetworks.com> <414c3491-7a54-09b4-0cde-a21bffaeb1ab@intel.com> <94ae34d4-b34a-22a1-e787-e2dcdffc8575@nxp.com> <63e76b4d-3e6a-bd74-3ad8-72fcacef0fcb@nxp.com> <45060b96-9b19-fe62-7653-5ad734188c93@intel.com> <7f193513-bfdb-81dc-48b4-ee844928745d@nxp.com> <9603b9ad-1aa2-a724-7dd7-4e8d2fb05f33@caviumnetworks.com> <40eaebc2-8472-f904-07f2-19325c12f3c8@intel.com> From: Anoob Joseph Message-ID: <5f2245e3-72ea-e529-1620-a0d96fd0c675@caviumnetworks.com> Date: Tue, 12 Dec 2017 19:20:58 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Originating-IP: [115.113.156.2] X-ClientProxiedBy: CY4PR1101CA0013.namprd11.prod.outlook.com (2603:10b6:910:15::23) To SN4PR0701MB3646.namprd07.prod.outlook.com (2603:10b6:803:4d::12) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8b99c388-0d5f-4bef-3400-08d5416764ce X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(7168020)(4627115)(201703031133081)(201702281549075)(2017052603307); SRVR:SN4PR0701MB3646; X-Microsoft-Exchange-Diagnostics: 1; SN4PR0701MB3646; 3:oVwIOCFDhDrWswjorIAPS+9QJAsle4cUOCiehQG8JS1Ra9kFz9IPdCt217jUTzf87otoMtH+K5HeerXB0eEIN9pSRo54FI9SLQt9Zdsj1fJdiNKumOs4/F172UzT6C4crsYk8F3GC94MiBe/vP7VpVgEdJsk3jxm34G7RDbaayqRmonipIg5ntss6WWrHUj0LJUruxGc1aWV1Z6VsBSKaLrA9F1Zdj6v5CmfjjGXMb8LS+qW/GJeaM9tXcvi+8I4; 25:GHeyVjMpOcNr+0S6++3ZrUA44Emx7amcECk9A0d7dZjTNdEj0MmYBB2rJKez3u30HpdkpzxVxSkyomhoJGDH1xdSPVaa+lUXEdltmMP9gMyo2tSjZqMOkKznX23mDV3Oq18WuCVcdvFKC+jucoB6fxspohM3npmSp8A8jKZE0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o1/HM4QcIFBF9AHt+kEmSaq2R9vosaKNbbK6eCC11Oz/W22uA= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(244540007438412)(192374486261705); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(8121501046)(5005006)(10201501046)(93006095)(3002001)(3231023)(6041248)(20161123564025)(20161123558100)(20161123562025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(6072148)(201708071742011); SRVR:SN4PR0701MB3646; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:SN4PR0701MB3646; X-Microsoft-Exchange-Diagnostics: 1; SN4PR0701MB3646; 4:KmUeRBrOPQE6b3G5XOLS4UHpkoszxVQwuPkpv7T8CsegBOPchg4k+mEJ13fXx4OxVT0yFdd8HEkJzt8AcSUy/j/T3GNW/C5He7mQRm2Znphw+KLsicPoeoaF+7EpmAAsPpKm3lbIK1GzwGPBSeaF8e1L7VHlxUD1Q3MuDeD88amrC4NoGq+eANltVndMhFq0oECBc+F9dikIiLxmtNzQ/JKUv+it0H4OFUBAnZeQ+tAg21W6+gjUaA6h4gmHox8MNYmgy3bVx/c+O1+9eykvN9XZ0lpAPHte1IPmO3C9PiQGlt7hyyPg8KsNyt69PcJTqc1bSZidfowvHu+pQKvHkrKLMuDsuigbztLQKWdnsZ4= X-Forefront-PRVS: 051900244E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(346002)(366004)(24454002)(199004)(189003)(57704003)(5660300001)(53546010)(31686004)(59450400001)(23676004)(2870700001)(83506002)(2486003)(53936002)(52146003)(67846002)(8656006)(6246003)(65826007)(42882006)(31696002)(2906002)(6512007)(6666003)(72206003)(64126003)(305945005)(69596002)(68736007)(50466002)(2950100002)(3846002)(54906003)(229853002)(36756003)(106356001)(110136005)(58126008)(7736002)(76176011)(6486002)(6116002)(16526018)(8936002)(15650500001)(478600001)(55236003)(52116002)(6506006)(66066001)(65956001)(47776003)(316002)(53416004)(97736004)(93886005)(8676002)(81156014)(4326008)(81166006)(25786009)(65806001)(105586002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN4PR0701MB3646; H:hyd1ajoseph-dt.caveonetworks.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtTTjRQUjA3MDFNQjM2NDY7MjM6T0prT01BRzIzRDZERG1HakFCNjViM1dL?= =?utf-8?B?RjFqYzNLODhyQWhTSFFDcmdwd0xXR1JoL1MvUEFYUDlIVW0vaUxSRmhIcWd5?= =?utf-8?B?Zm9qbHNIbGNVSDlGK3pNUk1MemJhcU5SUTJrL2prREdhMlVuY05rM3ZtQ25u?= =?utf-8?B?SGxSSjRwa3JqSVAreFFIWDBjL0E1T1h4cWhodXRFQkdEdTlKdmp4QkV5M1JR?= =?utf-8?B?cytId0gwMFZBamVLZmtMNkRzOWJCRlI5SlJ2aU82TVNaUjZxWmxESXU5OUw1?= =?utf-8?B?RU91ZFVwUS9RZ2piNFVzZkhJaWMyMCtaSUpMT2hmRFEvcElrSWJFd01iWEU3?= =?utf-8?B?MDVWQThSMGhZemw5aWhMK2hvMk4xUy9jdzJ6UVdHNHNRS2JsSmNGTHZIclMx?= =?utf-8?B?Zi85ZGY3REhTYW9TRWpBY290SEJRQjBXYjZpcjZaR0hYVDdRWTlQVGhRa0NP?= =?utf-8?B?VGN2K1V3QnZBMWUvN011V3BlVnlxTCtJTUhETmxnUGNRYi8xalpEVkdjNjI3?= =?utf-8?B?OGltVUl3K0lvNWtQZGRoenlOMHdQQVZLcUxJS0RXRmRVRlhxNy90M3BFUTk4?= =?utf-8?B?S2ZXc3RXd1lGbTlBcm92QVBVblQ4MXZ5QXVYRzFnVHJERGN3a0IvN3d2R0J6?= =?utf-8?B?am9ISm5velAycktYa0NUd1FRTkFjbDB5ak5VZkpvUDlVai91aG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Rvj6XDDA5KY=; 24:CCul4da3jT7znyJScW5Xu4aYhrHAZaGSQLjla2hd8VJ3zzGvGnC9DbrdhO0v6mMPsaf7f94Qs0i77DOdC2EuedsZjrvpyhpOfwTFg2KkYgc=; 7:qSy5d5ParmIEqi8x0Z6oblKqXjOO1+gvd93Wy4nq60mqrlj0T/dxN9uPFmGUX5XWdNGvQkmJa4FU4cxEYNcCn9SI1ta1RmdDgR0W9/MCE9WcwzrBY5AybTInpCKAIzFVwLA+3xiV/0ZvZnMQ7jValB70HuyAOoWpKMH0y1Nwyl0+BgxWFjZAuqXQJS4VVXYy5rVl/sGKXf9zs42G1H/gDBUXOQo64ZF9TWYMlNMjHUUPVDNDzWptw3gLTj+nOUuX SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2017 13:51:04.4277 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8b99c388-0d5f-4bef-3400-08d5416764ce X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR0701MB3646 Subject: Re: [dpdk-dev] [PATCH v3 1/2] lib/security: add support for get metadata 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, 12 Dec 2017 13:51:10 -0000 Hi Akhil, Radu On 12/12/2017 02:25 PM, Akhil Goyal wrote: > Hi Anoob, > > On 12/11/2017 12:51 PM, Anoob wrote: >> Hi Akhil, >> >> Can you confirm if you are fine with the approach explained inline. >> >> Thanks, >> Anoob >> >> On 12/06/2017 03:13 PM, Radu Nicolau wrote: >>> Hi, >>> >>> >>> On 12/6/2017 7:30 AM, Anoob wrote: >>>> Hi Akhil, Radu, >>>> >>>> Please see inline. >>>> >>>> Thanks, >>>> >>>> Anoob >>>> >>>> >>>> On 11/24/2017 05:33 PM, Akhil Goyal wrote: >>>>> On 11/24/2017 5:29 PM, Radu Nicolau wrote: >>>>>> >>>>>> >>>>>> On 11/24/2017 11:34 AM, Akhil Goyal wrote: >>>>>>> Hi Radu, >>>>>>> On 11/24/2017 4:47 PM, Radu Nicolau wrote: >>>>>>>> >>>>>>>> >>>>>>>> On 11/24/2017 10:55 AM, Akhil Goyal wrote: >>>>>>>>> On 11/24/2017 3:09 PM, Radu Nicolau wrote: >>>>>>>>>> Hi, >>>>>>>>>> >>>>>>>>>> Comment inline >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> On 11/24/2017 8:50 AM, Akhil Goyal wrote: >>>>>>>>>>> Hi Anoob, Radu, >>>>>>>>>>> On 11/23/2017 4:49 PM, Anoob Joseph wrote: >>>>>>>>>>>> In case of inline protocol processed ingress traffic, the >>>>>>>>>>>> packet may not >>>>>>>>>>>> have enough information to determine the security >>>>>>>>>>>> parameters with which >>>>>>>>>>>> the packet was processed. In such cases, application could >>>>>>>>>>>> get metadata >>>>>>>>>>>> from the packet which could be used to identify the >>>>>>>>>>>> security parameters >>>>>>>>>>>> with which the packet was processed. >>>>>>>>>>>> >>>>>>>>>>>> Signed-off-by: Anoob Joseph >>>>>>>>>>>> --- >>>>>>>>>>>> v3: >>>>>>>>>>>> * Replaced 64 bit metadata in conf with (void *)userdata >>>>>>>>>>>> * The API(rte_security_get_pkt_metadata) would return void >>>>>>>>>>>> * instead of >>>>>>>>>>>>    uint64_t >>>>>>>>>>>> >>>>>>>>>>>> v2: >>>>>>>>>>>> * Replaced get_session and get_cookie APIs with >>>>>>>>>>>> get_pkt_metadata API >>>>>>>>>>>> >>>>>>>>>>>>   lib/librte_security/rte_security.c | 13 +++++++++++++ >>>>>>>>>>>>   lib/librte_security/rte_security.h | 19 +++++++++++++++++++ >>>>>>>>>>>>   lib/librte_security/rte_security_driver.h | 16 >>>>>>>>>>>> ++++++++++++++++ >>>>>>>>>>>>   3 files changed, 48 insertions(+) >>>>>>>>>>>> >>>>>>>>>>>> diff --git a/lib/librte_security/rte_security.c >>>>>>>>>>>> b/lib/librte_security/rte_security.c >>>>>>>>>>>> index 1227fca..a1d78b6 100644 >>>>>>>>>>>> --- a/lib/librte_security/rte_security.c >>>>>>>>>>>> +++ b/lib/librte_security/rte_security.c >>>>>>>>>>>> @@ -108,6 +108,19 @@ rte_security_set_pkt_metadata(struct >>>>>>>>>>>> rte_security_ctx *instance, >>>>>>>>>>>>                              sess, m, params); >>>>>>>>>>>>   } >>>>>>>>>>>>   +void * >>>>>>>>>>>> +rte_security_get_pkt_metadata(struct rte_security_ctx >>>>>>>>>>>> *instance, >>>>>>>>>>>> +                  struct rte_mbuf *pkt) >>>>>>>>>>> Can we rename pkt with m. Just to make it consistent with >>>>>>>>>>> the set API. >>>>>>>>>>>> +{ >>>>>>>>>>>> +    void *md = NULL; >>>>>>>>>>>> + >>>>>>>>>>>> + RTE_FUNC_PTR_OR_ERR_RET(*instance->ops->get_pkt_metadata, >>>>>>>>>>>> NULL); >>>>>>>>>>>> +    if (instance->ops->get_pkt_metadata(instance->device, >>>>>>>>>>>> pkt, &md)) >>>>>>>>>>>> +        return NULL; >>>>>>>>>>>> + >>>>>>>>>>>> +    return md; >>>>>>>>>>>> +} >>>>>>>>>>> >>>>>>>>>>> Pkt metadata should be set by user i.e. the application, and >>>>>>>>>>> the driver need not be aware of the format and the values of >>>>>>>>>>> the metadata. >>>>>>>>>>> So setting the metadata in the driver and getting it back >>>>>>>>>>> from the driver does not look a good idea. >>>>>>>>>>> >>>>>>>>>>> Is it possible, that the application define the metadata on >>>>>>>>>>> its own and set it in the library itself without the call to >>>>>>>>>>> the driver ops. >>>>>>>>>> I'm not sure I understand here; even in our case (ixgbe) the >>>>>>>>>> driver sets the metadata and it is aware of the format - that >>>>>>>>>> is the whole idea. This is why we added the set_metadata API, >>>>>>>>>> to allow the driver to inject extra information into the >>>>>>>>>> mbuf, information that is driver specific and derived from >>>>>>>>>> the security session, so it makes sense to also have a >>>>>>>>>> symmetric get_metadata. >>>>>>>>>> Private data is the one that follows those rules, i.e. >>>>>>>>>> application specific and driver transparent. >>>>>>>>> >>>>>>>>> As per my understanding of the user metadata, it should be in >>>>>>>>> control of the application, and the application shall know the >>>>>>>>> format of that. Setting in driver will disallow this. >>>>>>>>> Please let me know if my understanding is incorrect. >>>>>>>>> >>>>>>>>> If at all, some information is needed to be set on the basis >>>>>>>>> of driver, then application can get that information from the >>>>>>>>> driver and then set it in the packet metadata in its own >>>>>>>>> way/format. >>>>>>>> >>>>>>>> The rte_security_set_pkt_metadata() doc defines the metadata as >>>>>>>> "device-specific defined metadata" and also takes a device >>>>>>>> specific params pointer, so the symmetric function is to be >>>>>>>> expected to work in the same way, i.e. return device specific >>>>>>>> metadata associated with the security session and instance and >>>>>>>> mbuf. How is this metadata stored is not specified in the >>>>>>>> security API, so the PMD implementation have the flexibility. >>>> Is rte_security_get_pkt_metadata() expected to return a "device >>>> specific" pointer? If that's the case, we would need another call >>>> (something like, rte_security_get_userdata()) to get back the >>>> userdata, right? Or is it fine, if the application assumes it will >>>> get userdata (the one passed in conf while creating security >>>> session) with rte_security_get_pkt_metadata()? >>> Yes, this will be my assumption, a "device specific" pointer >>> (similar to the "void *params" parameter of the >>> rte_security_set_pkt_metadata function), which will contain an >>> arbitrary defined structure that will be decoded by calling a PMD >>> defined function. >>> But I think Akhil has a different view on this. > I am ok with the approach, if we are adding this as a limitation of > using udata in the documentation for inline cases. > > The ideal approach should be such that driver should not be knowing > the content of the udata. But, if we cannot do away with it, we can > mention it in the documentation. Will document the limitation of udata64's usage. Since we are documenting that udata64 will have some device defined metadata, do we need another API call for getting the "metadata" (rte_security_get_pkt_metadata). The driver can set this metadata in udata64 field, and in ingress, the userdata could be obtained with a single API call (rte_security_get_userdata(*instance, udata64)). The application will be aware that the udata64 in the mbuf will be the metadata from the receive side, and userdata can be retrieved only with that. If application need to use the udata64 field, it should save this rx metadata. Userdata can be obtained anytime by passing this metadata to the driver. To summarize, 1) udata64 of the ingress traffic will be device-specific metadata (documentation change) 2) Pass this field to rte_security_get_userdata() to get back the application registered pointer. Is this fine? > >>>>>>>> >>>>>>> >>>>>>> Yes it was defined that way and I did not noticed this one at >>>>>>> the time of it's implementation. >>>>>>> Here, my point is that the application may be using mbuf udata >>>>>>> for it's own functionality, it should not be modified in the >>>>>>> driver. >>>>>>> >>>>>>> However, if we need to do this, then we may need to clarify in >>>>>>> the documentation that for security, udata shall be set with the >>>>>>> rte_security_set_pkt_metadata() and not otherwise. >>>>>> Indeed, we should update the doc stating that the set_metadata >>>>>> may change the mbuf userdata field so the application should use >>>>>> only private data if needed. >>>>> >>>>> Agreed, but it is dependent on which driver/mode(inline or >>>>> lookaside), it will be used. >>>>> Lookaside may not need this API as of now. Other implementations >>>>> may also don't require. So this shall be documented that way. >>>>> >>>>> -Akhil >>>>> >>>> >>> >> >> >