From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 440912BC7 for ; Tue, 2 Oct 2018 11:50:54 +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 fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Oct 2018 02:50:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,331,1534834800"; d="scan'208";a="79173279" Received: from kmsmsx155.gar.corp.intel.com ([172.21.73.106]) by orsmga006.jf.intel.com with ESMTP; 02 Oct 2018 02:50:51 -0700 Received: from pgsmsx102.gar.corp.intel.com ([169.254.6.129]) by KMSMSX155.gar.corp.intel.com ([169.254.15.88]) with mapi id 14.03.0319.002; Tue, 2 Oct 2018 17:49:30 +0800 From: "Gujjar, Abhinandan S" To: Jerin Jacob , "akhil.goyal@nxp.com" CC: "dev@dpdk.org" , "hemant.agrawal@nxp.com" , "De Lara Guarch, Pablo" Thread-Topic: [dpdk-dev] [PATCH 3/3] event/dpaa2: support for crypto adapter Thread-Index: AQHUVH2bwwx+8Da+5kG8ML6rWY5OvKULwPUQ Date: Tue, 2 Oct 2018 09:49:29 +0000 Message-ID: <5612CB344B05EE4F95FC5B729939F7807080444B@PGSMSX102.gar.corp.intel.com> References: <20180914114810.14960-1-akhil.goyal@nxp.com> <20180914114810.14960-4-akhil.goyal@nxp.com> <20180925031130.GA10106@jerin> In-Reply-To: <20180925031130.GA10106@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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOWYzMzE5MDYtYjk5MC00Zjc3LWJhYzItMTg5ZGFkZGE3MzNlIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiM3RsZWdFeTRhNmpETzNyR3NaZXZyRXJyR1pDeGw4TW9sQ0RQSnUzUVhZUU1XV0F1NHR3MDV0WUhhN2lhSVM2TyJ9 dlp-product: dlpe-windows dlp-version: 11.0.400.15 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 3/3] event/dpaa2: support 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: Tue, 02 Oct 2018 09:50:55 -0000 Acked-By: Abhinandan Gujjar > -----Original Message----- > From: Jerin Jacob > Sent: Tuesday, September 25, 2018 8:42 AM > To: akhil.goyal@nxp.com > Cc: dev@dpdk.org; hemant.agrawal@nxp.com; De Lara Guarch, Pablo > ; Gujjar, Abhinandan S > > Subject: Re: [dpdk-dev] [PATCH 3/3] event/dpaa2: support for crypto adapt= er >=20 > -----Original Message----- > > Date: Fri, 14 Sep 2018 17:18:10 +0530 > > From: akhil.goyal@nxp.com > > To: dev@dpdk.org > > CC: hemant.agrawal@nxp.com, pablo.de.lara.guarch@intel.com, Akhil > > Goyal > > Subject: [dpdk-dev] [PATCH 3/3] event/dpaa2: support for crypto > > adapter > > X-Mailer: git-send-email 2.17.1 > > > > > > From: Akhil Goyal > > > > Signed-off-by: Akhil Goyal > > Signed-off-by: Ashish Jain > > Signed-off-by: Hemant Agrawal >=20 >=20 > Adding Eventdev Crypto Adapter maintainer >=20 > + Abhinandan Gujjar >=20 >=20 > > --- > > drivers/event/dpaa2/Makefile | 3 +- > > drivers/event/dpaa2/dpaa2_eventdev.c | 150 > +++++++++++++++++++++++++++ > > drivers/event/dpaa2/dpaa2_eventdev.h | 9 ++ > > drivers/event/dpaa2/meson.build | 3 +- > > 4 files changed, 163 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/event/dpaa2/Makefile > > b/drivers/event/dpaa2/Makefile index 5e1a63200..46f7d061e 100644 > > --- a/drivers/event/dpaa2/Makefile > > +++ b/drivers/event/dpaa2/Makefile > > @@ -20,9 +20,10 @@ CFLAGS +=3D -I$(RTE_SDK)/drivers/event/dpaa2 CFLAGS > > +=3D -I$(RTE_SDK)/lib/librte_eal/linuxapp/eal > > LDLIBS +=3D -lrte_eal -lrte_eventdev > > LDLIBS +=3D -lrte_bus_fslmc -lrte_mempool_dpaa2 -lrte_pmd_dpaa2 -LDLIB= S > > +=3D -lrte_bus_vdev > > +LDLIBS +=3D -lrte_bus_vdev -lrte_pmd_dpaa2_sec > > CFLAGS +=3D -I$(RTE_SDK)/drivers/net/dpaa2 CFLAGS +=3D > > -I$(RTE_SDK)/drivers/net/dpaa2/mc > > +CFLAGS +=3D -I$(RTE_SDK)/drivers/crypto/dpaa2_sec > > > > # versioning export map > > EXPORT_MAP :=3D rte_pmd_dpaa2_event_version.map diff --git > > a/drivers/event/dpaa2/dpaa2_eventdev.c > > b/drivers/event/dpaa2/dpaa2_eventdev.c > > index cadbdb13b..890ab461c 100644 > > --- a/drivers/event/dpaa2/dpaa2_eventdev.c > > +++ b/drivers/event/dpaa2/dpaa2_eventdev.c > > @@ -27,6 +27,7 @@ > > #include > > #include > > #include > > +#include > > #include > > > > #include > > @@ -34,6 +35,7 @@ > > #include > > #include > > #include > > +#include > > #include "dpaa2_eventdev.h" > > #include "dpaa2_eventdev_logs.h" > > #include > > @@ -793,6 +795,149 @@ dpaa2_eventdev_eth_stop(const struct > rte_eventdev *dev, > > return 0; > > } > > > > +static int > > +dpaa2_eventdev_crypto_caps_get(const struct rte_eventdev *dev, > > + const struct rte_cryptodev *cdev, > > + uint32_t *caps) { > > + const char *name =3D cdev->data->name; > > + > > + EVENTDEV_INIT_FUNC_TRACE(); > > + > > + RTE_SET_USED(dev); > > + > > + if (!strncmp(name, "dpsec-", 6)) > > + *caps =3D RTE_EVENT_CRYPTO_ADAPTER_DPAA2_CAP; > > + else > > + return -1; > > + > > + return 0; > > +} > > + > > +static int > > +dpaa2_eventdev_crypto_queue_add_all(const struct rte_eventdev *dev, > > + const struct rte_cryptodev *cryptodev, > > + const struct rte_event *ev) { > > + struct dpaa2_eventdev *priv =3D dev->data->dev_private; > > + uint8_t ev_qid =3D ev->queue_id; > > + uint16_t dpcon_id =3D priv->evq_info[ev_qid].dpcon->dpcon_id; > > + int i, ret; > > + > > + EVENTDEV_INIT_FUNC_TRACE(); > > + > > + for (i =3D 0; i < cryptodev->data->nb_queue_pairs; i++) { > > + ret =3D dpaa2_sec_eventq_attach(cryptodev, i, > > + dpcon_id, ev); > > + if (ret) { > > + DPAA2_EVENTDEV_ERR("dpaa2_sec_eventq_attach fai= led: ret > %d\n", > > + ret); > > + goto fail; > > + } > > + } > > + return 0; > > +fail: > > + for (i =3D (i - 1); i >=3D 0 ; i--) > > + dpaa2_sec_eventq_detach(cryptodev, i); > > + > > + return ret; > > +} > > + > > +static int > > +dpaa2_eventdev_crypto_queue_add(const struct rte_eventdev *dev, > > + const struct rte_cryptodev *cryptodev, > > + int32_t rx_queue_id, > > + const struct rte_event *ev) { > > + struct dpaa2_eventdev *priv =3D dev->data->dev_private; > > + uint8_t ev_qid =3D ev->queue_id; > > + uint16_t dpcon_id =3D priv->evq_info[ev_qid].dpcon->dpcon_id; > > + int ret; > > + > > + EVENTDEV_INIT_FUNC_TRACE(); > > + > > + if (rx_queue_id =3D=3D -1) > > + return dpaa2_eventdev_crypto_queue_add_all(dev, > > + cryptodev, ev); > > + > > + ret =3D dpaa2_sec_eventq_attach(cryptodev, rx_queue_id, > > + dpcon_id, ev); > > + if (ret) { > > + DPAA2_EVENTDEV_ERR( > > + "dpaa2_sec_eventq_attach failed: ret: %d\n", re= t); > > + return ret; > > + } > > + return 0; > > +} > > + > > +static int > > +dpaa2_eventdev_crypto_queue_del_all(const struct rte_eventdev *dev, > > + const struct rte_cryptodev *cdev) { > > + int i, ret; > > + > > + EVENTDEV_INIT_FUNC_TRACE(); > > + > > + RTE_SET_USED(dev); > > + > > + for (i =3D 0; i < cdev->data->nb_queue_pairs; i++) { > > + ret =3D dpaa2_sec_eventq_detach(cdev, i); > > + if (ret) { > > + DPAA2_EVENTDEV_ERR( > > + "dpaa2_sec_eventq_detach failed:ret %d\= n", ret); > > + return ret; > > + } > > + } > > + > > + return 0; > > +} > > + > > +static int > > +dpaa2_eventdev_crypto_queue_del(const struct rte_eventdev *dev, > > + const struct rte_cryptodev *cryptodev, > > + int32_t rx_queue_id) { > > + int ret; > > + > > + EVENTDEV_INIT_FUNC_TRACE(); > > + > > + if (rx_queue_id =3D=3D -1) > > + return dpaa2_eventdev_crypto_queue_del_all(dev, > > + cryptodev); > > + > > + ret =3D dpaa2_sec_eventq_detach(cryptodev, rx_queue_id); > > + if (ret) { > > + DPAA2_EVENTDEV_ERR( > > + "dpaa2_sec_eventq_detach failed: ret: %d\n", re= t); > > + return ret; > > + } > > + > > + return 0; > > +} > > + > > +static int > > +dpaa2_eventdev_crypto_start(const struct rte_eventdev *dev, > > + const struct rte_cryptodev *cryptodev) { > > + EVENTDEV_INIT_FUNC_TRACE(); > > + > > + RTE_SET_USED(dev); > > + RTE_SET_USED(cryptodev); > > + > > + return 0; > > +} > > + > > +static int > > +dpaa2_eventdev_crypto_stop(const struct rte_eventdev *dev, > > + const struct rte_cryptodev *cryptodev) { > > + EVENTDEV_INIT_FUNC_TRACE(); > > + > > + RTE_SET_USED(dev); > > + RTE_SET_USED(cryptodev); > > + > > + return 0; > > +} > > + > > static struct rte_eventdev_ops dpaa2_eventdev_ops =3D { > > .dev_infos_get =3D dpaa2_eventdev_info_get, > > .dev_configure =3D dpaa2_eventdev_configure, > > @@ -814,6 +959,11 @@ static struct rte_eventdev_ops dpaa2_eventdev_ops > =3D { > > .eth_rx_adapter_queue_del =3D dpaa2_eventdev_eth_queue_del, > > .eth_rx_adapter_start =3D dpaa2_eventdev_eth_start, > > .eth_rx_adapter_stop =3D dpaa2_eventdev_eth_stop, > > + .crypto_adapter_caps_get =3D dpaa2_eventdev_crypto_caps_= get, > > + .crypto_adapter_queue_pair_add =3D dpaa2_eventdev_crypto_queue= _add, > > + .crypto_adapter_queue_pair_del =3D dpaa2_eventdev_crypto_queue= _del, > > + .crypto_adapter_start =3D dpaa2_eventdev_crypto_start= , > > + .crypto_adapter_stop =3D dpaa2_eventdev_crypto_stop, > > }; > > > > static int > > diff --git a/drivers/event/dpaa2/dpaa2_eventdev.h > > b/drivers/event/dpaa2/dpaa2_eventdev.h > > index 720e0c63b..c847b3eab 100644 > > --- a/drivers/event/dpaa2/dpaa2_eventdev.h > > +++ b/drivers/event/dpaa2/dpaa2_eventdev.h > > @@ -42,6 +42,15 @@ enum { > > (RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT | \ > > RTE_EVENT_ETH_RX_ADAPTER_CAP_MULTI_EVENTQ | \ > > RTE_EVENT_ETH_RX_ADAPTER_CAP_OVERRIDE_FLOW_ID) > > + > > +/**< Crypto Rx adapter cap to return If the packet transfers from > > + * the cryptodev to eventdev with DPAA2 devices. > > + */ > > +#define RTE_EVENT_CRYPTO_ADAPTER_DPAA2_CAP \ > > + (RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW | \ > > + > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND | \ > > + RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA) > > + > > /**< Ethernet Rx adapter cap to return If the packet transfers from > > * the ethdev to eventdev with DPAA2 devices. > > */ > > diff --git a/drivers/event/dpaa2/meson.build > > b/drivers/event/dpaa2/meson.build index de7a46155..c1bd63384 100644 > > --- a/drivers/event/dpaa2/meson.build > > +++ b/drivers/event/dpaa2/meson.build > > @@ -4,8 +4,9 @@ > > if host_machine.system() !=3D 'linux' > > build =3D false > > endif > > -deps +=3D ['bus_vdev', 'pmd_dpaa2'] > > +deps +=3D ['bus_vdev', 'pmd_dpaa2', 'pmd_dpaa2_sec'] > > sources =3D files('dpaa2_hw_dpcon.c', > > 'dpaa2_eventdev.c') > > > > allow_experimental_apis =3D true > > +includes +=3D include_directories('../../crypto/dpaa2_sec/') > > -- > > 2.17.1 > >