On 1/28/25 16:53, David Marchand wrote: > Since sparse v0.6.4 (which is 3 years old and happens to be the latest > official release), GCC atomic builtins are recognised by sparse > (see below first three links).
We have a minimal sparse version documented. I suppose that version should be updated by this commit if we're going to rely on functionality introduced in a newer release. Best regards, Ilya Maximets. > > In the case of rte_atomic.h, DPDK stopped using __sync in favor of > __atomic builtin in v23.07 (see below last link). > However, no OVS developer complained about sparse build failures because > of rte_atomic.h which means that everyone uses a recent sparse (if any). > > Remove wrappers around those DPDK headers. > > Link: > https://git.kernel.org/pub/scm/devel/sparse/sparse.git/commit/?id=cf8f104749f5 > Link: > https://git.kernel.org/pub/scm/devel/sparse/sparse.git/commit/?id=7cdf84691f33 > Link: > https://git.kernel.org/pub/scm/devel/sparse/sparse.git/commit/?id=f42e2afa9ed0 > Link: https://git.dpdk.org/dpdk/commit/?id=a2f807316dae > Signed-off-by: David Marchand <david.march...@redhat.com> > --- > include/sparse/automake.mk | 3 --- > include/sparse/rte_atomic.h | 25 ------------------------- > include/sparse/rte_mbuf.h | 29 ----------------------------- > include/sparse/rte_trace_point.h | 28 ---------------------------- > 4 files changed, 85 deletions(-) > delete mode 100644 include/sparse/rte_atomic.h > delete mode 100644 include/sparse/rte_mbuf.h > delete mode 100644 include/sparse/rte_trace_point.h > > diff --git a/include/sparse/automake.mk b/include/sparse/automake.mk > index 45e6202c52..052a1b4b82 100644 > --- a/include/sparse/automake.mk > +++ b/include/sparse/automake.mk > @@ -12,10 +12,7 @@ noinst_HEADERS += \ > include/sparse/netinet/ip6.h \ > 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 \ > include/sparse/sys/sysmacros.h \ > include/sparse/sys/types.h \ > diff --git a/include/sparse/rte_atomic.h b/include/sparse/rte_atomic.h > deleted file mode 100644 > index ae49fe5c03..0000000000 > --- a/include/sparse/rte_atomic.h > +++ /dev/null > @@ -1,25 +0,0 @@ > -/* Copyright (c) 2015 Nicira, 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 > - > -/* Fix sparse technicality about types in one of the function calls by just > - * ignoring it. */ > -#define __sync_add_and_fetch(a, b) (0) > - > -/* Get actual <rte_atomic.h> definitions for us to annotate and build on. */ > -#include_next <rte_atomic.h> > diff --git a/include/sparse/rte_mbuf.h b/include/sparse/rte_mbuf.h > deleted file mode 100644 > index 981cdb441f..0000000000 > --- a/include/sparse/rte_mbuf.h > +++ /dev/null > @@ -1,29 +0,0 @@ > -/* 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. */ > -#ifndef __ATOMIC_ACQ_REL > -#define __ATOMIC_ACQ_REL 0 > -#define __ATOMIC_RELAXED 1 > -#define __atomic_add_fetch(p, val, memorder) (*(p) = *(p) + (val)) > -#define __atomic_store_n(p, val, memorder) (*(p) = (val)) > -#endif > - > -/* Get actual <rte_mbuf.h> definitions for us to annotate and build on. */ > -#include_next <rte_mbuf.h> > diff --git a/include/sparse/rte_trace_point.h > b/include/sparse/rte_trace_point.h > deleted file mode 100644 > index 8039232754..0000000000 > --- a/include/sparse/rte_trace_point.h > +++ /dev/null > @@ -1,28 +0,0 @@ > -/* Copyright 2020, Red Hat, 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. */ > -#ifndef __ATOMIC_ACQUIRE > -#define __ATOMIC_ACQUIRE 0 > -#define __atomic_load_n(p, memorder) *(p) > -#endif > - > -/* Get actual <rte_trace_point.h> definitions for us to annotate and > - * build on. */ > -#include_next <rte_trace_point.h> _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev