From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f46.google.com (mail-wm0-f46.google.com [74.125.82.46]) by dpdk.org (Postfix) with ESMTP id 5CB995584 for ; Thu, 7 Jul 2016 17:49:55 +0200 (CEST) Received: by mail-wm0-f46.google.com with SMTP id a66so37282932wme.0 for ; Thu, 07 Jul 2016 08:49:55 -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=Xi28iljk8QFe3pbEB6IWCUGGYHAQicW/b5MZpmNsWoE=; b=PzPpPV+W1oNjTA8Amwjxqh4Fd3m3m9W++zgMaMcq09pzEwvfqW+faOkeDHqZ6DF0Fa 9UpkPR+fU9NQFdd5m0KQ5r/Cb5N7bxOfCpfnFrNB5aCZZZh1UuFLpQgv1sOuZDZWBlKg C4sBHSlyBZT1rGgiNZrdvRCbT7Kruom6A1i81nB7T5Rm7ntP+lL0Zt1IicqUgtADg7WR SLERH6wOltNbeTJlVj7W2aRLbwTTNBogjje1WY2D1lQZCXlKdIlgINTuaFaKo4voa/cT 0rdnp0dKIG8rnXXfg9qGR9q4FtxayKgo2nvUesi8vrGBDSBx23Isrem99Oo8AwoP4Mqe 4Mpw== 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=Xi28iljk8QFe3pbEB6IWCUGGYHAQicW/b5MZpmNsWoE=; b=YRq0omBIiSvOtavM3U7a6w8Df73QGux+Qlv/KPu6wmMz1Se5mojeENajTJY4voHFX6 w6O1n27Tf/BpxnWNKP79zKv3/v7w1zqWjSYz0afoIa1aKvivQ+OWosESNVu+NNBzzZ3X 9qmDHt6Exy1SsNslu0QrmLPF8ZTzlZtiV0W+7UvUFfT8UjMsep2MOASUdX/B2suA1Q3C fyCwACb10kd4QMaoQL7H9R+RjcnJiSUUwwo7FmXDU5dTXcUdo2Fn6lEFjh81THCIr/jO 9lG3O5VsRtwKZV3vn5N6BZvIsAYBiEj1nQutXH3nZZJ3manffh31I/nE49eP0DsqPs69 1AKg== X-Gm-Message-State: ALyK8tJzIzFT3Kw99F+vQso2QMsdOGiuOIP84A1Z7IjyrPBmSQ2KCCmfaXT6cLWi60XtpPOj X-Received: by 10.194.115.130 with SMTP id jo2mr941562wjb.82.1467906594839; Thu, 07 Jul 2016 08:49:54 -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 z1sm4286161wjh.14.2016.07.07.08.49.53 for (version=TLS1_2 cipher=AES128-SHA bits=128/128); Thu, 07 Jul 2016 08:49:54 -0700 (PDT) From: Adrien Mazarguil To: dev@dpdk.org Date: Thu, 7 Jul 2016 17:49:26 +0200 Message-Id: <756738f10ccaf83343c7c91ff33340814b6a8c5c.1467905467.git.adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: Subject: [dpdk-dev] [PATCH v3 04/11] 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: Thu, 07 Jul 2016 15:49:55 -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 0123c24..7991add 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 0f17323..755f150 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, @@ -1696,6 +1699,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