From patchwork Thu Aug 31 07:32:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 1828145 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=ampOM7Zy; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RbtDB2dFQz1yZs for ; Thu, 31 Aug 2023 17:32:42 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id F274F60FA6; Thu, 31 Aug 2023 07:32:39 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org F274F60FA6 Authentication-Results: smtp3.osuosl.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=ampOM7Zy X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TjGwgwpVi5Lr; Thu, 31 Aug 2023 07:32:38 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp3.osuosl.org (Postfix) with ESMTPS id E45E960EC6; Thu, 31 Aug 2023 07:32:37 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org E45E960EC6 Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 9F582C0071; Thu, 31 Aug 2023 07:32:37 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 254A8C0032 for ; Thu, 31 Aug 2023 07:32:36 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id E5B8840383 for ; Thu, 31 Aug 2023 07:32:35 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org E5B8840383 Authentication-Results: smtp2.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=ampOM7Zy X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eLbtz_F9ke6I for ; Thu, 31 Aug 2023 07:32:35 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by smtp2.osuosl.org (Postfix) with ESMTPS id EB7C24016C for ; Thu, 31 Aug 2023 07:32:34 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org EB7C24016C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1693467153; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p0km1ITne/ucQp7b17zgwzYUII83ViPZYfiMgS/pgkQ=; b=ampOM7ZykdP9N9lTiQTsrxWDjgTyIJTk7EiGSsiagjWzZfyGXHaP976DWyyZJkGI3uax4G 3CYD5dp3vpiZJx4Zl2kzGLRy1YhfgGUkFMcwhsUClK/TEkZuRxA4AzpZFvR2EPDcB2LiM0 CMWF3Nji7pVwFuePqB49EMYni4P3034= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-371-6tFkm-fwOFSmjycWvaNYdw-1; Thu, 31 Aug 2023 03:32:31 -0400 X-MC-Unique: 6tFkm-fwOFSmjycWvaNYdw-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 15EE51C0755F for ; Thu, 31 Aug 2023 07:32:31 +0000 (UTC) Received: from dmarchan.redhat.com (unknown [10.45.225.206]) by smtp.corp.redhat.com (Postfix) with ESMTP id 77DE84021C9; Thu, 31 Aug 2023 07:32:30 +0000 (UTC) From: David Marchand To: dev@openvswitch.org, Kevin Traynor Date: Thu, 31 Aug 2023 09:32:23 +0200 Message-ID: <20230831073223.2737842-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [dpdk-latest] sparse: Fix build with DPDK v23.11-rc1. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" After DPDK started relying on compiler intrinsics in rte_cycles.h, sparse raises the following warning: libtool: compile: env REAL_CC=gcc "CHECK=sparse -Wsparse-error -I ../../include/sparse -I ../../include -m64 -I /usr/local/include -I /usr/include/x86_64-linux-gnu " cgcc -target=x86_64 -target=host_os_specs -D__MMX__=1 -D__SSE2_MATH__=1 -D__SSE_MATH__=1 -D__SSE2__=1 -D__SSE__=1 -DHAVE_CONFIG_H -I. -I../.. -I ../../include -I ./include -I ../../lib -I ./lib -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wswitch-bool -Wlogical-not-parentheses -Wsizeof-array-argument -Wbool-compare -Wshift-negative-value -Wduplicated-cond -Wshadow -Wmultistatement-macros -Wcast-align=strict -mssse3 -include rte_config.h -mrtm -I/home/runner/work/ovs/ovs/dpdk-dir/include -Werror -D_FILE_OFFSET_BITS=64 -g -O2 -MT lib/netdev-dpdk.lo -MD -MP -MF lib/.deps/netdev-dpdk.Tpo -c ../../lib/netdev-dpdk.c -o lib/netdev-dpdk.o ../../lib/netdev-dpdk.c: note: in included file (through /usr/lib/gcc/x86_64-linux-gnu/9//include/x86intrin.h, /home/runner/work/ovs/ovs/dpdk-dir/include/rte_cycles.h, /home/runner/work/ovs/ovs/dpdk-dir/include/rte_spinlock.h, ...): /usr/lib/gcc/x86_64-linux-gnu/9//include/ia32intrin.h:114:10: error: undefined identifier '__builtin_ia32_rdtsc' Provide an empty implementation of __builtin_ia32_rdtsc() builtin. Signed-off-by: David Marchand Acked-by: Simon Horman --- Note: I am sending this early, but please wait before merging this in dpdk-latest as v23.11-rc1 is far from being ready. I am expecting more changes in EAL headers and I'll update this patch if hitting more issues. --- include/sparse/automake.mk | 1 + include/sparse/ia32intrin.h | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 include/sparse/ia32intrin.h diff --git a/include/sparse/automake.mk b/include/sparse/automake.mk index e966371192..c1229870bb 100644 --- a/include/sparse/automake.mk +++ b/include/sparse/automake.mk @@ -4,6 +4,7 @@ noinst_HEADERS += \ include/sparse/arpa/inet.h \ include/sparse/bits/floatn.h \ include/sparse/assert.h \ + include/sparse/ia32intrin.h \ include/sparse/math.h \ include/sparse/numa.h \ include/sparse/netinet/in.h \ diff --git a/include/sparse/ia32intrin.h b/include/sparse/ia32intrin.h new file mode 100644 index 0000000000..5045bf38d9 --- /dev/null +++ b/include/sparse/ia32intrin.h @@ -0,0 +1,23 @@ +/* Copyright (c) 2023 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 + +#define __builtin_ia32_rdtsc() (unsigned long long) 0 + +/* Get actual definitions for us to annotate and build on. */ +#include_next