[ovs-dev] [RFC PATCH v2 01/10] acinclude.m4: Support compilation of libIPsec.

Ben Pfaff blp at ovn.org
Tue Oct 31 21:40:19 UTC 2017


On Fri, Aug 25, 2017 at 05:40:23PM +0100, Ian Stokes wrote:
> LibIpsecMB is required to enable the use of vdev cryptodev devices in
> DPDK. This patch adds a condition to check for the library when it is
> detected that ONFIG_RTE_LIBRTE_PMD_AESNI_MB=y is enabled in the DPDK
> config.
> 
> Signed-off-by: Ian Stokes <ian.stokes at intel.com>
> ---
>  acinclude.m4 |   13 +++++++++++++
>  1 files changed, 13 insertions(+), 0 deletions(-)
> 
> diff --git a/acinclude.m4 b/acinclude.m4
> index aeb594a..8c14367 100644
> --- a/acinclude.m4
> +++ b/acinclude.m4
> @@ -271,6 +271,19 @@ AC_DEFUN([OVS_CHECK_DPDK], [
>         ], [],
>         [AC_DEFINE([DPDK_PDUMP], [1], [DPDK pdump enabled in OVS.])])
>       ])
> +    AC_COMPILE_IFELSE([
> +      AC_LANG_PROGRAM(
> +        [
> +          #include <rte_config.h>
> +#if RTE_LIBRTE_PMD_AESNI_MB
> +#error
> +#endif
> +        ], [])
> +      ], [],
> +      [AC_SEARCH_LIBS([init_mb_mgr_sse],[IPSec_MB],[],[AC_MSG_ERROR([unable to find lib_IPSec_MB in ${LDFLAGS}, install the dependency package])])
> +       DPDK_EXTRA_LIB="-lIPSec_MB"
> +       AC_DEFINE([PMD_AESNI_MB], [1], [PMD_AESNI_MB support detected in DPDK.])])
> +

It is a little unusual to make a test fail when a feature
(RTE_LIBRTE_PMD_AESNI_MB in this case) is detected.  This makes the
feature prone to being detected if something unrelated fails in the
toolchain.  Usually, one would either use the opposite approach--that
is, fail if RTE_LIBRTE_PMD_AESNI_MB is not declared--or something based
on AC_CHECK_DECL or AC_LINK_IFELSE using some symbol that
RTE_LIBRTE_PMD_AESNI_MB makes available.

Also, I recommend adding an explanation of this dependency to the
documentation, otherwise this will be confusing to users.

Thanks,

Ben.


More information about the dev mailing list