From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by dpdk.org (Postfix) with ESMTP id AA8F02BF7 for ; Wed, 22 Aug 2018 17:12:09 +0200 (CEST) Received: from mail-oi0-f69.google.com ([209.85.218.69]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1fsUnp-00051J-9v for dev@dpdk.org; Wed, 22 Aug 2018 15:12:09 +0000 Received: by mail-oi0-f69.google.com with SMTP id 13-v6so2071505oiq.1 for ; Wed, 22 Aug 2018 08:12:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fbs4UBbIP1hjGc0RtoSnBmO+GmGVAl8rXt7c5nMCXXw=; b=NCVoUXv+dvyeQX7FJqcWyCfx3P0tQBc+9ljb5JYXiTlnFQ0tCIqQctMRO/Aj3fBErO sjbWMT3M7QL8NrMcGohfzks5R44NYhLVE9aUc6F1AFXZ4ZGar6AcFTTVZMj+ttKZDmgf 3/d+9WmcXbdRD9b9UNgpAep1fbwwuDazrLirjO6+L6jj75xfXVSnLiabOdHocciGKaJs jSaTENLGmEmPDP7mal5NuDphdM6AFTm4viApL/5Qy+yW3hqFKpVxUyKoE61i7W2P+w3E OmV1NQc1vgc57AONB3S2zCrEKKslnSFXtjXE1tUIpXKVcEYP8veadFAMPVqoxz9HGBF1 HdmQ== X-Gm-Message-State: APzg51AK0a6HK+vhvtYDgJCtIpq7kIGfa6U3f1ZItdv1RBn2VUopeKTJ ZFr6KQMoneZ5312K999k9u1Uc0/u8TySPWXzPt62vPQMRAJFcsJDiTmWBkviPhB02AacWmKcXQy Zf9hBsMBp6eBI8jL9NjJhT8nxugIG8rCvzKa3 X-Received: by 2002:aca:dbc2:: with SMTP id s185-v6mr4493984oig.251.1534950727644; Wed, 22 Aug 2018 08:12:07 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZXeu6PrYBPqR6qibDpMyyVaIuplkr+KB8+kUz+00Wh8EKEZ0CZhQoXsJqJLfKPlI8Sm4GhRBuUqWyToJWPjA4= X-Received: by 2002:aca:dbc2:: with SMTP id s185-v6mr4493942oig.251.1534950727164; Wed, 22 Aug 2018 08:12:07 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Christian Ehrhardt Date: Wed, 22 Aug 2018 17:11:41 +0200 Message-ID: To: dev , Gowrishankar Muthukrishnan , Chao Zhu Cc: Luca Boccassi , Thomas Monjalon Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] 18.08 build error on ppc64el - bool as vector type X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Aug 2018 15:12:09 -0000 Just FYI the simple change hits similar issues later on. The (not really) proposed patch would have to be extended to be as following. We really need a better solution (or somebody has to convince me that my change is better than a band aid). Description: Fix ppc64le build error between altivec and bool We really hope there will eventually be a better fix for this, but currently we have to unbreak building this code so until something better is available let's use this modification. Forwarded: yes Forward-info: http://mails.dpdk.org/archives/dev/2018-August/109926.html Author: Christian Ehrhardt Last-Update: 2018-08-22 --- a/drivers/net/mlx5/mlx5_nl.c +++ b/drivers/net/mlx5/mlx5_nl.c @@ -834,8 +834,8 @@ mlx5_nl_switch_info_cb(struct nlmsghdr * .switch_id = 0, }; size_t off = NLMSG_LENGTH(sizeof(struct ifinfomsg)); - bool port_name_set = false; - bool switch_id_set = false; + int port_name_set = 0; + int switch_id_set = 0; if (nh->nlmsg_type != RTM_NEWLINK) goto error; @@ -854,7 +854,7 @@ mlx5_nl_switch_info_cb(struct nlmsghdr * if (errno || (size_t)(end - (char *)payload) != strlen(payload)) goto error; - port_name_set = true; + port_name_set = 1; break; case IFLA_PHYS_SWITCH_ID: info.switch_id = 0; @@ -862,7 +862,7 @@ mlx5_nl_switch_info_cb(struct nlmsghdr * info.switch_id <<= 8; info.switch_id |= ((uint8_t *)payload)[i]; } - switch_id_set = true; + switch_id_set = 1; break; } off += RTA_ALIGN(ra->rta_len); --- a/drivers/net/mlx5/mlx5_ethdev.c +++ b/drivers/net/mlx5/mlx5_ethdev.c @@ -1335,8 +1335,8 @@ mlx5_sysfs_switch_info(unsigned int ifin char ifname[IF_NAMESIZE]; FILE *file; struct mlx5_switch_info data = { .master = 0, }; - bool port_name_set = false; - bool port_switch_id_set = false; + int port_name_set = 0; + int port_switch_id_set = 0; char c; if (!if_indextoname(ifindex, ifname)) { --- a/drivers/net/mlx5/mlx5_nl_flow.c +++ b/drivers/net/mlx5/mlx5_nl_flow.c @@ -385,11 +385,11 @@ mlx5_nl_flow_transpose(void *buf, const struct rte_flow_action *action; unsigned int n; uint32_t act_index_cur; - bool in_port_id_set; - bool eth_type_set; - bool vlan_present; - bool vlan_eth_type_set; - bool ip_proto_set; + int in_port_id_set; + int eth_type_set; + int vlan_present; + int vlan_eth_type_set; + int ip_proto_set; struct nlattr *na_flower; struct nlattr *na_flower_act; struct nlattr *na_vlan_id; @@ -404,11 +404,11 @@ init: action = actions; n = 0; act_index_cur = 0; - in_port_id_set = false; - eth_type_set = false; - vlan_present = false; - vlan_eth_type_set = false; - ip_proto_set = false; + in_port_id_set = 0; + eth_type_set = 0; + vlan_present = 0; + vlan_eth_type_set = 0; + ip_proto_set = 0; na_flower = NULL; na_flower_act = NULL; na_vlan_id = NULL; On Tue, Aug 21, 2018 at 4:19 PM Christian Ehrhardt < christian.ehrhardt@canonical.com> wrote: > Hi, > Debian and Ubuntu face a build error with 18.08 on ppc64el. > It looks like that: > > Full log: > > https://buildd.debian.org/status/fetch.php?pkg=dpdk&arch=ppc64el&ver=18.08-1&stamp=1534520196&raw=0 > > /<>/drivers/net/mlx5/mlx5_nl.c: In function > 'mlx5_nl_switch_info_cb': > /<>/drivers/net/mlx5/mlx5_nl.c:837:23: error: incompatible > types when initializing type '__vector __bool int' {aka '__vector(4) __bool > int'} using type 'int' > bool port_name_set = false; > ^~~~~ > /<>/drivers/net/mlx5/mlx5_nl.c:838:23: error: incompatible > types when initializing type '__vector __bool int' {aka '__vector(4) __bool > int'} using type 'int' > bool switch_id_set = false; > ^~~~~ > /<>/drivers/net/mlx5/mlx5_nl.c:857:18: error: incompatible > types when assigning to type '__vector __bool int' {aka '__vector(4) __bool > int'} from type 'int' > port_name_set = true; > ^ > /<>/drivers/net/mlx5/mlx5_nl.c:865:18: error: incompatible > types when assigning to type '__vector __bool int' {aka '__vector(4) __bool > int'} from type 'int' > switch_id_set = true; > ^ > /<>/drivers/net/mlx5/mlx5_nl.c:870:16: error: used vector > type where scalar is required > info.master = switch_id_set && !port_name_set; > ^~~~~~~~~~~~~ > /<>/drivers/net/mlx5/mlx5_nl.c:870:33: error: wrong type > argument to unary exclamation mark > info.master = switch_id_set && !port_name_set; > ^ > /<>/drivers/net/mlx5/mlx5_nl.c:871:21: error: used vector > type where scalar is required > info.representor = switch_id_set && port_name_set; > > > Now I checked and the reason seems to be some combination of altivec and > MLX headers and the use of bool - probably stdbool vs altivec bool. > > If built with gcc -E I see it the bool variables become: > __attribute__((altivec(bool__))) unsigned port_name_set = > > I have found a strawmans approach to it, but I'm sure people with > experience on the matter will come up with something better. > > My current change looks like that and would work: > $ git diff > diff --git a/drivers/net/mlx5/mlx5_nl.c b/drivers/net/mlx5/mlx5_nl.c > index d61826aea..2cc8f49c5 100644 > --- a/drivers/net/mlx5/mlx5_nl.c > +++ b/drivers/net/mlx5/mlx5_nl.c > @@ -834,8 +834,8 @@ mlx5_nl_switch_info_cb(struct nlmsghdr *nh, void > *arg) > .switch_id = 0, > }; > size_t off = NLMSG_LENGTH(sizeof(struct ifinfomsg)); > - bool port_name_set = false; > - bool switch_id_set = false; > + int port_name_set = 0; > + int switch_id_set = 0; > > if (nh->nlmsg_type != RTM_NEWLINK) > goto error; > @@ -854,7 +854,7 @@ mlx5_nl_switch_info_cb(struct nlmsghdr *nh, void > *arg) > if (errno || > (size_t)(end - (char *)payload) != > strlen(payload)) > goto error; > - port_name_set = true; > + port_name_set = 1; > break; > case IFLA_PHYS_SWITCH_ID: > info.switch_id = 0; > @@ -862,7 +862,7 @@ mlx5_nl_switch_info_cb(struct nlmsghdr *nh, void > *arg) > info.switch_id <<= 8; > info.switch_id |= ((uint8_t *)payload)[i]; > } > - switch_id_set = true; > + switch_id_set = 1; > break; > } > off += RTA_ALIGN(ra->rta_len); > > > > > -- > Christian Ehrhardt > Software Engineer, Ubuntu Server > Canonical Ltd > -- Christian Ehrhardt Software Engineer, Ubuntu Server Canonical Ltd