From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f49.google.com (mail-wm0-f49.google.com [74.125.82.49]) by dpdk.org (Postfix) with ESMTP id 14F0C4B79 for ; Wed, 13 Jul 2016 15:03:32 +0200 (CEST) Received: by mail-wm0-f49.google.com with SMTP id p190so9349946wmp.1 for ; Wed, 13 Jul 2016 06:03:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=GBjVOisE1wngLrbRhjWn4tg/UigyIwjPli7yBIAaH68=; b=SahcUcEfxF2HcDhVtTJoP302Ecb7U1hBr2g5U6AF+DTh+BXK53tZ+uHwhg6ubEJ6mn utlCagu94kiu7p/6Q7VRa432f49JCZAZ5N4dDmEI2faagZTS55Vf2nx/Gq26bm8ngOA+ DudNeulEXX+Z83ptHkTS64VVKngH0JFgc/rtAaRuxu+jk9vQE1vnjna+ReYyDy5Nj5sO 3TawPQ3QRBzzzPEtHJHWVdWlBE8h0gW+H6Y1Ac6CJzjqz7p38AsaBw4bofyEMqojGn3T Rafr/EK2YzOv2xByn6MqNObePAyvI0LATRMc0j2DyR6olpT84tyuEHe1muH6vqgqa/QQ g/4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=GBjVOisE1wngLrbRhjWn4tg/UigyIwjPli7yBIAaH68=; b=Gvl1AwXMOggTqH6ZkJrBuvv6XfMPhlVVwvQqTjOAY1kleH04DRETi5Co9chNjQp4kY d2eUSJajf13u66NwoGNZ66dmOcfHeIf9+QegOdY59SplbIZ49UEMRG0wSOMKtZWhPYNs PR/LZMZDEYZRy2kDZZ+jfMaxPWAEF3nfzErA7LVMVpNUivWvtKxtlQaAuzRhYBTLKc7Q FDm+HuX8yDLEVAuq5+dfmyjnCm527rwUpVAME9jDGDuFMiotzfXyzw4XknrTXFEeKoRD OUx//khEj7I18HRuxv2G2AjKfDo+he0WwOafc6EDzpmz/kWVEGpffts+UHBYgr4cEkaq tFYA== X-Gm-Message-State: ALyK8tJZs1pZTOdaYf8om5omfDkEQdqRK99s2Xwp74qMR0q5LzZptL42bORG5SOBr6AyGCRf X-Received: by 10.194.192.101 with SMTP id hf5mr945543wjc.66.1468415011521; Wed, 13 Jul 2016 06:03:31 -0700 (PDT) Received: from 6wind.com (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by smtp.gmail.com with ESMTPSA id g6sm827604wjx.0.2016.07.13.06.03.30 for (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 13 Jul 2016 06:03:30 -0700 (PDT) From: Adrien Mazarguil To: dev@dpdk.org Date: Wed, 13 Jul 2016 15:02:41 +0200 Message-Id: <3603fcb47eb6e86f71429c530da0c954e612cc45.1468413397.git.adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: Subject: [dpdk-dev] [PATCH v4 04/10] lib: work around nonstandard bit-fields X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jul 2016 13:03:32 -0000 Exported header files used by applications should allow the strictest compiler flags. Language extensions used in many places must be explicitly marked or removed to avoid warnings and compilation failures. This commit prevents the following errors: error: type of bit-field `[...]' is a GCC extension Note: the standard does not require implementations to issue a diagnostic message with these, and such errors do not occur with recent GCC or clang versions. However, GCC 4.7 is still common and using the extension keyword is easier than checking compiler version. Signed-off-by: Adrien Mazarguil --- lib/librte_cryptodev/rte_cryptodev.h | 2 ++ lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h | 1 + lib/librte_ether/rte_ethdev.h | 4 ++++ lib/librte_kni/rte_kni.h | 1 + lib/librte_lpm/rte_lpm.h | 4 ++++ lib/librte_mbuf/rte_mbuf.h | 1 + 6 files changed, 13 insertions(+) diff --git a/lib/librte_cryptodev/rte_cryptodev.h b/lib/librte_cryptodev/rte_cryptodev.h index 1e30a19..957bdd7 100644 --- a/lib/librte_cryptodev/rte_cryptodev.h +++ b/lib/librte_cryptodev/rte_cryptodev.h @@ -619,6 +619,7 @@ struct rte_cryptodev { struct rte_cryptodev_cb_list link_intr_cbs; /**< User application callback for interrupts if present */ + __extension__ uint8_t attached : 1; /**< Flag indicating the device is attached */ } __rte_cache_aligned; @@ -642,6 +643,7 @@ struct rte_cryptodev_data { char name[RTE_CRYPTODEV_NAME_MAX_LEN]; /**< Unique identifier name */ + __extension__ uint8_t dev_started : 1; /**< Device state: STARTED(1)/STOPPED(0) */ diff --git a/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h index 7f458a3..2ef0506 100644 --- a/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h +++ b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h @@ -159,6 +159,7 @@ struct rte_kni_device_info { uint16_t group_id; /**< Group ID */ uint32_t core_id; /**< core ID to bind for kernel thread */ + __extension__ uint8_t force_bind : 1; /**< Flag for kernel thread binding */ /* mbuf size */ diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index 4dac364..6059dd5 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -255,6 +255,7 @@ struct rte_eth_stats { /** * A structure used to retrieve link-level information of an Ethernet port. */ +__extension__ struct rte_eth_link { uint32_t link_speed; /**< ETH_SPEED_NUM_ */ uint16_t link_duplex : 1; /**< ETH_LINK_[HALF/FULL]_DUPLEX */ @@ -346,6 +347,7 @@ struct rte_eth_rxmode { enum rte_eth_rx_mq_mode mq_mode; uint32_t max_rx_pkt_len; /**< Only used if jumbo_frame enabled. */ uint16_t split_hdr_size; /**< hdr buf size (header_split enabled).*/ + __extension__ uint16_t header_split : 1, /**< Header Split enable. */ hw_ip_checksum : 1, /**< IP/UDP/TCP checksum offload enable. */ hw_vlan_filter : 1, /**< VLAN filter enable. */ @@ -645,6 +647,7 @@ struct rte_eth_txmode { /* For i40e specifically */ uint16_t pvid; + __extension__ uint8_t hw_vlan_reject_tagged : 1, /**< If set, reject sending out tagged pkts */ hw_vlan_reject_untagged : 1, @@ -1691,6 +1694,7 @@ struct rte_eth_dev_data { struct ether_addr* hash_mac_addrs; /** Device Ethernet MAC addresses of hash filtering. */ uint8_t port_id; /**< Device [external] port identifier. */ + __extension__ uint8_t promiscuous : 1, /**< RX promiscuous mode ON(1) / OFF(0). */ scattered_rx : 1, /**< RX of scattered packets is ON(1) / OFF(0) */ all_multicast : 1, /**< RX all multicast mode ON(1) / OFF(0). */ diff --git a/lib/librte_kni/rte_kni.h b/lib/librte_kni/rte_kni.h index 7363e6c..5f6f9e4 100644 --- a/lib/librte_kni/rte_kni.h +++ b/lib/librte_kni/rte_kni.h @@ -88,6 +88,7 @@ struct rte_kni_conf { struct rte_pci_addr addr; struct rte_pci_id id; + __extension__ uint8_t force_bind : 1; /* Flag to bind kernel thread */ }; diff --git a/lib/librte_lpm/rte_lpm.h b/lib/librte_lpm/rte_lpm.h index 79a4593..28668a3 100644 --- a/lib/librte_lpm/rte_lpm.h +++ b/lib/librte_lpm/rte_lpm.h @@ -93,6 +93,7 @@ extern "C" { #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN /** @internal Tbl24 entry structure. */ +__extension__ struct rte_lpm_tbl_entry_v20 { /** * Stores Next hop (tbl8 or tbl24 when valid_group is not set) or @@ -116,6 +117,7 @@ struct rte_lpm_tbl_entry_v20 { uint8_t depth :6; /**< Rule depth. */ }; +__extension__ struct rte_lpm_tbl_entry { /** * Stores Next hop (tbl8 or tbl24 when valid_group is not set) or @@ -137,6 +139,7 @@ struct rte_lpm_tbl_entry { }; #else +__extension__ struct rte_lpm_tbl_entry_v20 { uint8_t depth :6; uint8_t valid_group :1; @@ -147,6 +150,7 @@ struct rte_lpm_tbl_entry_v20 { }; }; +__extension__ struct rte_lpm_tbl_entry { uint32_t depth :6; uint32_t valid_group :1; diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h index 434ec31..3d3e847 100644 --- a/lib/librte_mbuf/rte_mbuf.h +++ b/lib/librte_mbuf/rte_mbuf.h @@ -865,6 +865,7 @@ struct rte_mbuf { /* fields to support TX offloads */ union { uint64_t tx_offload; /**< combined for easy fetch */ + __extension__ struct { uint64_t l2_len:7; /**< L2 (MAC) Header Length. */ uint64_t l3_len:9; /**< L3 (IP) Header Length. */ -- 2.1.4