From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 29EA31B778 for ; Thu, 12 Apr 2018 08:29:40 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Apr 2018 23:28:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,440,1517904000"; d="scan'208";a="33680786" Received: from kmsmsx152.gar.corp.intel.com ([172.21.73.87]) by orsmga006.jf.intel.com with ESMTP; 11 Apr 2018 23:28:05 -0700 Received: from pgsmsx102.gar.corp.intel.com ([169.254.6.99]) by KMSMSX152.gar.corp.intel.com ([169.254.11.169]) with mapi id 14.03.0319.002; Thu, 12 Apr 2018 14:28:04 +0800 From: "Gujjar, Abhinandan S" To: Jerin Jacob CC: "hemant.agrawal@nxp.com" , "akhil.goyal@nxp.com" , "dev@dpdk.org" , "De Lara Guarch, Pablo" , "Doherty, Declan" , "Vangati, Narender" , "Rao, Nikhil" , "Nidadavolu.Murthy@cavium.com" , "NarayanaPrasad.Athreya@cavium.com" Thread-Topic: [dpdk-dev,v1,1/5] eventdev: add caps API and PMD callbacks for crypto adapter Thread-Index: AQHTy+INQQ6q9w8cp0u2jOSSapd+xqP5BqsAgAOvPzA= Date: Thu, 12 Apr 2018 06:28:03 +0000 Message-ID: <5612CB344B05EE4F95FC5B729939F780706E3856@PGSMSX102.gar.corp.intel.com> References: <1522824978-61568-1-git-send-email-abhinandan.gujjar@intel.com> <20180410060756.GA23776@jerin> In-Reply-To: <20180410060756.GA23776@jerin> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiODU2YmZjZTAtMjQ3Ny00MjI0LTlmMzEtYWQ5MmY0OWNhNmFlIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6ImN1ZEtpQ3FvS0dPTmJEYklMRE1JeWIyeUVoT1BtVk9mNnJvbkx6VGZYa3M9In0= dlp-product: dlpe-windows dlp-version: 11.0.200.100 dlp-reaction: no-action x-originating-ip: [172.30.20.206] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [dpdk-dev, v1, 1/5] eventdev: add caps API and PMD callbacks for crypto adapter 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: Thu, 12 Apr 2018 06:29:41 -0000 Hi Jerin, Please find some comments inline > -----Original Message----- > From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com] > Sent: Tuesday, April 10, 2018 11:38 AM > To: Gujjar, Abhinandan S > Cc: hemant.agrawal@nxp.com; akhil.goyal@nxp.com; dev@dpdk.org; De Lara > Guarch, Pablo ; Doherty, Declan > ; Vangati, Narender > ; Rao, Nikhil ; > Nidadavolu.Murthy@cavium.com; NarayanaPrasad.Athreya@cavium.com > Subject: Re: [dpdk-dev,v1,1/5] eventdev: add caps API and PMD callbacks f= or > crypto adapter >=20 > -----Original Message----- > > Date: Wed, 4 Apr 2018 12:26:18 +0530 > > From: Abhinandan Gujjar > > To: jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com, > > akhil.goyal@nxp.com, dev@dpdk.org > > CC: pablo.de.lara.guarch@intel.com, declan.doherty@intel.com, > > narender.vangati@intel.com, abhinandan.gujjar@intel.com, > > nikhil.rao@intel.com > > Subject: [dpdk-dev,v1,1/5] eventdev: add caps API and PMD callbacks > > for crypto adapter > > X-Mailer: git-send-email 1.9.1 > > > > Signed-off-by: Abhinandan Gujjar > > --- > > lib/librte_eventdev/rte_eventdev.c | 25 +++++ > > lib/librte_eventdev/rte_eventdev.h | 35 +++++++ > > lib/librte_eventdev/rte_eventdev_pmd.h | 176 > > +++++++++++++++++++++++++++++++++ > > 3 files changed, 236 insertions(+) > > > > diff --git a/lib/librte_eventdev/rte_eventdev.c > > b/lib/librte_eventdev/rte_eventdev.c > > index 2de8d9a..3d24e8f 100644 > > --- a/lib/librte_eventdev/rte_eventdev.c > > +++ b/lib/librte_eventdev/rte_eventdev.c > > @@ -29,6 +29,8 @@ > > #include > > #include > > #include > > +#include > > +#include > > > > #include "rte_eventdev.h" > > #include "rte_eventdev_pmd.h" > > @@ -123,6 +125,29 @@ > > : 0; > > } > > > > +int __rte_experimental > > +rte_event_crypto_adapter_caps_get(uint8_t dev_id, uint8_t cdev_id, > > + uint32_t *caps) > > +{ > > + struct rte_eventdev *dev; > > + struct rte_cryptodev *cdev; > > + > > + RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL); > > + if (!rte_cryptodev_pmd_is_valid_dev(cdev_id)) > > + return -EINVAL; > > + > > + dev =3D &rte_eventdevs[dev_id]; > > + cdev =3D rte_cryptodev_pmd_get_dev(cdev_id); > > + > > + if (caps =3D=3D NULL) > > + return -EINVAL; > > + *caps =3D 0; > > + > > + return dev->dev_ops->crypto_adapter_caps_get ? > > + (*dev->dev_ops->crypto_adapter_caps_get) > > + (dev, cdev, caps) : 0; > > +} > > + > > static inline int > > rte_event_dev_queue_config(struct rte_eventdev *dev, uint8_t > > nb_queues) { diff --git a/lib/librte_eventdev/rte_eventdev.h > > b/lib/librte_eventdev/rte_eventdev.h > > index a20077c..49a71d1 100644 > > --- a/lib/librte_eventdev/rte_eventdev.h > > +++ b/lib/librte_eventdev/rte_eventdev.h > > @@ -35,6 +35,8 @@ > > #ifndef _RTE_EVENTDEV_H_ > > #define _RTE_EVENTDEV_H_ > > > > +#include > > + > > /** > > * @file > > * > > @@ -1142,6 +1144,39 @@ struct rte_event { > > rte_event_eth_rx_adapter_caps_get(uint8_t dev_id, uint8_t eth_port_id, > > uint32_t *caps); > > > > + > > +/* Crypto adapter capability bitmap flag */ > > +#define RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT 0x1 > > +/**< Flag indicates HW is capable of generating events. > > + * Cryptodev can send packets to the event device using an internal ev= ent > port. > > + */ >=20 > Some top level comments, >=20 > 1) Since we are not planning to abstract > RTE_EVENT_CRYPTO_ADAPTER_ENQ_DEQ mode inside the adapter, I think, it > make sense to introduce new capability. ie. In some of the HW implementat= ion, > We could maintain the packet order even if source queue/scheded_type is > ORDERED. ie. if the capability is set then application can use > RTE_EVENT_CRYPTO_ADAPTER_DEQ_ONLY to maintain the ingress order even > if it is been called from multiple CPU in ORDERED/ATOMIC context instead = of > using RTE_EVENT_CRYPTO_ADAPTER_ENQ_DEQ mode. Sure. I will add ENQ-DEQ into caps. >=20 > 2) Please split the 2/5 to patch specification and implementation Ok >=20 > 3) I think, we need to give a example code snippet in the programmer guid= e on > how to use RTE_EVENT_CRYPTO_ADAPTER_ENQ_DEQ mode in conjunction with > rte_event_crypto_adapter_event_port_get(). I have added a test case in the test app to show usage of rte_event_crypto_= adapter_event_port_get(). I will update the programmer guide too. Regards Abhinandan >=20 > Let me know your views?