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 11842A04B5; Tue, 27 Oct 2020 20:42:43 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 508332BD3; Tue, 27 Oct 2020 20:42:41 +0100 (CET) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 3F48B160 for ; Tue, 27 Oct 2020 20:42:38 +0100 (CET) IronPort-SDR: jstq3YnvBdfNPZyamq2OUduVcxpNpRcp2qIS9bZSst/tMACCqpuYx59KXH38drBWCt4RwYStIN JuLtCF1VQ7ww== X-IronPort-AV: E=McAfee;i="6000,8403,9787"; a="229791525" X-IronPort-AV: E=Sophos;i="5.77,424,1596524400"; d="scan'208";a="229791525" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Oct 2020 12:42:36 -0700 IronPort-SDR: KSbSoFuDIj4j76y2jNFxUlC7b20YgyRMQMvcPIwqzS5GO3WGT1L3OecoWrdsQxwpEkiSuUTRtp 4s9VAqnv0zIA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,424,1596524400"; d="scan'208";a="303871734" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by fmsmga008.fm.intel.com with ESMTP; 27 Oct 2020 12:42:35 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 27 Oct 2020 12:42:35 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Tue, 27 Oct 2020 12:42:35 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.168) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Tue, 27 Oct 2020 12:42:31 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hpsSF4zftNRHrFEcvlWdwSI8t4hNTGtdQ38ipJLqPf8yw/Y0TzKjCpOR5MSpot3t63SBNYujIGR0IKSwWcp1NGxxWS/6RvVH1p3hqf/tytjIkv79YXGBl/47JXsTuWEhwYAylDVv8iKrJTAUF+TNJBZ8UfPneKm8eHVD5uH0uo9Wmh+JwQDIKm9VMTipFEZhQF91v+0wNV1WkAxF3jMJnvpFeZ8X4QUY2V794HvBzeCBccsLPWMOjh3CICtHy+glwK2W4+2NurVxXr+w+wH8/cQiJYBKMLcv4LsPjyZDYUKwbRRoDaN4W+fgPTkgpsR3dpPe5ESs/uBJK+OXUaII3g== 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=IubM20W22zToAysbvJYZmgLq0yMXLyn/4NaxlHLYecA=; b=DovvMuSf9ek9456aMj+Kb+yHF00i+S/NYHlJwRiTKDPyuC4+9lNv2cmoi0vsVkR/CeIjb5CzHDgpoMFL4uN5haQ21130+7mOQs6YI1t3sR3fbuyTi651QgaCNI1R+eowWctJjz/1auyrlEGKGEVaST5KJb5vt38N2p1vvzUWZN4DX5LpPoR13DkaPF/WWKsx288XtKC8l2FXDmCPrgHra8ZX4hF6Ift7MwVNvVEYM8Aqx6O4aoIkljfTYVhqu8UDn7xvnmjZF2N7l/5AcfedKyWg+2DlcVVAejhHR857OqPx/oap7SJkiV0ExVwl6beOQGt8ff/VGFdPfq2868YrBQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IubM20W22zToAysbvJYZmgLq0yMXLyn/4NaxlHLYecA=; b=roXYLMZJDJLVYhdxdV24Pk9sNutL8Qo+Y3Wmqje2bb8wJpoLXerXq5JLpF0W14z5IkyER0DWq084xYK0xTyd4SqCh/JT3I19bGjjGO0AI+zEgJm2VF6XlDNEwC/NI7T4lIoJqtf3+umlyusOjzWOORHv+WUxD8WoUu1ujVdOVSU= Received: from MWHPR11MB1838.namprd11.prod.outlook.com (2603:10b6:300:10c::11) by CO1PR11MB5137.namprd11.prod.outlook.com (2603:10b6:303:95::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18; Tue, 27 Oct 2020 19:41:59 +0000 Received: from MWHPR11MB1838.namprd11.prod.outlook.com ([fe80::20fb:cc03:ce89:f0ea]) by MWHPR11MB1838.namprd11.prod.outlook.com ([fe80::20fb:cc03:ce89:f0ea%7]) with mapi id 15.20.3499.018; Tue, 27 Oct 2020 19:41:59 +0000 From: "Gujjar, Abhinandan S" To: Akhil Goyal , "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: AQHWq8khg/yqaE27MkanYRdfhPnwbqmrw70AgAAN2NCAAATZAIAAASVQ Date: Tue, 27 Oct 2020 19:41:59 +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-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [157.49.168.0] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2df60a2a-632a-4236-9442-08d87ab05ee0 x-ms-traffictypediagnostic: CO1PR11MB5137: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: sJd+gNdCBuAMrbVv03hFrXO0vxnUmPYDdgs/yRgTu5xNJWVRx++x158jsiJ1HtHr+MyuXFIPr2lxbKk8sYmDZvBEDbVqTobUnIbihbXZcs98cabsJYgenmzjju97x4+YT3wR7H05GYcaiP0QXAGc+2465gBfukyUmm03XRZx9ZMuETrAU+oXIuyGNF7mn0CEVXgk4OgZsFerNzWlut/hI+TWm/k6MZKg3bs/yjdX5y2uwnKJsSORmktIu9PJUOQoEesOt49hGKsZ6mg8DuHDAYdNwCKfO6HxgUTxgB/ECjDfNu82vPoWGj8Fq3UAe3UQ x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR11MB1838.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(366004)(396003)(346002)(136003)(376002)(71200400001)(26005)(5660300002)(4326008)(52536014)(83380400001)(33656002)(6636002)(6506007)(76116006)(66446008)(64756008)(66476007)(66556008)(66946007)(55016002)(8676002)(53546011)(9686003)(478600001)(8936002)(186003)(2906002)(54906003)(7696005)(86362001)(110136005)(316002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: +HGTkYz6rfZ/YJUuNmGeSUiGaOFDH0vSWhe+8N8SzHH2S9DBiW/jzkGnOdg2VcJzpguFhGHCs5yvE7sr9LmMkTno8ibGZHjmc4sTpWRIc2HE0yvpmrdWWQJz5m5AgUJICRBGd3jex2Onsa/1HWCTZaWCIMoWuBZLX0mlJfbwWdqbzAHuCiwkX2SjuDmvSrjJnqm/RK7uZCEv3DXmtDHe66lYT2lvDLvz16R129TNa61IWyxlq5oZrcx5+ZleekW9rPj7WD0IOoWGNBKRVArRGKJDe6Jt48gZ7JivLKNvAzrdKpT7p+gYLDnJe5bkaymnFoj7vSfzNiyI54wsRHIRi58uPuk3Uydiim0jhm+6h0LjHFYOC76Lfi/wVk6hKkSg2OyXjNsu6e/QE+kWR93tHM9OP7siVk/EEYyg9pIfOebujxQumMLfqDUxzxxdEv/OGQtwkNmmQvwJe4Gvsyid6yLD+Uk7PZVcSyMFbVrqpGolL7Oi8HMytqRrDgagtvHEKCaWfBsX1jGz/X5UXToZxT1c84YrVLGPJVBuYQXHIhNGJuesTNMJtvLcRNntvUoe/ZmyiyCW9T6kQMV9o4Txa2V8fZVinZ5dIz+KZo9bEZvpjOB+q5yzlWyug4FQIZ9EKl4W0+Hum7bRVgs05bSs3Q== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MWHPR11MB1838.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2df60a2a-632a-4236-9442-08d87ab05ee0 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Oct 2020 19:41:59.6354 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: PJksq7RJ9cKEJZrJi80JX+XmmCt3SXZIl7yx2nVFRaN8bPAYyys3W4oEghnAfc78CqUCgGRJGaE5Dwvtp3Bfh/cGNc4vCwSDXPRZbbIcfX0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR11MB5137 X-OriginatorOrg: intel.com 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 Akhil, > -----Original Message----- > From: Akhil Goyal > Sent: Wednesday, October 28, 2020 12:56 AM > To: Gujjar, Abhinandan S ; dev@dpdk.org; > Doherty, Declan ; > Honnappa.Nagarahalli@arm.com; Ananyev, Konstantin > > Cc: Vangati, Narender ; jerinj@marvell.com > Subject: RE: [v4 1/3] cryptodev: support enqueue callback functions >=20 > Hi Abhinandan, >=20 > > > > +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. >=20 > 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. Ok. I will update the patch. >=20 >=20 > > > > /** The data structure associated with each crypto device. */ > > > > struct 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 should 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 patch 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 = cbs > Can go in RC3 if not RC2. " cryptodev changes " -> Is it rte_cryptodev structure changes alone or sup= porting dequeue callback as well in RC2? And then have test app changes in RC3? If it is about adding dequeue callback support in RC2, I will try. If it does not work, hope we can still the get the enqueue callback + rte_c= ryptodev structure changes to support dequeue callbacks in the next patch set. >=20 > > > I believe we should also double check with techboard if this is an AB= I > breakage. > > > IMO, it is ABI breakage, rte_cryprodevs is part of stable APIs, but n= ot sure. > > > > > > > } __rte_cache_aligned; > > > > >=20 >=20 >=20 > > > > > > > > +#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 > > > > +which 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. >=20 > I think you missed this comment. There is not limitation as of now. I will add a comment on the same. >=20