[PATCH v2] cryptodev: fix C++ include

Mattias Rönnblom hofors at lysator.liu.se
Thu Dec 19 17:34:34 CET 2024


On 2024-12-19 14:30, Thomas Monjalon wrote:
> Some cryptodev functions were not included in an extern "C" block.
> 
> There are 2 blocks, the second one being fast path inline functions,
> preceded with an include of the required rte_cryptodev_core.h file.
> 
> Fixes: 719834a6849e ("use C linkage where appropriate in headers")
> Cc: stable at dpdk.org
> 
> Reported-by: Zhigang Hu <zhigang.hu at intel.com>
> Signed-off-by: Thomas Monjalon <thomas at monjalon.net>
> ---
> v2: keep rte_cryptodev_core.h include at the same place
> ---
>   .mailmap                      |  1 +
>   lib/cryptodev/rte_cryptodev.h | 12 ++++++++++--
>   2 files changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/.mailmap b/.mailmap
> index 2bf38f9e8c..1e4bb06d6e 100644
> --- a/.mailmap
> +++ b/.mailmap
> @@ -1794,6 +1794,7 @@ Zhenghua Zhou <zhenghuax.zhou at intel.com>
>   Zhenning Xiao <zhenning.xiao at intel.com>
>   Zhe Tao <zhe.tao at intel.com>
>   Zhichao Zeng <zhichaox.zeng at intel.com>
> +Zhigang Hu <zhigang.hu at intel.com>
>   Zhigang Lu <zlu at ezchip.com>
>   Zhiguang He <hezhiguang3 at huawei.com>
>   Zhihong Peng <zhihongx.peng at intel.com>
> diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.h
> index c64d2f83a0..071ff3dbdf 100644
> --- a/lib/cryptodev/rte_cryptodev.h
> +++ b/lib/cryptodev/rte_cryptodev.h
> @@ -22,6 +22,10 @@
>   
>   #include "rte_cryptodev_trace_fp.h"
>   
> +#ifdef __cplusplus
> +extern "C" {
> +#endif
> +
>   /**
>    * @internal Logtype used for cryptodev related messages.
>    */
> @@ -1928,11 +1932,16 @@ int rte_cryptodev_remove_deq_callback(uint8_t dev_id,
>   				      uint16_t qp_id,
>   				      struct rte_cryptodev_cb *cb);
>   
> -#include <rte_cryptodev_core.h>
> +#ifdef __cplusplus
> +}
> +#endif
> +
> +#include "rte_cryptodev_core.h"
>   
>   #ifdef __cplusplus
>   extern "C" {
>   #endif
> +
>   /**
>    *
>    * Dequeue a burst of processed crypto operations from a queue on the crypto
> @@ -2125,7 +2134,6 @@ rte_cryptodev_qp_depth_used(uint8_t dev_id, uint16_t qp_id)
>   	return rc;
>   }
>   
> -
>   #ifdef __cplusplus
>   }
>   #endif

Reviewed-by: Mattias Rönnblom <mattias.ronnblom at ericsson.com>



More information about the stable mailing list