From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 45D872B82 for ; Mon, 23 Apr 2018 08:49:39 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Apr 2018 23:49:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,316,1520924400"; d="scan'208";a="222524165" Received: from pgsmsx111.gar.corp.intel.com ([10.108.55.200]) by fmsmga005.fm.intel.com with ESMTP; 22 Apr 2018 23:49:36 -0700 Received: from pgsmsx106.gar.corp.intel.com ([169.254.9.180]) by PGSMSX111.gar.corp.intel.com ([169.254.2.233]) with mapi id 14.03.0319.002; Mon, 23 Apr 2018 14:49:16 +0800 From: "Gujjar, Abhinandan S" To: Akhil Goyal , Jerin Jacob CC: "hemant.agrawal@nxp.com" , "dev@dpdk.org" , "De Lara Guarch, Pablo" , "Doherty, Declan" , "Vangati, Narender" , "Rao, Nikhil" , "Eads, Gage" Thread-Topic: [dpdk-dev] [dpdk-dev, v1, 2/5] eventdev: add crypto adapter implementation Thread-Index: AQHT1lcTQotuUXI2n0Spzo6oA0XnV6QGCHJAgAL74gCAABv8AIAESImAgACIj+A= Date: Mon, 23 Apr 2018 06:49:15 +0000 Message-ID: <5612CB344B05EE4F95FC5B729939F780706F0CD5@PGSMSX106.gar.corp.intel.com> References: <1522824999-61614-1-git-send-email-abhinandan.gujjar@intel.com> <5ea61576-9124-266a-00e6-cb9f22a37f59@nxp.com> <5612CB344B05EE4F95FC5B729939F780706E5DA8@PGSMSX102.gar.corp.intel.com> <37505d55-bdc3-78fb-009b-b38ba1cdbe66@nxp.com> <20180420131438.GA15553@jerin> <83734a69-619f-25e3-dc09-06844c67c8e4@nxp.com> In-Reply-To: <83734a69-619f-25e3-dc09-06844c67c8e4@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOTc2Njk4N2ItN2ZiYi00NDI0LWI0ZTQtOTdhNWU4YTE1ZDM3IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6ImljUDkxRm0wN2tBalBzU3U3REJmR3RIQ296c1V3Q3EzTTV4VnFJOHFuSEk9In0= dlp-product: dlpe-windows dlp-version: 11.0.200.100 dlp-reaction: no-action x-originating-ip: [172.30.20.205] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [dpdk-dev, v1, 2/5] eventdev: add crypto adapter implementation 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: Mon, 23 Apr 2018 06:49:39 -0000 > -----Original Message----- > From: Akhil Goyal [mailto:akhil.goyal@nxp.com] > Sent: Monday, April 23, 2018 12:09 PM > To: Jerin Jacob > Cc: Gujjar, Abhinandan S ; > hemant.agrawal@nxp.com; dev@dpdk.org; De Lara Guarch, Pablo > ; Doherty, Declan > ; Vangati, Narender > ; Rao, Nikhil ; Eads, G= age > > Subject: Re: [dpdk-dev] [dpdk-dev, v1, 2/5] eventdev: add crypto adapter > implementation >=20 > On 4/20/2018 6:44 PM, Jerin Jacob wrote: > > -----Original Message----- > >> Date: Fri, 20 Apr 2018 17:04:36 +0530 > >> From: Akhil Goyal > >> To: "Gujjar, Abhinandan S" , > >> "jerin.jacob@caviumnetworks.com" , > >> "hemant.agrawal@nxp.com" , "dev@dpdk.org" > >> > >> CC: "De Lara Guarch, Pablo" , > >> "Doherty, Declan" , "Vangati, Narender" > >> , "Rao, Nikhil" , > >> "Eads, Gage" > >> Subject: Re: [dpdk-dev, v1, 2/5] eventdev: add crypto adapter > >> implementation > >> User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) > >> Gecko/20100101 > >> Thunderbird/45.8.0 > >> > >> Hi Abhinandan/ Jerin, > >> On 4/18/2018 11:51 AM, Gujjar, Abhinandan S wrote: > >>> Hi Akhil, > >>> > >>> Please find the comments inline. > >>> > >>>> -----Original Message----- > >>>> From: Akhil Goyal [mailto:akhil.goyal@nxp.com] > >>>> Sent: Tuesday, April 17, 2018 7:48 PM > >>>> To: Gujjar, Abhinandan S ; > >>>> jerin.jacob@caviumnetworks.com; hemant.agrawal@nxp.com; > >>>> dev@dpdk.org > >>>> Cc: De Lara Guarch, Pablo ; > >>>> Doherty, Declan ; Vangati, Narender > >>>> ; Rao, Nikhil ; > >>>> Eads, Gage > >>>> Subject: Re: [dpdk-dev, v1, 2/5] eventdev: add crypto adapter > >>>> implementation > >>>> > >>>> Hi Abhinandan, > >>>> > >>>> I have not reviewed the patch completely. But I have below query > >>>> for further review. > >>>> On 4/4/2018 12:26 PM, Abhinandan Gujjar wrote: > >>>>> Signed-off-by: Abhinandan Gujjar > >>>>> Signed-off-by: Nikhil Rao > >>>>> Signed-off-by: Gage Eads > >>>>> --- > >>>> > >>>> [..snip..] > >>>>> + > >>>>> +int __rte_experimental > >>>>> +rte_event_crypto_adapter_queue_pair_add(uint8_t id, > >>>>> + uint8_t cdev_id, > >>>>> + int32_t queue_pair_id) > >>>>> +{ > >>>>> + struct rte_event_crypto_adapter *adapter; > >>>>> + struct rte_eventdev *dev; > >>>>> + struct crypto_device_info *dev_info; > >>>>> + uint32_t cap; > >>>>> + int ret; > >>>>> + > >>>>> + RTE_EVENT_CRYPTO_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL); > >>>>> + > >>>>> + if (!rte_cryptodev_pmd_is_valid_dev(cdev_id)) { > >>>>> + RTE_EDEV_LOG_ERR("Invalid dev_id=3D%" PRIu8, cdev_id); > >>>>> + return -EINVAL; > >>>>> + } > >>>>> + > >>>>> + adapter =3D eca_id_to_adapter(id); > >>>>> + if (adapter =3D=3D NULL) > >>>>> + return -EINVAL; > >>>>> + > >>>>> + dev =3D &rte_eventdevs[adapter->eventdev_id]; > >>>>> + ret =3D rte_event_crypto_adapter_caps_get(adapter->eventdev_id, > >>>>> + cdev_id, > >>>>> + &cap); > >>>>> + if (ret) { > >>>>> + RTE_EDEV_LOG_ERR("Failed to get adapter caps dev %" PRIu8 > >>>>> + "cdev %" PRIu8, id, cdev_id); > >>>>> + return ret; > >>>>> + } > >>>>> + > >>>>> + dev_info =3D &adapter->cdevs[cdev_id]; > >>>>> + > >>>>> + if (queue_pair_id !=3D -1 && > >>>>> + (uint16_t)queue_pair_id >=3D dev_info->dev->data->nb_queue_pa= irs) { > >>>>> + RTE_EDEV_LOG_ERR("Invalid queue_pair_id %" PRIu16, > >>>>> + (uint16_t)queue_pair_id); > >>>>> + return -EINVAL; > >>>>> + } > >>>>> + > >>>>> + if (cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT) { > >>>>> + RTE_FUNC_PTR_OR_ERR_RET( > >>>>> + *dev->dev_ops->crypto_adapter_queue_pair_add, > >>>>> + -ENOTSUP); > >>>>> + if (dev_info->qpairs =3D=3D NULL) { > >>>>> + dev_info->qpairs =3D > >>>>> + rte_zmalloc_socket(adapter->mem_name, > >>>>> + dev_info->dev->data->nb_queue_pairs > >>>> * > >>>>> + sizeof(struct crypto_queue_pair_info), > >>>>> + 0, adapter->socket_id); > >>>>> + if (dev_info->qpairs =3D=3D NULL) > >>>>> + return -ENOMEM; > >>>>> + } > >>>>> + > >>>>> + ret =3D (*dev->dev_ops->crypto_adapter_queue_pair_add)(dev, > >>>>> + dev_info->dev, > >>>>> + queue_pair_id); > >>>> > >>>> crypto_adapter_queue_pair_add is supposed to attach a queue > >>>> (queue_pair_id) of cryptodev(dev_info->dev) to event device (dev). > >>>> But how will the underlying implementation attach it to event > >>>> device without knowing the eventdev queue_id. This information was > >>>> coming in the RFC patches with the parameter > (rte_event_crypto_queue_pair_conf). > >>>> Why is this removed and if removed how will the driver attach the qu= eue. > >>>> I can see that rte_event is passed in the session private data but > >>>> how can we attach the crypto queue with event dev queue? > >>> > >>> Yes, this was present in the first version of the RFC which is simila= r to eth rx > adapter. > >>> After couple of discussions, thread > >>> http://dpdk.org/dev/patchwork/patch/31752/), > >>> it was changed. In eth rx adapter, eth queues are mapped to > >>> eventdev, whereas in crypto adapter the sessions are mapped to > >>> eventdev. Since event info is present along with the session, the > >>> get API has to be called in respective API to get the event informati= on and > then map to eventdev. > >>> > >> > >> I think the intent of that discussion was misunderstood from our end. > >> But this is not going to work for hardware devices. > >> > >> Because in case of hardware implementation, the scheduling is done in > >> hardware and hardware cannot call the get API to get the event > >> information then map to event device. Actually the scheduling has > >> happened before the crypto_op is dequeued from the event port. So > >> there is no point of set/get private data in our case. > >> > >> We need to map the crypto queues to the event queue_ids at the time > >> of queue_pair add API. In hardware scheduler, we map n(may be 1-8) > >> crypto queues to m event queues(<=3D n). We can assign multiple > >> sessions to any crypto queue pair, and after the crypto op is > >> received by event queue, they are appropriately scheduled by hardware = to > event ports. > >> > >> Session based mapping to event queue cannot be supported. Our design > >> is same as that of eth rx adapter. > > > > Crypto queue pair to eventdev queue mapping should be supported. But > > That's a limited set. meaning if an application needs millions of > > IPSec SA sessions then we can not map it. So, IMO, If an HW/SW can not > > support session based mapping then it needs to be exposed/abstracted > through capabilities. > > > > crypto qp to event queue mapping will be supported in all adapter > > implementation. > > > > Does that sounds OK? > > >=20 > Yes, that will be fine for us. Ok. I will include this as caps in v2 patch. Regards Abhinandan >=20 > Thanks, > Akhil