From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 50BAC1B1B6 for ; Fri, 16 Feb 2018 06:51:12 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Feb 2018 21:51:09 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,519,1511856000"; d="scan'208";a="30564443" Received: from pgsmsx101.gar.corp.intel.com ([10.221.44.78]) by fmsmga004.fm.intel.com with ESMTP; 15 Feb 2018 21:51:08 -0800 Received: from pgsmsx102.gar.corp.intel.com ([169.254.6.149]) by PGSMSX101.gar.corp.intel.com ([169.254.1.181]) with mapi id 14.03.0319.002; Fri, 16 Feb 2018 13:51:07 +0800 From: "Gujjar, Abhinandan S" To: Jerin Jacob CC: "dev@dpdk.org" , "Rao, Nikhil" Thread-Topic: [PATCH V2, 1/2] eventdev: add caps API and PMD callback for crypto adapter Thread-Index: AQHTje8W+3clXQy0pUy9QNjcHknTEaOlGoYAgAGcxDA= Date: Fri, 16 Feb 2018 05:51:07 +0000 Message-ID: <5612CB344B05EE4F95FC5B729939F7807063B828@PGSMSX102.gar.corp.intel.com> References: <1516013570-146070-1-git-send-email-abhinandan.gujjar@intel.com> <20180215130944.GA808@jerin> In-Reply-To: <20180215130944.GA808@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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNTIyMjdhZmYtNmVkYS00YWRiLTgwMmUtN2ZiOGNlYTY3YzVjIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IjNCYjFQTEFNbUF4dGM5YXBaMDgrN0ZNY3E2VnZ6UzBUVkJDaGNGTmxuTW89In0= dlp-product: dlpe-windows dlp-version: 11.0.0.116 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] [PATCH V2, 1/2] eventdev: add caps API and PMD callback 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: Fri, 16 Feb 2018 05:51:13 -0000 Hi Jerin, Thanks for the review. Few comments inline. > -----Original Message----- > From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com] > Sent: Thursday, February 15, 2018 6:40 PM > To: Gujjar, Abhinandan S > Cc: dev@dpdk.org; Rao, Nikhil > Subject: Re: [PATCH V2, 1/2] eventdev: add caps API and PMD callback for > crypto adapter >=20 > -----Original Message----- > > Date: Mon, 15 Jan 2018 16:22:50 +0530 > > From: Abhinandan Gujjar > > To: jerin.jacob@caviumnetworks.com > > CC: dev@dpdk.org, Abhinandan Gujjar , > > Nikhil Rao > > Subject: [PATCH V2, 1/2] eventdev: add caps API and PMD callback for > > crypto adapter > > X-Mailer: git-send-email 1.9.1 > > > > Application gets required information to configure crypto adapter for > > cryptodev and eventdev using caps API. > > > > Signed-off-by: Abhinandan Gujjar > > Signed-off-by: Nikhil Rao > > --- > > > > Notes: > > V2: > > 1. Removed _MULTI_EVENTQ & _MULTI_EVENTQ capabilities >=20 >=20 > Please fix the shared build issue > target: x86_64-native-linuxapp-gcc+shared >=20 > >=20 > rte_eventdev.o: In function `rte_event_crypto_adapter_caps_get': > rte_eventdev.c:(.text+0x4e4): undefined reference to > `rte_cryptodev_pmd_is_valid_dev' > rte_eventdev.c:(.text+0x4f7): undefined reference to > `rte_cryptodev_pmd_get_dev' > collect2: error: ld returned 1 exit status >=20 > Ok. I will recheck. >=20 > > > > lib/librte_eventdev/rte_eventdev.c | 25 +++++++++++++++++++++++++ > > lib/librte_eventdev/rte_eventdev.h | 33 > +++++++++++++++++++++++++++++++++ > > lib/librte_eventdev/rte_eventdev_pmd.h | 32 > > ++++++++++++++++++++++++++++++++ > > 3 files changed, 90 insertions(+) > > > > diff --git a/lib/librte_eventdev/rte_eventdev.c > > b/lib/librte_eventdev/rte_eventdev.c > > index f32c53f..e453667 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_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; >=20 > Could move the caps check to beginning. Sure >=20 >=20 > > + *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 f1949ff..b442fa2 100644 > > --- a/lib/librte_eventdev/rte_eventdev.h > > +++ b/lib/librte_eventdev/rte_eventdev.h > > @@ -1048,6 +1048,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_CYRPTO_ADAPTER_CAP_INTERNAL_PORT 0x1 >=20 > s/CYRPTO/CRYPTO Ok >=20 > > +/**< Flag indicates HW is capable of generating events. >=20 > How about, generating "crypto completion" events or something similar, Sure. I will update it. >=20 > > + * Cryptodev can send packets to the event device using internal event= port. > > + */ > > + > > +/** > > + * @warning > > + * @b EXPERIMENTAL: this API may change without prior notice >=20 > Use the new __experimental tag Ok >=20 > > + * > > + * Retrieve the event device's crypto adapter capabilities for the > > + * specified cryptodev device > > + * > > + * @param dev_id > > + * The identifier of the device. > > + * > > + * @param cdev_id > > + * The identifier of the cryptodev device. > > + * > > + * @param[out] caps > > + * A pointer to memory filled with event adapter capabilities. > > + * > > + * @return > > + * - 0: Success, driver provides event adapter capabilities for the > > + * cryptodev device. > > + * - <0: Error code returned by the driver function. > > + * > > + */ > > +int > > +rte_event_crypto_adapter_caps_get(uint8_t dev_id, uint8_t cdev_id, > > + uint32_t *caps); > > + > > struct rte_eventdev_driver; > > struct rte_eventdev_ops; > > struct rte_eventdev; > > diff --git a/lib/librte_eventdev/rte_eventdev_pmd.h > > b/lib/librte_eventdev/rte_eventdev_pmd.h > > index c2fd09c..0c10d99 100644 > > --- a/lib/librte_eventdev/rte_eventdev_pmd.h > > +++ b/lib/librte_eventdev/rte_eventdev_pmd.h > > @@ -569,6 +569,35 @@ typedef int (*eventdev_eth_rx_adapter_stats_reset) > > (const struct rte_eventdev *dev, > > const struct rte_eth_dev *eth_dev); > > > > + > > +struct rte_cryptodev; > > +/** > > + * @warning > > + * @b EXPERIMENTAL: this API may change without prior notice >=20 >=20 > This is a internal PMD API. So, I think, it does not come in EXPERIMENTAL= tag Ok >=20 > > + * > > + * Retrieve the event device's crypto adapter capabilities for the > > + * specified cryptodev > > + * > > + * @param dev > > + * Event device pointer > > + * > > + * @param cdev > > + * cryptodev pointer > > + * > > + * @param[out] caps > > + * A pointer to memory filled with event adapter capabilities. > > + * > > + * @return > > + * - 0: Success, driver provides event adapter capabilities for the > > + * cryptodev. > > + * - <0: Error code returned by the driver function. > > + * > > + */ > > +typedef int (*eventdev_crypto_adapter_caps_get_t) > > + (const struct rte_eventdev *dev, > > + const struct rte_cryptodev *cdev, > > + uint32_t *caps); > > + > > /** Event device operations function pointer table */ struct > > rte_eventdev_ops { > > eventdev_info_get_t dev_infos_get; /**< Get device info. */ > > @@ -623,6 +652,9 @@ struct rte_eventdev_ops { > > /**< Get ethernet Rx stats */ > > eventdev_eth_rx_adapter_stats_reset eth_rx_adapter_stats_reset; > > /**< Reset ethernet Rx stats */ > > + > > + eventdev_crypto_adapter_caps_get_t crypto_adapter_caps_get; > > + /**< Get crypto adapter capabilities */ >=20 > Please rebase to latest dpdk-event-next tree. Sure >=20 > > }; > > > > /** > > -- > > 1.9.1 > >