From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0073.outbound.protection.outlook.com [104.47.40.73]) by dpdk.org (Postfix) with ESMTP id 14CA2235 for ; Fri, 24 Nov 2017 11:55:35 +0100 (CET) Received: from BN6PR03CA0094.namprd03.prod.outlook.com (10.164.122.160) by DM5PR03MB2697.namprd03.prod.outlook.com (10.168.197.135) 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 10:55:33 +0000 Received: from BL2FFO11OLC008.protection.gbl (2a01:111:f400:7c09::140) by BN6PR03CA0094.outlook.office365.com (2603:10b6:405:6f::32) 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 10:55:33 +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 BL2FFO11OLC008.mail.protection.outlook.com (10.173.160.143) 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 10:55:31 +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 vAOAtRov003785; Fri, 24 Nov 2017 03:55:28 -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> From: Akhil Goyal Message-ID: <94ae34d4-b34a-22a1-e787-e2dcdffc8575@nxp.com> Date: Fri, 24 Nov 2017 16:25:27 +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: <414c3491-7a54-09b4-0cde-a21bffaeb1ab@intel.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-Matching-Connectors: 131559945318227188; (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)(39380400002)(346002)(376002)(39860400002)(2970300002)(1109001)(1110001)(3190300001)(339900001)(199003)(24454002)(189002)(85426001)(83506002)(4326008)(93886005)(86362001)(31686004)(31696002)(105606002)(106466001)(50466002)(33646002)(498600001)(8936002)(316002)(6246003)(189998001)(53936002)(36756003)(58126008)(110136005)(54906003)(67846002)(229853002)(47776003)(356003)(65956001)(65806001)(104016004)(76176999)(50986999)(5660300001)(2870700001)(53546010)(64126003)(2950100002)(15650500001)(77096006)(305945005)(97736004)(8676002)(81156014)(2486003)(81166006)(23676004)(65826007)(68736007)(54356999)(2906002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR03MB2697; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:3; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11OLC008; 1:/dztfvN1NmwldOnVSZn59IQhWW+iZqKxZ2BpJ+52gAgAaIrqCdDYAUGLUR1fuzSNHNdQ14bhgq6wlrzlrrbicKH2IOXRpmTPu+ZKCWv60T3zkrnSFg6JidBq2JBofahv X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(2017052603199); SRVR:DM5PR03MB2697; X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2697; 3:NSr07aC/Eyj94TTv/MYMdT7G/ZL675XE6ilZFMaHMPn3630OLpi7Djc9xL6OIej2ylmiU+VaHgtTA7cFPKK0tMXoDQn1QAb/IhJ3CHYM5iC7zkC5TjssQ3wV+cVeomstxOvkjKttMZtYqG8j651+CpVivcrlWfVwIMCALjkURQsvCj/woVwrSk6jY64sCp1Hc9eyuLGFfSYmaR04UDhSZ4VFUX8gJoTbpoTZKJBlP17qxAkH83xFvaodAR/xqYVglomkKTppfSA9InEFMjJiDuqCFVJFcYqwVdemgisf/GhEjYsXLODqGXst09uvlw6zB+5i/+Kr79bPqySbnMIFBub76DnWNDFaTMklGLuYIIo=; 25:RT1pM2Xd/r02ZkEVzTDoeuh4R8s0r4RBboUMD+GgombdtAnF9DfQjxwJ/Bzor0Fonu4reWjvSz/BMOZnfG+GbLK2yxqDlAh62+yz1+UmJGfpKNidoe7pwVWn7HJtgCJvCfjWFOxi8JLBNNPf1TRySTedEBks2a5UBJW33zLdTTxsJfehkn+4iEQ179K5ii3tZSyHCyZw/DPF9e2txIGBaEle/nGwRIiPNbDNnUIm885Edd2eMlal6h1Rma8gWdBl2W/doku8sU1Xsk/nWNh1m2tn5p6mtY358+NbfpNxYxdfDyhBP7iWerAlu4+qYgmV7NG41ORrDVKJquxEcZwhumEKnLc6BTQOs7airCYofE4= X-MS-TrafficTypeDiagnostic: DM5PR03MB2697: X-MS-Office365-Filtering-Correlation-Id: 174c2e9c-f605-479b-7b97-08d53329e1d1 X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2697; 31:HdQnxGo1WjcZOK79svKpsUED6riQyEqRaFK6gAGcqBXlwvTjttKIfX6Mx4vjlfxcNoDViV+DfjbaXGNiM/kocuAxtSp25qcKux0AyLOOf35dfYsKA5OlvHjPzxDt2sq/ySDaSn/PR0KKu+2NrpJsJSIvjoP/zb+y7N1F/QbeFiYATkiNATH3X8jTNmrJ7zQx0thc1Jc71/v+wDUof2Jb3TJQ+8ot1tuWyI7uYcFTLiQ=; 4:lVoSNal3QCQKrTMzy1wEVQqRosc93rYsfvDsj4oJ45YP4u0oEylv/JcglC9/tymVmSK4jyjUa1vruY9StUNmOr+iy4SJfax0G1pyxXrsHExD/vYWNT5rWwPsIByTd2woPSD9lRJc2hoRng0i5HKZMt4F/gHegfUVcuxl7Cq9ZFPXOeo0BTa+uR2BeMh7ZqnUkGJYYbyYZADT1mTLdUwav3fpz9zv4u1gFGZ9+ibMqwHj0/uR1G/F5z5c7mKQwq1qs7bW8Mdcfan3xQpDl2iiBbdEJSFw9d0SIvM4rKTxByPo17E7tilb5cqRWfW3Pdun X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192374486261705); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231022)(6055026)(6096035)(20161123563025)(20161123556025)(20161123565025)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123561025)(20161123559100)(201708071742011); SRVR:DM5PR03MB2697; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:DM5PR03MB2697; X-Forefront-PRVS: 05015EB482 X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtETTVQUjAzTUIyNjk3OzIzOk1LZTN5K3BlenoyWG4wWXppZEE2eFFlUHpj?= =?utf-8?B?aEV6bHVvSEw5cFZqNjRtaGxMN09IcHFqaUlKejNFa3AvNnd0VFNjbTBsd0s5?= =?utf-8?B?L2pDZlJGbjd3ampHekx3aFMwOWpRUFE4Mit5blB3RlM4emo4QjFKc1N2SXVG?= =?utf-8?B?VGIzSU5wVklkMStvbUUwWWNEdnVLMktkMjFuYzd3YTFDSDR2M1JKVTJSZDJD?= =?utf-8?B?VmVBZE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6cBMx2mHvT0IuR8McXViOIPpIf2gDAvS5M95F+w+5ZAz8ZIec5HuuU82NFDCxaFAbMyZb29qBkyS7tRTcRwPM6dtkOr1VpMsLlsF3BbFuERTr/Ft+IOHQ5fr2Jyu2tR5TaqJYt82Bet3jXxTlxX7z5wkaaEaihI08wQE027Xuk+cejlK7JVh9zJf5/4e1mdYfG1LkH8RfsxePLV/deTEMOHvEHkFE+Tpf+j37rvlcVgzFNSd6TiQygLp0uQ05WHGvQ+zVSTwTiB4PW4EVZjLq04TCB1V7YowdCBTxz8/p/h98jSh4RRv+vH/hZ4=; 5:9FLUpkn02a6U9FtYFQe3YOllLez/Iw2lhhpm3jesOhJU/XvkOI6S5NWaDjmv5ZnsX77ezmujXpiV1qhZ1F/RUuPs14vMhaT7pn8gjeDsKhPNgkW60ZmpFqNR5tQVKVn7fOUhuZ35He4Qnc/cOmlht2osQICVYOtGbr5wvbZOgds=; 24:xe3CyV4rsvGHIDU78GnOqJF8SlR7LoQz4BteGN2oDFmZq/pwOD/6jX9KPuVefgEHTrO/q+qY+2GYaSnzQfj3g0XHTz4kmJqJbAAi6PNd51w=; 7:kYmYPbDPqF2WSyXSVf4MeSMj+g95daQHLBexTmtMxqW6SIU5MWhJSQtDvGmrpNbyB3CiKASe8WozlIvgrRft+zZHG1bCei+jmwNpQ1scQGuuxva6XN5MLS99UzqExgeTU5gJCod2/L2SWEERteVFNU7oFEUp0w0sGbiZfLKtT1uLkLlh/aDKtKWCAt0vPh5tNvvHxXgRD55cIhYBPvPsFkgvmfV+R6RWBJFutjF29En9pwiEGGeV/16dqE2/KGuT SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Nov 2017 10:55:31.6043 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 174c2e9c-f605-479b-7b97-08d53329e1d1 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: DM5PR03MB2697 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 10:55:35 -0000 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. -Akhil