From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 74662A0471 for ; Fri, 21 Jun 2019 09:06:54 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0A9CD1D533; Fri, 21 Jun 2019 09:06:53 +0200 (CEST) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20059.outbound.protection.outlook.com [40.107.2.59]) by dpdk.org (Postfix) with ESMTP id EC1471D531 for ; Fri, 21 Jun 2019 09:06:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AqOdGdeG4Zwb9Ji7mf+74whytXTBRAPXvirfmdmBMQk=; b=5H+O4b1mVb1o+wLXbBltXy51r6LgJKw4SVFBHbGYyIDg5sQ9hp9ANzSgAbQ05pA7HbQ1+kdd2AacDbhjgs2ikdsoSYkomiBWHvrseWiV4p/XyvJhP96kaT81677XRpM/PbD+q2u1SPqEHXbVZRb5o1u7x/edZBgJEdn/B75u2gs= Received: from AM0PR08MB4418.eurprd08.prod.outlook.com (20.179.35.207) by AM0PR08MB4546.eurprd08.prod.outlook.com (20.179.36.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1987.15; Fri, 21 Jun 2019 07:06:49 +0000 Received: from AM0PR08MB4418.eurprd08.prod.outlook.com ([fe80::3d70:79e6:7ede:4ab2]) by AM0PR08MB4418.eurprd08.prod.outlook.com ([fe80::3d70:79e6:7ede:4ab2%7]) with mapi id 15.20.1987.014; Fri, 21 Jun 2019 07:06:49 +0000 From: "Ruifeng Wang (Arm Technology China)" To: Vipin Varghese , "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" , nd Thread-Topic: [dpdk-dev] [PATCH v2 2/2] examples/l2fwd-crypto: add callback handlers Thread-Index: AQHVH1XwZp73L4UtRkGXrZYX8Lsi8qalwFKw Date: Fri, 21 Jun 2019 07:06:49 +0000 Message-ID: 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: <20190610063026.89020-2-vipin.varghese@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: 507bc7ed-64d9-4722-8500-5eee9f305b3f.0 x-checkrecipientchecked: true authentication-results: spf=none (sender IP is ) smtp.mailfrom=Ruifeng.Wang@arm.com; x-originating-ip: [113.29.88.7] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 6b2a50dc-86c0-45f8-1e65-08d6f61707ef x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020); SRVR:AM0PR08MB4546; x-ms-traffictypediagnostic: AM0PR08MB4546: x-ld-processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr nodisclaimer: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1284; x-forefront-prvs: 0075CB064E x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(396003)(346002)(136003)(366004)(39850400004)(189003)(199004)(13464003)(99286004)(2906002)(74316002)(64756008)(33656002)(66476007)(5660300002)(14454004)(66446008)(11346002)(476003)(6246003)(186003)(478600001)(73956011)(7736002)(25786009)(305945005)(66946007)(76116006)(6436002)(256004)(66556008)(7696005)(81166006)(4326008)(102836004)(8936002)(2501003)(68736007)(81156014)(54906003)(86362001)(76176011)(53936002)(2201001)(3846002)(72206003)(71190400001)(52536014)(316002)(6506007)(9686003)(26005)(53546011)(6116002)(55016002)(110136005)(55236004)(66066001)(229853002)(446003)(71200400001)(486006); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR08MB4546; H:AM0PR08MB4418.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: FSbQkpzuJza+9FL5LIoxET7jM0kO0M6zIw+5uS2wK2uLASOsoxqZYVeHT/s8PFFeqyqLBtc/cHPXoAkCHOmEfiEOg9/5T336tTN/S2vTTjerxOeGleiA4Ry0Nkas3BY7v1+k5mwcpYnaX0OKPoEgEnBbeVkCBN9SusRXKkXmGwMrF2bgL6teqQ/eO00pPLEt0SliiWQcyflzhT5PyUfg4fR5lVMdNls7PDQLwmuWwb+rzHN5LFk2uLbSHsrXtf3wN1iY2ZAN0cemneW1hyNu+019oxSulDc+qhYHtQuAiENgGGOcPKoXHQxw4i272jnUFQJXc5sp8G37dn/I2tXQbidx7WQt5DVEDT8r4qjYQ91uhL5tcHyPWsHpTmPPOdXbarfs1Kg/tjjKqqzA8zOjZhD5CSzQrIUXKpEoCxHWX7Q= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6b2a50dc-86c0-45f8-1e65-08d6f61707ef X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jun 2019 07:06:49.6046 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Ruifeng.Wang@arm.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB4546 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" Hi, > -----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 >=20 > Register user callback handlers for pre-enqueue and pst-dequeue for crypt= o > device instance 0 with port 0. >=20 > Signed-off-by: Vipin Varghese > --- > examples/l2fwd-crypto/main.c | 38 > ++++++++++++++++++++++++++++++++++++ > 1 file changed, 38 insertions(+) >=20 > 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; >=20 > +#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); > } >=20 > +#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; > } >=20 > +#ifdef RTE_CRYPTODEV_ENQDEQ_CALLBACKS > + ret =3D rte_cryptodev_preenq_callback_unregister(0, 0, dump_crypto, > NULL); > + if (ret !=3D 0) > + printf(" faield Observed typo here 'faield' -> 'failed' ;) > 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