Introduction of C11 atomic instructions in rte_mbuf.h causes the build to fail with Sparse reporting following errors.
error: undefined identifier '__atomic_add_fetch' error: undefined identifier '__atomic_store_n' This patch udpates the Sprase headers for rte_mbuf.h. Tested-at: https://travis-ci.org/github/Sunil-Pai-G/ovs-copy/builds/723223426 Signed-off-by: Sunil Pai G <[email protected]> --- include/sparse/automake.mk | 1 + include/sparse/rte_mbuf.h | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 include/sparse/rte_mbuf.h diff --git a/include/sparse/automake.mk b/include/sparse/automake.mk index c6ced9387..2c1ef68fc 100644 --- a/include/sparse/automake.mk +++ b/include/sparse/automake.mk @@ -11,6 +11,7 @@ noinst_HEADERS += \ include/sparse/netpacket/packet.h \ include/sparse/pthread.h \ include/sparse/rte_atomic.h \ + include/sparse/rte_mbuf.h \ include/sparse/rte_memcpy.h \ include/sparse/rte_trace_point.h \ include/sparse/sys/socket.h \ diff --git a/include/sparse/rte_mbuf.h b/include/sparse/rte_mbuf.h new file mode 100644 index 000000000..61b53279f --- /dev/null +++ b/include/sparse/rte_mbuf.h @@ -0,0 +1,27 @@ +/* Copyright (c) 2020 Intel, Inc. + * + * 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. + */ + +#ifndef __CHECKER__ +#error "Use this header only with sparse. It is not a correct implementation." +#endif + +/* sparse doesn't know about gcc atomic builtins. */ +#define __ATOMIC_ACQ_REL 0 +#define __ATOMIC_RELAXED 1 +#define __atomic_add_fetch(a, b, c) ((*a)=(*a)+b) +#define __atomic_store_n(a, b, c) (*a=b) + +/* Get actual <rte_mbuf.h> definitions for us to annotate and build on. */ +#include_next <rte_mbuf.h> -- 2.17.1 _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
