From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0050.outbound.protection.outlook.com [104.47.42.50]) by dpdk.org (Postfix) with ESMTP id 97C122BF5 for ; Fri, 24 Nov 2017 12:34:37 +0100 (CET) Received: from CY1PR03CA0028.namprd03.prod.outlook.com (10.174.128.38) by MWHPR03MB2703.namprd03.prod.outlook.com (10.168.207.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.260.4; Fri, 24 Nov 2017 11:34:36 +0000 Received: from BL2FFO11FD031.protection.gbl (2a01:111:f400:7c09::162) by CY1PR03CA0028.outlook.office365.com (2603:10b6:600::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.260.4 via Frontend Transport; Fri, 24 Nov 2017 11:34:35 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BL2FFO11FD031.mail.protection.outlook.com (10.173.160.71) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.218.12 via Frontend Transport; Fri, 24 Nov 2017 11:34:34 +0000 Received: from [10.232.134.49] ([10.232.134.49]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id vAOBYVar011686; Fri, 24 Nov 2017 04:34:31 -0700 To: Radu Nicolau , Anoob Joseph , Declan Doherty , Sergio Gonzalez Monroy CC: Jerin Jacob , Narayana Prasad , 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> From: Akhil Goyal Message-ID: <63e76b4d-3e6a-bd74-3ad8-72fcacef0fcb@nxp.com> Date: Fri, 24 Nov 2017 17:04:30 +0530 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-Matching-Connectors: 131559968752559834; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(39860400002)(346002)(39380400002)(376002)(2980300002)(1109001)(1110001)(3190300001)(339900001)(24454002)(189002)(199003)(6246003)(86362001)(65956001)(4326008)(5660300001)(498600001)(36756003)(65806001)(53936002)(93886005)(110136005)(54906003)(58126008)(31696002)(105606002)(106466001)(2486003)(23676004)(189998001)(2950100002)(104016004)(64126003)(50466002)(229853002)(47776003)(65826007)(305945005)(50986999)(67846002)(77096006)(316002)(8936002)(54356999)(356003)(76176999)(81156014)(8676002)(33646002)(81166006)(85426001)(2906002)(31686004)(68736007)(15650500001)(97736004)(53546010)(83506002)(2870700001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR03MB2703; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD031; 1:YmhFHNz3ygIXjfnmnouVqMYyGs8KwuG/GFz57hbMMpTcvHYdYFkVhRfN+/QDCK4dvktn0WD766fQprGjFuGBTdvJbNXr4VL/QsAsNyDrwr7jMJTrjjv/pwYo2011mJ1x X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(2017052603199); SRVR:MWHPR03MB2703; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2703; 3:XptGgYobp8YynPre816Qioj3ChMOp4Lmxkl8aiRKfsfQinTAyUxjCMbDGQsQy/ZVobCXZn5HifxB9XgS8GIheE9v0rNIOkGn7+2KpBP4LwhpKj+I9BA2Hkm/g7bhAi+BDwW1xmPJdtPLSUYrRLcd4fmBmJ9+g9/sKq5uqclrQuBwcn9/SASEzkO59w3OstGH7SWLwhQXpLvM9aO3YZQJRIC8up8Ro8wIUfqdkCTRuAxfdYz4868q8JnfzffXKi3mvqRT/BoW/r+jvoCyc3KUGikbmxDuuGhr+cCWxmE8NCdnfhx1QqWWg6jGiK1/g9NmCrAw1VUI/M2BpTS1wlGePd2Lm1rGD6tEgBUKz6i4uXM=; 25:CpI+YTZWWDDUkuTqQ345HobPMucL6cEyg08DIlTAYL02njReWeOhNHR+AefUK6p1dD/GNzlGYh5caoIjRjYTT1d3cn1uKSQLEj4c1Kuf++l23kwMv4tIeSMZc458aeCkzuoEGQkWGm68+7UPA0GqzZtARuCxqGXK2DKL36AGydn6Fbm/GSQexhFPbaDmDsIodZ6KAF3BfVv2FpyM4LpaWb2Gz6m9soxSPw2wBy/G4II9XHVBw7cogUyJg2QaEpCZnlR5pGAcmBoB0zDUrdFi28NScnSWY0EmsQqCNVSW3GhO4hi4sgmVm88+H5eW0uPj31gyznKw0SksVeL+P5bYvQ== X-MS-TrafficTypeDiagnostic: MWHPR03MB2703: X-MS-Office365-Filtering-Correlation-Id: d70bdf59-e7d4-426d-fa71-08d5332f5689 X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2703; 31:AhtJB8a9UPSzZDOwbI6/cNT+FG8kzO+HO0mloynopm7qi3ouyP59F2QuFSI6iaKMWrEcRufCHT/+SStkX8/nIv67FPiCO8JxoeDLsPCT6CkZ2x9v+xGZfbyT3HhEcmmICzptPjEGuNlHs4hqPUxaRDtYVWmLfT/Ofb6xXVYFCMLxbmtLcQB2omVigjA6jmnvDV4pCcfq68ycFPaTiAa31g8VW85sJOngYHRF/u4CEyU=; 4:t59UKZ7h3SaqFKiXc1RmYN6YxPHrfhryAPBuwMiWbh815Jq4G1U14F9fvHwej+DXNqNfVinWnaruHFXa5fJQOPo01aAYjYq+5Pt3VOhiEhZGDz8z5SHiegwWZO2wyBbHT26lSm4HER3e/EiDjVPrZ8yxNlIEhQNPzeP5s4OKb+A4PdjbfG5HE1i5LHTH/6JG6LmuxZ/xjGClUjnHYFVLh31nZ+hxhUXBnCuXmYryP1CYYZ1ZgYb6uoW2PmB8RsdtkGQb9cZ8VJpd5f+V9uDS1atT4wt9gqltEozVUnb6OrwjBZukAnjNQE+3FRBHcDa1 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192374486261705); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93001095)(3231022)(6055026)(6096035)(20161123565025)(20161123556025)(20161123561025)(20161123563025)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123559100)(201708071742011); SRVR:MWHPR03MB2703; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:MWHPR03MB2703; X-Forefront-PRVS: 05015EB482 X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtNV0hQUjAzTUIyNzAzOzIzOmtXYUZneHJoc25RU05BV0FobC9tUHBJKzQ0?= =?utf-8?B?NHUwYUh1blp0aktablA3T1ZVLy96VVJKWEhnRkl3RGZBazdGZjhEb01wSDhN?= =?utf-8?B?UmlDR3p1UmVGNWJNUGs1ajB6T0N0L28zWnRVZzM1MTFncW1JVTMyWXhzRXlm?= =?utf-8?B?bm53bDJveVBDMWRGdHdlYXdFZjQyU2R2b1hsUTBHZjR1S1dQNGJZQS9CUURE?= =?utf-8?B?Q2tleDZYYThnU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QWPKNtYVFGtDJ6DEmxC1uuPYgMg+pWS0xOMmVZSUody8TZtaMklhLWSNDnz0/6uETigWohG951CQNrSYZSLiUFDy634flREXyjtPcRY9eUosshcIFx9Ar3rLXDvflxgwtJC4d4i3kyWXyEsJ6cRf9B1DM5Cd005Au2U2mhlmwEaaN9u2NbtEdGUERBkPQDJsfiNCWOGKDs0RI6+ZI+UApD7qaIaIkJhRWl+ljoYAG4DNOMBVHlUOO4cly9rWJzoRd4bw84EV4aYOecNTzAbKaQJbwqSkbSIUD9Bztviko9vkT97mH376uvhhFMW1g=; 5:jLQ/vtlZL12aLAv5GQ1CTaQhxz7S9zp5dh6zm3+YSI3AWViBivPTo2JYon1FjfzyEUJcPbJj0EJ6OBGlMtW5Uu5BQDULiQ26AdtEHStW0jjix7+PUpxdRs61kO960jpr+hTNj6HaeW5Sg2tKDRkjd5R/Zv0NZaa5OFsJCbTeTp4=; 24:ajJUXa9q615YaRiaBGcOKiMviUKhBpAVD5sbtYsM6dFxSu0Ywo2kpF6pqfdKSZEhgXoiZI2O/qSvq18gRtANl8F4xCsL7E0PKXVWGEX9Etk=; 7:4Qom++p5Dy2+JXyaCu0f6x0bOBeF8klgtme6XlCa2o2ib7A/1RxLAVcOJbmgf+2HNcAYHuqg3/hVYHRPV34WcR0xOrl4L9q0L/HJM7Bv1aonGv5sI5T4YwRnJSScEpziEmoi5hfva60mFzpbFaX0PpazN+XaOSMyXufkYV8zUYblWWkpJtiiQqRhxJNmHIgfV/j35jRLZhNYMGg5BVMqMppSZZFzLRHVnQj5AlaUJZCFpLCnxr9M6ovBh/Y4LeiB SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Nov 2017 11:34:34.9127 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d70bdf59-e7d4-426d-fa71-08d5332f5689 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR03MB2703 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: Fri, 24 Nov 2017 11:34:38 -0000 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. > 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. -Akhil