On 12/03/2015 06:02 PM, Matan Barak wrote:
> Always inline isn't supported by every compiler. Adding it to
> configure.ac in order to support it only when possible.
> Inline other poll_one data path functions in order to eliminate
> "ifs".
> 
> Signed-off-by: Matan Barak <[email protected]>
> ---
>  configure.ac | 17 +++++++++++++++++
>  src/cq.c     | 42 +++++++++++++++++++++++++++++-------------
>  src/mlx5.h   |  6 ++++++
>  3 files changed, 52 insertions(+), 13 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index fca0b46..50b4f9c 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -65,6 +65,23 @@ AC_CHECK_FUNC(ibv_read_sysfs_file, [],
>      AC_MSG_ERROR([ibv_read_sysfs_file() not found.  libmlx5 requires 
> libibverbs >= 1.0.3.]))
>  AC_CHECK_FUNCS(ibv_dontfork_range ibv_dofork_range ibv_register_driver)
>  
> +AC_MSG_CHECKING("always inline")
Did you consider using an existing script like AX_GCC_FUNC_ATTRIBUTE [1]?

> +CFLAGS_BAK="$CFLAGS"
> +CFLAGS="$CFLAGS -Werror"
> +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
> +     static inline int f(void)
> +             __attribute__((always_inline));
> +     static inline int f(void)
> +     {
> +             return 1;
> +     }
> +]],[[
> +             int a = f();
> +             a = a;
> +]])], [AC_MSG_RESULT([yes]) AC_DEFINE([HAVE_ALWAYS_INLINE], [1], [Define if 
> __attribute((always_inline)).])]
The description here doesn't look right. How about "Define if
__attribute__((always_inline) is supported"?

Regards,
Haggai

[1] https://www.gnu.org/software/autoconf-archive/ax_gcc_func_attribute.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to