From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 8A968459AE;
	Mon, 16 Sep 2024 14:05:54 +0200 (CEST)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 5A47C4025F;
	Mon, 16 Sep 2024 14:05:54 +0200 (CEST)
Received: from us-smtp-delivery-124.mimecast.com
 (us-smtp-delivery-124.mimecast.com [170.10.133.124])
 by mails.dpdk.org (Postfix) with ESMTP id 41B5640150
 for <dev@dpdk.org>; Mon, 16 Sep 2024 14:05:52 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
 s=mimecast20190719; t=1726488351;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=Jc5mEe/Z9ExAd+lu4HdCFhhFxjIWHV+kTDrYwBhAXY8=;
 b=J/YZ13mOZOZAtOnSH6ykMKK58xV+yhjJyDrC0mWWaDrLyJ3ptc/1fVamcAoWp+ZlvuHUi3
 AHujsQob46s2i61Z21iCNXKn6oxXSVHsZH0R8QAAxz6lI5yMZnHtxsr5zAnhB5JbqXkil3
 HQAlwZqnebZkaKoO7gOYzAom+wNTq5U=
Received: from mail-lj1-f200.google.com (mail-lj1-f200.google.com
 [209.85.208.200]) by relay.mimecast.com with ESMTP with STARTTLS
 (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id
 us-mta-192-b8ivrIdDPuuQrv_ZjqpQcA-1; Mon, 16 Sep 2024 08:05:50 -0400
X-MC-Unique: b8ivrIdDPuuQrv_ZjqpQcA-1
Received: by mail-lj1-f200.google.com with SMTP id
 38308e7fff4ca-2f761cfa667so27898391fa.3
 for <dev@dpdk.org>; Mon, 16 Sep 2024 05:05:50 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1726488349; x=1727093149;
 h=content-transfer-encoding:cc:to:subject:message-id:date:from
 :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=Jc5mEe/Z9ExAd+lu4HdCFhhFxjIWHV+kTDrYwBhAXY8=;
 b=rmGBDtskQQ5vQIFOazv7BvvqEgjtUKr0N8LKMWM233sHmsv4iQBcAJ5Vwl05IKFvjI
 UdC95yHfenw2oz/JF9m8gOJlhvSA24C4IZDyQJGwqY1aTwcKUBwlogBjTMaDCKWZ7pmE
 HgDN7MtBMQe0BE6LjBk5kyhVpoeUjTq8YPDamKXBSo9Q1Ll3EMIMldoPS9XAM4GQhLgS
 FjyFZxyjO78DWaK6IGEDqvjfMmSoxeJONNjVXdweHW3t8MtHrl554eZQFMSnG5UkYWmb
 3TZBisgAD05JZzNm67oUmAdSu99u8gUQZ62AY5DfmQOhBxuIggBgZ2q9EiGi9IV5E1kV
 Qg3Q==
X-Gm-Message-State: AOJu0YwzQViq8mF0WxVyW6VJ8+504iDy4u1RuzS9S2Xl+FY5xGBe6Pcf
 IHmledHBKFpIworzp2zxR7wipJDjcHavB3sL1AnzVFzgmOyJPRWODQivmXZ2Qu1Cpec13gHoeGt
 9rBjHf9Iq300v2arFW0quwIaDRPw5GYyL5HKctpJ+O0tic6t+YEGkpB6eQB9FFUfWNMAhXNhzTv
 jsA34FFafV2+S2leQ=
X-Received: by 2002:a2e:b8c6:0:b0:2f7:614f:7d3e with SMTP id
 38308e7fff4ca-2f787f2ef0amr75791481fa.30.1726488349037; 
 Mon, 16 Sep 2024 05:05:49 -0700 (PDT)
X-Google-Smtp-Source: AGHT+IGJ56C484R/GmFX+0r/rISizTfVGzqRyKPv4c9xY5HG/ts+dl3CQQWwFYAH2Vy2xwJKKEbbxvCbrkU99iNcEBk=
X-Received: by 2002:a2e:b8c6:0:b0:2f7:614f:7d3e with SMTP id
 38308e7fff4ca-2f787f2ef0amr75791181fa.30.1726488348464; Mon, 16 Sep 2024
 05:05:48 -0700 (PDT)
MIME-Version: 1.0
References: <20240910062051.699096-2-mattias.ronnblom@ericsson.com>
 <20240910083139.699291-1-mattias.ronnblom@ericsson.com>
 <20240910083139.699291-2-mattias.ronnblom@ericsson.com>
In-Reply-To: <20240910083139.699291-2-mattias.ronnblom@ericsson.com>
From: David Marchand <david.marchand@redhat.com>
Date: Mon, 16 Sep 2024 14:05:36 +0200
Message-ID: <CAJFAV8xCZKyyeY8s=0iLYs-rjNDHBm1y06f57oM8vnedFywAJw@mail.gmail.com>
Subject: Re: [PATCH v6 1/6] dpdk: do not force C linkage on include file
 dependencies
To: =?UTF-8?Q?Mattias_R=C3=B6nnblom?= <mattias.ronnblom@ericsson.com>
Cc: dev@dpdk.org, hofors@lysator.liu.se, Heng Wang <heng.wang@ericsson.com>, 
 Stephen Hemminger <stephen@networkplumber.org>,
 Tyler Retzlaff <roretzla@linux.microsoft.com>, 
 =?UTF-8?Q?Morten_Br=C3=B8rup?= <mb@smartsharesystems.com>, 
 Jack Bond-Preston <jack.bond-preston@foss.arm.com>,
 Chengwen Feng <fengchengwen@huawei.com>
X-Mimecast-Spam-Score: 0
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org

Hello,

On Tue, Sep 10, 2024 at 10:41=E2=80=AFAM Mattias R=C3=B6nnblom
<mattias.ronnblom@ericsson.com> wrote:
> diff --git a/lib/acl/rte_acl_osdep.h b/lib/acl/rte_acl_osdep.h
> index 3c1dc402ca..e4c7d07c69 100644
> --- a/lib/acl/rte_acl_osdep.h
> +++ b/lib/acl/rte_acl_osdep.h
> @@ -5,10 +5,6 @@
>  #ifndef _RTE_ACL_OSDEP_H_
>  #define _RTE_ACL_OSDEP_H_
>
> -#ifdef __cplusplus
> -extern "C" {
> -#endif
> -
>  /**
>   * @file
>   *
> @@ -49,6 +45,10 @@ extern "C" {
>  #include <rte_cpuflags.h>
>  #include <rte_debug.h>
>
> +#ifdef __cplusplus
> +extern "C" {
> +#endif
> +
>  #ifdef __cplusplus
>  }
>  #endif

This part is a NOOP, so we can just drop it.

I found this occurence in other files of the patch.

$ git show lib/ | grep -E '^ .*__cplusplus|diff' | grep -B1
__cplusplus | sed -ne 's/^diff --git a\/\(.*\) b\/.*$/\1/p' | while
read file; do git show -- $file | tr '\n' ' ' | grep -q ' +#ifdef
__cplusplus +extern "C" { +#endif +  #ifdef __cplusplus' && echo
$file; done
lib/acl/rte_acl_osdep.h
lib/eal/arm/include/rte_cpuflags_32.h
lib/eal/arm/include/rte_cpuflags_64.h
lib/eal/arm/include/rte_power_intrinsics.h
lib/eal/loongarch/include/rte_cpuflags.h
lib/eal/loongarch/include/rte_power_intrinsics.h
lib/eal/ppc/include/rte_cpuflags.h
lib/eal/ppc/include/rte_power_intrinsics.h
lib/eal/riscv/include/rte_cpuflags.h
lib/eal/riscv/include/rte_power_intrinsics.h
lib/eal/x86/include/rte_cpuflags.h
lib/eal/x86/include/rte_power_intrinsics.h
lib/ipsec/rte_ipsec.h
lib/pdcp/rte_pdcp.h
lib/ring/rte_ring_elem.h


> diff --git a/lib/eal/arm/include/rte_io.h b/lib/eal/arm/include/rte_io.h
> index f4e66e6bad..658768697c 100644
> --- a/lib/eal/arm/include/rte_io.h
> +++ b/lib/eal/arm/include/rte_io.h
> @@ -5,14 +5,14 @@
>  #ifndef _RTE_IO_ARM_H_
>  #define _RTE_IO_ARM_H_
>
> -#ifdef __cplusplus
> -extern "C" {
> -#endif
> -
>  #ifdef RTE_ARCH_64
>  #include "rte_io_64.h"
>  #else
>  #include "generic/rte_io.h"
> +
> +#ifdef __cplusplus
> +extern "C" {
> +#endif
>  #endif

I suspect it is the reason for the CI build error on ARM.
This block should be out of the #endif, but then with the next lines,
it ends up as a noop.

>
>  #ifdef __cplusplus


> diff --git a/lib/eal/arm/include/rte_pause.h b/lib/eal/arm/include/rte_pa=
use.h
> index 6c7002ad98..8f35d60a6e 100644
> --- a/lib/eal/arm/include/rte_pause.h
> +++ b/lib/eal/arm/include/rte_pause.h
> @@ -5,14 +5,14 @@
>  #ifndef _RTE_PAUSE_ARM_H_
>  #define _RTE_PAUSE_ARM_H_
>
> -#ifdef __cplusplus
> -extern "C" {
> -#endif
> -
>  #ifdef RTE_ARCH_64
>  #include <rte_pause_64.h>
>  #else
>  #include <rte_pause_32.h>
> +
> +#ifdef __cplusplus
> +extern "C" {
> +#endif
>  #endif

Idem, probably breaking build for ARM.


> diff --git a/lib/eal/include/generic/rte_atomic.h b/lib/eal/include/gener=
ic/rte_atomic.h
> index f859707744..0a4f3f8528 100644
> --- a/lib/eal/include/generic/rte_atomic.h
> +++ b/lib/eal/include/generic/rte_atomic.h
> @@ -17,6 +17,10 @@
>  #include <rte_common.h>
>  #include <rte_stdatomic.h>
>
> +#ifdef __cplusplus
> +extern "C" {
> +#endif
> +
>  #ifdef __DOXYGEN__
>
>  /** @name Memory Barrier
> @@ -1156,4 +1160,8 @@ rte_atomic128_cmp_exchange(rte_int128_t *dst,
>
>  #endif /* __DOXYGEN__ */
>
> +#ifdef __cplusplus
> +}
> +#endif
> +

I would move under #ifdef DOXYGEN.

The rest looks good to me.


--=20
David Marchand