[dpdk-dev] doc: announce API change in crypto driver allocation

Message ID 20170803010236.17503-1-pablo.de.lara.guarch@intel.com (mailing list archive)
State Accepted, archived
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

De Lara Guarch, Pablo Aug. 3, 2017, 1:02 a.m. UTC
  rte_cryptodev_allocate_driver() function gets one parameter
(rte_driver), as the cryptodev_driver structure is
allocated inside the function with rte_malloc.

This function is called from a constructor function,
when crypto PMDs are registered.
If malloc fails, there is no way to recover from it,
so it is better to allocate this structure
statically, in each PMD.

Therefore, it is required to add an extra parameter in
this function, to also get a pointer to this structure.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
 doc/guides/rel_notes/deprecation.rst | 6 ++++++
 1 file changed, 6 insertions(+)
  

Comments

John McNamara Aug. 3, 2017, 10:39 a.m. UTC | #1
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Pablo de Lara
> Sent: Thursday, August 3, 2017 2:03 AM
> To: thomas@monjalon.net; jerin.jacob@caviumnetworks.com;
> akhil.goyal@nxp.com; hemant.agrawal@nxp.com; Trahe, Fiona
> <fiona.trahe@intel.com>; Jain, Deepak K <deepak.k.jain@intel.com>;
> Griffin, John <john.griffin@intel.com>; Doherty, Declan
> <declan.doherty@intel.com>
> Cc: dev@dpdk.org; De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>
> Subject: [dpdk-dev] [PATCH] doc: announce API change in crypto driver
> allocation
> 
> rte_cryptodev_allocate_driver() function gets one parameter (rte_driver),
> as the cryptodev_driver structure is allocated inside the function with
> rte_malloc.
> 
> This function is called from a constructor function, when crypto PMDs are
> registered.
> If malloc fails, there is no way to recover from it, so it is better to
> allocate this structure statically, in each PMD.
> 
> Therefore, it is required to add an extra parameter in this function, to
> also get a pointer to this structure.
> 
> Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

Acked-by: John McNamara <john.mcnamara@intel.com>
  
Akhil Goyal Aug. 3, 2017, 10:43 a.m. UTC | #2
On 8/3/2017 6:32 AM, Pablo de Lara wrote:
> rte_cryptodev_allocate_driver() function gets one parameter
> (rte_driver), as the cryptodev_driver structure is
> allocated inside the function with rte_malloc.
> 
> This function is called from a constructor function,
> when crypto PMDs are registered.
> If malloc fails, there is no way to recover from it,
> so it is better to allocate this structure
> statically, in each PMD.
> 
> Therefore, it is required to add an extra parameter in
> this function, to also get a pointer to this structure.
> 
> Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
> ---
>   doc/guides/rel_notes/deprecation.rst | 6 ++++++
>   1 file changed, 6 insertions(+)
> 
> diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
> index f6bd910..bd4aa89 100644
> --- a/doc/guides/rel_notes/deprecation.rst
> +++ b/doc/guides/rel_notes/deprecation.rst
> @@ -69,3 +69,9 @@ Deprecation Notices
>     be removed in 17.11:
>   
>     - ``rte_cryptodev_create_vdev``
> +
> +* cryptodev: the following function will have an extra parameter, passing a
> +  statically allocated crypto driver structure, instead of calling malloc,
> +  in 17.11:
> +
> +  - ``rte_cryptodev_allocate_driver``
> 
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
  
Deepak Kumar JAIN Aug. 3, 2017, 2:14 p.m. UTC | #3
> -----Original Message-----
> From: De Lara Guarch, Pablo
> Sent: Thursday, August 3, 2017 2:03 AM
> To: thomas@monjalon.net; jerin.jacob@caviumnetworks.com;
> akhil.goyal@nxp.com; hemant.agrawal@nxp.com; Trahe, Fiona
> <fiona.trahe@intel.com>; Jain, Deepak K <deepak.k.jain@intel.com>;
> Griffin, John <john.griffin@intel.com>; Doherty, Declan
> <declan.doherty@intel.com>
> Cc: dev@dpdk.org; De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>
> Subject: [PATCH] doc: announce API change in crypto driver allocation
> 
> rte_cryptodev_allocate_driver() function gets one parameter (rte_driver), as
> the cryptodev_driver structure is allocated inside the function with
> rte_malloc.
> 
> This function is called from a constructor function, when crypto PMDs are
> registered.
> If malloc fails, there is no way to recover from it, so it is better to allocate this
> structure statically, in each PMD.
> 
> Therefore, it is required to add an extra parameter in this function, to also
> get a pointer to this structure.
> 
>    - ``rte_cryptodev_create_vdev``
> +
> +* cryptodev: the following function will have an extra parameter,
> +passing a
> +  statically allocated crypto driver structure, instead of calling
> +malloc,
> +  in 17.11:
> +
> +  - ``rte_cryptodev_allocate_driver``
> --
> 2.9.4
Acked-by: Deepak Kumar Jain <Deepak.k.jain@intel.com>
  
Thomas Monjalon Aug. 8, 2017, 10:21 a.m. UTC | #4
03/08/2017 12:43, Akhil Goyal:
> On 8/3/2017 6:32 AM, Pablo de Lara wrote:
> > rte_cryptodev_allocate_driver() function gets one parameter
> > (rte_driver), as the cryptodev_driver structure is
> > allocated inside the function with rte_malloc.
> > 
> > This function is called from a constructor function,
> > when crypto PMDs are registered.
> > If malloc fails, there is no way to recover from it,
> > so it is better to allocate this structure
> > statically, in each PMD.
> > 
> > Therefore, it is required to add an extra parameter in
> > this function, to also get a pointer to this structure.
> > 
> > Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
> > 
> Acked-by: Akhil Goyal <akhil.goyal@nxp.com>

Applied, thanks
  

Patch

diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index f6bd910..bd4aa89 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -69,3 +69,9 @@  Deprecation Notices
   be removed in 17.11:
 
   - ``rte_cryptodev_create_vdev``
+
+* cryptodev: the following function will have an extra parameter, passing a
+  statically allocated crypto driver structure, instead of calling malloc,
+  in 17.11:
+
+  - ``rte_cryptodev_allocate_driver``