DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Chao Zhu" <chaozhu@linux.vnet.ibm.com>
To: "'Thomas Monjalon'" <thomas@monjalon.net>, <dev@dpdk.org>
Cc: <christian.ehrhardt@canonical.com>, <adrien.mazarguil@6wind.com>,
	<shahafs@mellanox.com>, <yskoh@mellanox.com>,
	<gowrishankar.m@linux.vnet.ibm.com>, <pradeep@us.ibm.com>,
	<tyos@jp.ibm.com>, <dwilder@us.ibm.com>
Subject: ´ð¸´: [PATCH] net/mlx5: fix build on PPC64
Date: Thu, 8 Nov 2018 17:46:52 +0800	[thread overview]
Message-ID: <006e01d47747$fc37b680$f4a72380$@linux.vnet.ibm.com> (raw)
In-Reply-To: <20181107160028.5938-1-thomas@monjalon.net>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1954 bytes --]

> -----ÓʼþÔ­¼þ-----
> ·¢¼þÈË: Thomas Monjalon <thomas@monjalon.net>
> ·¢ËÍʱ¼ä: 2018Äê11ÔÂ8ÈÕ 0:00
> ÊÕ¼þÈË: dev@dpdk.org
> ³­ËÍ: christian.ehrhardt@canonical.com; adrien.mazarguil@6wind.com;
> shahafs@mellanox.com; yskoh@mellanox.com;
> gowrishankar.m@linux.vnet.ibm.com; chaozhu@linux.vnet.ibm.com;
> pradeep@us.ibm.com; tyos@jp.ibm.com; dwilder@us.ibm.com
> Ö÷Ìâ: [PATCH] net/mlx5: fix build on PPC64
>
> The AltiVec header file breaks boolean type:
>
> error: incompatible types when initializing type '__vector _bool int' {aka
> '_vector(4) __bool int'} using type 'int'
>
> If __APPLE_ALTIVEC__ is defined, then bool type is redefined and conflicts
> with stdbool.h.
>
> There is no good solution to fix it for the whole project without breaking
> something else, so a workaround is inserted in mlx5 PMD.
> This workaround is not compatible with C++ but there is no C++ in DPDK.
>
> Suggested-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
> Suggested-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
>  drivers/net/mlx5/mlx5_utils.h | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/drivers/net/mlx5/mlx5_utils.h b/drivers/net/mlx5/mlx5_utils.h
> index 886f60e61..97092c749 100644
> --- a/drivers/net/mlx5/mlx5_utils.h
> +++ b/drivers/net/mlx5/mlx5_utils.h
> @@ -15,6 +15,16 @@
>
>  #include "mlx5_defs.h"
>
> +/*
> + * Compilation workaround for PPC64 when AltiVec is fully enabled, e.g.
> std=c11.
> + * Otherwise there would be a type conflict between stdbool and altivec.
> + */
> +#if defined(__PPC64__) && !defined(__APPLE_ALTIVEC__) #undef bool
> +/* redefine as in stdbool.h */
> +#define bool _Bool
> +#endif
> +
>  /* Bit-field manipulation. */
>  #define BITFIELD_DECLARE(bf, type, size) \
>  	type bf[(((size_t)(size) / (sizeof(type) * CHAR_BIT)) + \
> --
> 2.19.0
Verified, it works. Thanks!

Acked-by: Chao Zhu <chaozhu@linux.vnet.ibm.com>

      parent reply	other threads:[~2018-11-08  9:47 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-30 11:59 [dpdk-dev] [PATCH v3] ppc64: fix compilation of when AltiVec is enabled Christian Ehrhardt
2018-08-31  1:48 ` Chao Zhu
2018-08-31  5:14   ` Christian Ehrhardt
2018-08-31  7:59     ` Chao Zhu
2018-09-03  9:29 ` Adrien Mazarguil
2018-11-05 14:25   ` Thomas Monjalon
2018-11-07 16:00   ` [dpdk-dev] [PATCH] net/mlx5: fix build on PPC64 Thomas Monjalon
2018-11-07 19:05     ` dwilder
2018-11-07 21:10       ` Thomas Monjalon
2018-11-08  8:25         ` Shahaf Shuler
2018-11-08  9:46     ` Chao Zhu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='006e01d47747$fc37b680$f4a72380$@linux.vnet.ibm.com' \
    --to=chaozhu@linux.vnet.ibm.com \
    --cc=adrien.mazarguil@6wind.com \
    --cc=christian.ehrhardt@canonical.com \
    --cc=dev@dpdk.org \
    --cc=dwilder@us.ibm.com \
    --cc=gowrishankar.m@linux.vnet.ibm.com \
    --cc=pradeep@us.ibm.com \
    --cc=shahafs@mellanox.com \
    --cc=thomas@monjalon.net \
    --cc=tyos@jp.ibm.com \
    --cc=yskoh@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).