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 E5BB5A0487 for ; Thu, 4 Jul 2019 07:04:07 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B890A1F28; Thu, 4 Jul 2019 07:04:07 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id D2C851BE0 for ; Thu, 4 Jul 2019 07:04:05 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Jul 2019 22:04:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,449,1557212400"; d="scan'208";a="166734040" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga003.jf.intel.com with ESMTP; 03 Jul 2019 22:04:04 -0700 Received: from fmsmsx154.amr.corp.intel.com (10.18.116.70) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 3 Jul 2019 22:04:03 -0700 Received: from bgsmsx151.gar.corp.intel.com (10.224.48.42) by FMSMSX154.amr.corp.intel.com (10.18.116.70) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 3 Jul 2019 22:04:04 -0700 Received: from bgsmsx101.gar.corp.intel.com ([169.254.1.46]) by BGSMSX151.gar.corp.intel.com ([169.254.3.145]) with mapi id 14.03.0439.000; Thu, 4 Jul 2019 10:34:00 +0530 From: "Varghese, Vipin" To: "Ruifeng Wang (Arm Technology China)" , "Wiles, Keith" , "dev@dpdk.org" , "De Lara Guarch, Pablo" , "Akhil.goyal@nxp.com" , "Doherty, Declan" CC: "Padubidri, Sanjay A" , nd Thread-Topic: [dpdk-dev] [PATCH v2 2/2] examples/l2fwd-crypto: add callback handlers Thread-Index: AQHVKAABm13UOaDe/0iu+eKdmD2uoaa5+7OA Date: Thu, 4 Jul 2019 05:03:59 +0000 Message-ID: <4C9E0AB70F954A408CC4ADDBF0F8FA7D4D38BA32@BGSMSX101.gar.corp.intel.com> References: <20190610050352.83349-1-vipin.varghese@intel.com> <20190610063026.89020-1-vipin.varghese@intel.com> <20190610063026.89020-2-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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYjlhMGVhNzktMzM1Yy00MTM1LTkzYzYtNDk2ZGZjZGI1NzEyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiNld5Sld0cEhRSWJxYnpEYjhTYVAxTGh3RjdXR2RNZjVEY0FMNmV5ak1INDlXTUhuclFVSkI5SFZMdlJSM3EzXC8ifQ== 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 2/2] examples/l2fwd-crypto: add callback handlers 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 Ruifeng, will work on the suggested changes. > -----Original Message----- > From: Ruifeng Wang (Arm Technology China) > Sent: Friday, June 21, 2019 12:37 PM > To: Varghese, Vipin ; Wiles, Keith > ; dev@dpdk.org; De Lara Guarch, Pablo > ; Akhil.goyal@nxp.com; Doherty, Declan > > Cc: Padubidri, Sanjay A ; nd > Subject: RE: [dpdk-dev] [PATCH v2 2/2] examples/l2fwd-crypto: add callbac= k > handlers >=20 > Hi, >=20 > > -----Original Message----- > > From: dev On Behalf Of Vipin Varghese > > Sent: Monday, June 10, 2019 14:30 > > To: keith.wiles@intel.com; dev@dpdk.org; > > pablo.de.lara.guarch@intel.com; Akhil.goyal@nxp.com; > > declan.doherty@intel.com > > Cc: sanjay.padubidri@intel.com; Vipin Varghese > > > > Subject: [dpdk-dev] [PATCH v2 2/2] examples/l2fwd-crypto: add callback > > handlers > > > > Register user callback handlers for pre-enqueue and pst-dequeue for > > crypto device instance 0 with port 0. > > > > Signed-off-by: Vipin Varghese > > --- > > examples/l2fwd-crypto/main.c | 38 > > ++++++++++++++++++++++++++++++++++++ > > 1 file changed, 38 insertions(+) > > > > diff --git a/examples/l2fwd-crypto/main.c > > b/examples/l2fwd-crypto/main.c index e282cb7bf..c42b352f8 100644 > > --- a/examples/l2fwd-crypto/main.c > > +++ b/examples/l2fwd-crypto/main.c > > @@ -255,6 +255,22 @@ struct l2fwd_crypto_statistics > > crypto_statistics[RTE_CRYPTO_MAX_DEVS]; > > /* default period is 10 seconds */ > > static int64_t timer_period =3D 10 * TIMER_MILLISECOND * 1000; > > > > +#ifdef RTE_CRYPTODEV_ENQDEQ_CALLBACKS static uint16_t > > +dump_crypto(__rte_unused uint8_t dev_id, > > + __rte_unused uint8_t qp_id, > > + __rte_unused struct rte_crypto_op **ops, > > + __rte_unused uint16_t nb_ops, > > + __rte_unused void *cb_arg) > > +{ > > + if (nb_ops) > > + RTE_LOG(DEBUG, L2FWD, " dev_id (%u) qp_id (%u)" > > + " ops (%p) nb_ops (%u)\n", > > + dev_id, qp_id, ops, nb_ops); > > + > > + return nb_ops; > > +} > > +#endif > > + > > /* Print out statistics on packets dropped */ static void > > print_stats(void) > > @@ -2783,6 +2799,18 @@ main(int argc, char **argv) > > (unsigned)cdev_id); > > } > > > > +#ifdef RTE_CRYPTODEV_ENQDEQ_CALLBACKS > > + ret =3D rte_cryptodev_preenq_callback_register(0, 0, dump_crypto, > > NULL); > > + if (ret !=3D 0) > > + RTE_LOG(ERR, L2FWD, " failed to preenq callback register\n"); > > + RTE_LOG(INFO, L2FWD, " preenq callback register success\n"); > > + > > + ret =3D rte_cryptodev_pstdeq_callback_register(0, 0, dump_crypto, > > NULL); > > + if (ret !=3D 0) > > + RTE_LOG(ERR, L2FWD, " failed to pstdeq callback register\n"); > > + RTE_LOG(INFO, L2FWD, " pstdeq callback register success\n"); #endif > > + > > /* launch per-lcore init on every lcore */ > > rte_eal_mp_remote_launch(l2fwd_launch_one_lcore, (void *)&options, > > CALL_MASTER); > > @@ -2791,5 +2819,15 @@ main(int argc, char **argv) > > return -1; > > } > > > > +#ifdef RTE_CRYPTODEV_ENQDEQ_CALLBACKS > > + ret =3D rte_cryptodev_preenq_callback_unregister(0, 0, dump_crypto, > > NULL); > > + if (ret !=3D 0) > > + printf(" faield >=20 > Observed typo here 'faield' -> 'failed' ;) >=20 > > rte_cryptodev_preenq_callback_unregister\n"); > > + > > + ret =3D rte_cryptodev_pstdeq_callback_unregister(0, 0, dump_crypto, > > NULL); > > + if (ret !=3D 0) > > + printf(" failed > > rte_cryptodev_pstdeq_callback_unregister\n"); > > +#endif > > + > > return 0; > > } > > -- > > 2.17.1