From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id BA335A0487 for ; Thu, 4 Jul 2019 07:03:40 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 01513325F; Thu, 4 Jul 2019 07:03:40 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id F15D71041 for ; Thu, 4 Jul 2019 07:03:38 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Jul 2019 22:03:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,449,1557212400"; d="scan'208";a="166173370" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga007.fm.intel.com with ESMTP; 03 Jul 2019 22:03:37 -0700 Received: from fmsmsx120.amr.corp.intel.com (10.18.124.208) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 3 Jul 2019 22:03:37 -0700 Received: from bgsmsx104.gar.corp.intel.com (10.223.4.190) by fmsmsx120.amr.corp.intel.com (10.18.124.208) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 3 Jul 2019 22:03:37 -0700 Received: from bgsmsx101.gar.corp.intel.com ([169.254.1.46]) by BGSMSX104.gar.corp.intel.com ([169.254.5.156]) with mapi id 14.03.0439.000; Thu, 4 Jul 2019 10:33:33 +0530 From: "Varghese, Vipin" To: Akhil Goyal , "Wiles, Keith" , "dev@dpdk.org" , "De Lara Guarch, Pablo" , "Doherty, Declan" CC: "Padubidri, Sanjay A" Thread-Topic: [PATCH v2 1/2] lib/crypto: add callback handlers for crypto Thread-Index: AQHVH1Xrlw/XLk/mr0GZ9mWNejFxXqavTXYAgAqtEeA= Date: Thu, 4 Jul 2019 05:03:33 +0000 Message-ID: <4C9E0AB70F954A408CC4ADDBF0F8FA7D4D38BA22@BGSMSX101.gar.corp.intel.com> References: <20190610050352.83349-1-vipin.varghese@intel.com> <20190610063026.89020-1-vipin.varghese@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYzQxNzQ1NTctYjY3Zi00MGJhLWIyNDEtMGM1ODQ0ZTc3YzczIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiZ3BrTnhVcFRITCt2K3hcLytoWk5IZVwvRXNwdElnT1JtWWdKQ1NuM0g2XC9meVFGNXBocFVGbFZZTmNHbGVxOVFLTiJ9 dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.223.10.10] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2 1/2] lib/crypto: add callback handlers for crypto 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Thanks Akhil, I will work on the suggested inputs. > -----Original Message----- > From: Akhil Goyal > Sent: Thursday, June 27, 2019 7:55 PM > To: Varghese, Vipin ; Wiles, Keith > ; dev@dpdk.org; De Lara Guarch, Pablo > ; Doherty, Declan > > Cc: Padubidri, Sanjay A > Subject: RE: [PATCH v2 1/2] lib/crypto: add callback handlers for crypto >=20 > Hi Vipin, >=20 > > > > Add callback handlers for enqueue-dequeue operation on crypto device. > > The pre-enqueue and post-dequeue are selected on invoke user > > registered callback functions. > > > > Use cases: > > - allow user to investigate the contents pre-enqueue. > > - allow user to investigate the contents post-dequeue. > > - modify pre-enqueue and post-dequeue stage content. > > - investigate PMD meta data. > > > > Signed-off-by: Vipin Varghese > > --- >=20 > [..] >=20 > > @@ -907,6 +926,19 @@ rte_cryptodev_dequeue_burst(uint8_t dev_id, > > uint16_t qp_id, > > nb_ops =3D (*dev->dequeue_burst) > > (dev->data->queue_pairs[qp_id], ops, nb_ops); > > > > +#ifdef RTE_CRYPTODEV_ENQDEQ_CALLBACKS > > + struct rte_cryptodev_enqdeq_callback *cb =3D NULL; > > + > > + TAILQ_FOREACH(cb, &(dev->deq_cbs), next) { > > + if (cb->cb_fn =3D=3D NULL) > > + continue; > > + > > + cb->active =3D 1; > > + nb_ops =3D cb->cb_fn(dev_id, qp_id, ops, nb_ops, cb->cb_arg); > > + cb->active =3D 0; > > + } >=20 > Shouldn't this cb->active be set atomically. >=20 > Will it be thread safe? There may be multiple threads enqueuing on the sa= me > device. > One may be executing while the other finished and set the active to 0, an= d may > unregister While the some other thread is still executing. >=20 > One more thing, it would be better to have a debug prints about how many > nb_ops have been Successfully passed through each of the callback. > And in the callback, it should be assumed that it will return back just a= fter the first > failed ops, so that The application can free the remaining one. This shou= ld be > documented in the callback API. >=20 > > +#endif > > + > > return nb_ops; > > } > >