On 7/14/22 19:51, Emma Finn wrote:
> From: Harry van Haaren <[email protected]>
> 
> This commit adds the AVX512 implementation of the
> pop_vlan action.
> 
> Signed-off-by: Emma Finn <[email protected]>
> ---
>  lib/automake.mk           |   4 +
>  lib/odp-execute-avx512.c  | 186 ++++++++++++++++++++++++++++++++++++++
>  lib/odp-execute-private.c |  32 ++++++-
>  lib/odp-execute-private.h |   4 +
>  4 files changed, 225 insertions(+), 1 deletion(-)
>  create mode 100644 lib/odp-execute-avx512.c
> 
> diff --git a/lib/automake.mk b/lib/automake.mk
> index 5c3b05f6b..a76de6dbf 100644
> --- a/lib/automake.mk
> +++ b/lib/automake.mk
> @@ -45,6 +45,10 @@ lib_libopenvswitchavx512_la_CFLAGS += \
>  lib_libopenvswitchavx512_la_SOURCES += \
>       lib/dpif-netdev-extract-avx512.c \
>       lib/dpif-netdev-lookup-avx512-gather.c
> +if HAVE_GCC_AVX512VL_GOOD
> +lib_libopenvswitchavx512_la_SOURCES += \
> +     lib/odp-execute-avx512.c
> +endif # HAVE_GCC_AVX512VL_GOOD
>  endif # HAVE_AVX512VL
>  endif # HAVE_AVX512BW
>  lib_libopenvswitchavx512_la_LDFLAGS = \
> diff --git a/lib/odp-execute-avx512.c b/lib/odp-execute-avx512.c
> new file mode 100644
> index 000000000..d929abe68
> --- /dev/null
> +++ b/lib/odp-execute-avx512.c
> @@ -0,0 +1,186 @@
> +/*
> + * Copyright (c) 2022 Intel.
> + *
> + * Licensed under the Apache License, Version 2.0 (the "License");
> + * you may not use this file except in compliance with the License.
> + * You may obtain a copy of the License at:
> + *
> + *     http://www.apache.org/licenses/LICENSE-2.0
> + *
> + * Unless required by applicable law or agreed to in writing, software
> + * distributed under the License is distributed on an "AS IS" BASIS,
> + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
> + * See the License for the specific language governing permissions and
> + * limitations under the License.
> + */
> +
> +#ifdef __x86_64__
> +/* Sparse cannot handle the AVX512 instructions. */
> +#if !defined(__CHECKER__)
> +
> +#include <config.h>
> +#include <errno.h>
> +
> +#include "dp-packet.h"
> +#include "immintrin.h"
> +#include "odp-execute-private.h"
> +#include "odp-netlink.h"
> +#include "openvswitch/vlog.h"

<snip>

> +
> +#endif /* Sparse */
> +
> +#else /* __x86_64__ */
> +
> +#include <config.h>
> +#include "odp-execute-private.h"
> +/* Function itself is required to be called, even in e.g. 32-bit builds.
> + * This dummy init function ensures 32-bit builds succeed too.
> + */
> +
> +int
> +action_avx512_init(struct odp_execute_action_impl *self OVS_UNUSED)
> +{
> +  return -ENOTSUP;

The build in CI fails here, since ENOTSUP is not defined in this branch:

lib/odp-execute-avx512.c: In function ‘action_avx512_init’:
lib/odp-execute-avx512.c:183:11: error: ‘ENOTSUP’ undeclared (first use in this 
function)
   return -ENOTSUP;
           ^~~~~~~
lib/odp-execute-avx512.c:183:11: note: each undeclared identifier is reported 
only once for each function it appears in
lib/odp-execute-avx512.c:184:1: error: control reaches end of non-void function 
[-Werror=return-type]
 }
 ^
cc1: all warnings being treated as errors

Best regards, Ilya Maximets.
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to