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 B551FA04B5; Tue, 27 Oct 2020 20:26:08 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1D8F72BD3; Tue, 27 Oct 2020 20:26:06 +0100 (CET) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60055.outbound.protection.outlook.com [40.107.6.55]) by dpdk.org (Postfix) with ESMTP id 02EE6160 for ; Tue, 27 Oct 2020 20:26:02 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bcwC7UuL5pUNLwJN8q5S0A66Xks321kTbgjtKBbDEIPpXa0CNFC0e+wXgEUd2y361oVsbyRv4hSwvKrJtP7IoRNgP8qQMEg6slRhekbta5QvCBRhBUump64BAnf44Gp70tlAUshcPsPUl0SJ+BVOMJhfuYVKPn+Lu/MTzP9IYCe93y4rCTwD3pbOgYQhEn9UumY24PyjBVrlKlXYopun564/kTpBjL6cgrbkizCi8qQue+MOfJn02pGLUunrOVAJps30HtcfL6G+rQrQK1EudXXH1caNRonPJs6JVvgUE2v3DVrfsqjxsPN9h/YlkyIa2MLyYejYKMDOhinguDpRkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KyG3tapY0+yxG0DEa/lt9K41AFeKVoHHV5x/TZC/XRs=; b=fuPFGjEW7UjStwIe7XhjUQrhMKt9ElTm2IBMyeMAYVkKirfNI1h7k5mqFyevb1AV8Ic9zs7aEYVO71p7VKjIShNjbDVKbJoc6m8s68Kij+hBy5H08EoixG6kaHwefAoaNOfL3U6zMZRxPWWMFmKVtRS9xxAodvbaNIpPX94fugAjV3i3T3UBAcLz7vxcjpYZPRECPhlQmcTTWKy6PJLchTnhAedWReh2HByXSeYD77G3uPtVddxYm5cDuFbbNsA9KBkvF+SW7nS5PfDx2Ms92Cs3ZHgDHSJmLnnnBkC0NPUKLbqIXbB9daiBqnJAmpiOBvsBqZo116SQbPekwMzonw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KyG3tapY0+yxG0DEa/lt9K41AFeKVoHHV5x/TZC/XRs=; b=exK3fZg7L2S/hFwZ8hozx7qvwKOyQxXbpjdoWbH636/e9946x/1dQNxMbkoYk9EM2OtUbXiTAL64/wH5dnOKplbQh0Qf+Mt9TZmHDXW53F3uVv0IBnGfltu0xg47N3U985NxAOz4KRBdmWaOyjUutVEl+rwQS5LdwE8a0B1jBBM= Received: from VI1PR04MB3168.eurprd04.prod.outlook.com (2603:10a6:802:6::10) by VI1PR0402MB3693.eurprd04.prod.outlook.com (2603:10a6:803:18::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.20; Tue, 27 Oct 2020 19:26:00 +0000 Received: from VI1PR04MB3168.eurprd04.prod.outlook.com ([fe80::9513:3b55:931f:216e]) by VI1PR04MB3168.eurprd04.prod.outlook.com ([fe80::9513:3b55:931f:216e%4]) with mapi id 15.20.3499.018; Tue, 27 Oct 2020 19:26:00 +0000 From: Akhil Goyal To: "Gujjar, Abhinandan S" , "dev@dpdk.org" , "Doherty, Declan" , "Honnappa.Nagarahalli@arm.com" , "Ananyev, Konstantin" CC: "Vangati, Narender" , "jerinj@marvell.com" Thread-Topic: [v4 1/3] cryptodev: support enqueue callback functions Thread-Index: AQHWq8kYL4cZYB+DTUiYqx6FrV0786mrsotQgAAhRICAAADuEA== Date: Tue, 27 Oct 2020 19:26:00 +0000 Message-ID: References: <1603619090-118652-1-git-send-email-abhinandan.gujjar@intel.com> <1603619090-118652-2-git-send-email-abhinandan.gujjar@intel.com> In-Reply-To: Accept-Language: en-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=nxp.com; x-originating-ip: [122.162.226.234] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 28f0313f-00ed-47cf-7428-08d87aae22e5 x-ms-traffictypediagnostic: VI1PR0402MB3693: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Ye4ZiL+73a4ea8gq/Kazuz6XaC3QHVAjVvN1JHNNOuMvSwghgS64BeFIxeghabN2a4P0egi2NiJ5QGOLntLXegmqq+0AyGEtiCLpQUv/cCFfcG5oXE5XQzBBp6tyEtyPS8fSyzQ3J/sHVcsevdZQb0IV5TVhrbBFfGkInD0Gvs4Bx2D5SxUgLXFJnIGkGr82+6sUiTwEJHEi17QK/y12qLvfQwFg+f0/AcPf0T7+3gv+p+s67CyrdK/AfHPaUmaGknaSXJvDYScE9+3LPUsPXibSEfPhXMwnkncj+vy+8Z7Bg/6UgmsHLjnTGh108iDu x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB3168.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(376002)(396003)(39850400004)(346002)(366004)(4326008)(186003)(9686003)(8676002)(26005)(8936002)(33656002)(83380400001)(52536014)(2906002)(86362001)(66946007)(66446008)(7696005)(64756008)(66556008)(66476007)(478600001)(110136005)(54906003)(55016002)(44832011)(316002)(6506007)(71200400001)(5660300002)(76116006); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: 2zTiSU+fagIl/ghqD2Rr+pPOswKRbBbVYsnDCJ6BAovHDAANftSQEyKvom02iDSLRbFmOYzQEP7SHwzVoWmsUeIR6k/exlrKEHFRBMTPM8jTO3AMhuULA/QfeoU3OYn9if4WQmZm2jx3wECrb1FwKHQmRnuPtl1tEbNMvBrZUasUnD+MWMwNUEBEWS+SAoe0YEw+YMIcnbfqvRfInFlY7O+XCL4lEe79U5g0DW4JYiLin/1e18PBgbvAgNtkJcFysyZA1gRwRgrcoYjj52+vRBtq1Gw0XDOMoKXiuKG1rx5KEVjD/ApjK03AsqBY2Oe4kxtUL7rOpOhGujC2Ak9w94lJ1bDC0MpSEmAcaRW/837oTQYC+WAa1T+m33Vg7b1ANljTn42T/MuXmPL3JwXrKcAmk73nQamVq+DgTVBcCnc2kDckBIxoA84mULB5DhPJ06aQADmstqa4u5w5fVC+0FvTv7epzpR+Y0YdeGTSb8w54fiaY8FTVrFOTUm6xOXvNPMGF/eN72cpDulGBacHicRdW/12vf7uDdL2IwKYTVZx43LQlTlX0KlsIXd4tXs6e5Tz+2LwKF9bJZchNzhC6cO6p/vJ18ZTJVs/N1l1fR6uPoyFykXIUYDekuTPbehdYPjJ1D1+yk7bAPZa9bTRng== x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB3168.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 28f0313f-00ed-47cf-7428-08d87aae22e5 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Oct 2020 19:26:00.0786 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 9ZHDB2/9zrrio2+h3xUwsySyhYBOwrqsZ/nprb9CGu2NYFKGsjNSwonC1FeyidSGuQ9PJ2dNek+t0FtvgjWvEw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB3693 Subject: Re: [dpdk-dev] [v4 1/3] cryptodev: support enqueue callback functions 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 Abhinandan, > > > +static int > > > +cryptodev_cb_init(struct rte_cryptodev *dev) { > > > + struct rte_cryptodev_enq_cb_rcu *list; > > > + struct rte_rcu_qsbr *qsbr; > > > + uint16_t qp_id; > > > + size_t size; > > > + > > > + /* Max thread set to 1, as one DP thread accessing a queue-pair */ > > > + const uint32_t max_threads =3D 1; > > > + > > > + dev->enq_cbs =3D rte_zmalloc(NULL, > > > + sizeof(struct rte_cryptodev_enq_cb_rcu) * > > > + dev->data->nb_queue_pairs, 0); > > > + if (dev->enq_cbs =3D=3D NULL) { > > > + CDEV_LOG_ERR("Failed to allocate memory for callbacks"); > > > + rte_errno =3D ENOMEM; > > > + return -1; > > > + } > > > > Why not return ENOMEM here? You are not using rte_errno while returning > > from this function, so setting it does not have any meaning. > This is a internal function. The caller is returning ENOMEM. The caller can return the returned value from cryptodev_cb_init, instead of= explicitly Returning ENOMEM. There is no point of setting rte_errno here. > > > /** The data structure associated with each crypto device. */ struc= t > > > rte_cryptodev { > > > dequeue_pkt_burst_t dequeue_burst; > > > @@ -867,6 +922,10 @@ struct rte_cryptodev { > > > __extension__ > > > uint8_t attached : 1; > > > /**< Flag indicating the device is attached */ > > > + > > > + struct rte_cryptodev_enq_cb_rcu *enq_cbs; > > > + /**< User application callback for pre enqueue processing */ > > > + > > Extra line > ok > > > > We should add support for post dequeue callbacks also. Since this is an= LTS > > release And we wont be very flexible in future quarterly release, we sh= ould do > > all the changes In one go. > This patch set is driven by requirement. Recently, we have a requirement = to have > callback for dequeue as well. Looking at code freeze date, I am not sure = we can > target that as well. Let this patch go in and I will send a separate patc= h for > dequeue callback. >=20 We may not be able to change the rte_cryptodev structure so frequently. It may be allowed to change it 21.11 release. Which is too far. I think atleast the cryptodev changes can go in RC2 and test app for deq cb= s Can go in RC3 if not RC2. > > I believe we should also double check with techboard if this is an ABI = breakage. > > IMO, it is ABI breakage, rte_cryprodevs is part of stable APIs, but not= sure. > > > > > } __rte_cache_aligned; > > > > > > > > > +#ifdef RTE_CRYPTO_CALLBACKS > > > +/** > > > + * @warning > > > + * @b EXPERIMENTAL: this API may change without prior notice > > > + * > > > + * Add a user callback for a given crypto device and queue pair whic= h > > > +will be > > > + * called on crypto ops enqueue. > > > + * > > > + * This API configures a function to be called for each burst of > > > +crypto ops > > > + * received on a given crypto device queue pair. The return value is > > > +a pointer > > > + * that can be used later to remove the callback using > > > + * rte_cryptodev_remove_enq_callback(). > > > + * > > > + * Multiple functions are called in the order that they are added. > > > > Is there a limit for the number of cbs that can be added? Better to add= a > > Comment here. I think you missed this comment.