From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f43.google.com (mail-wm0-f43.google.com [74.125.82.43]) by dpdk.org (Postfix) with ESMTP id 9C0F25682 for ; Tue, 5 Jul 2016 12:45:14 +0200 (CEST) Received: by mail-wm0-f43.google.com with SMTP id r201so146818328wme.1 for ; Tue, 05 Jul 2016 03:45:14 -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=t/nARCa2T+HNMZW4yAP7aIvQizfUzlCdbjEBEGbhXsA=; b=u4xe+TYf2ScFpTyeYAw0aldT0E+Hzi52XilgqRWoij9BLVzUT2aGdhPxeVxy37+fzu oPhms8BugENJKARc2v3QHdaLBg9C7RQKW0T+45zNqXpYfbVJgzI3kW7v1OVEQnSZ/+Am WSKOcDMQq/txEcOaKng1N+IckokGpp9GGiPTgyItdnSEI0Q3brpZqXBnIDZ417Z0ha6M EFat7pUxmL/+9QpSoUnlmlxNZknwAphOYyALh/KSuCnvWxJz61AwmtFD3/jF1lADrOfI OjE1JsvWbuVamG4lKwEFfKCbgdcjdKoInBZ2vw9SD5xltrnT29U2jkwLSi4Gk6WVNDfR uOqw== 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=t/nARCa2T+HNMZW4yAP7aIvQizfUzlCdbjEBEGbhXsA=; b=XXHQZkhLnmUFe9Ym5NHTpy2EXJeF+uyPhzRQyzQudk0ddTK1g1alp9DJfkLxG3tHDj 3QCoKozLbULHguKadAc0lfC7Yv9Y9kQUYF6G2WsU/C9s/9E1mTjNfZ+hYy+KV9hQj/xZ a/6Ov2i041K4t1T30dVJlel1Ay1Lzj3PtQ/AgDgNDuIzHHLsWOLC4bm6HzbwD2xAg4FX xrNS+g1LBmuFMFChZsmAFFjmb6L9FaUmfIYYjR8GPL3C+sv/W6XVOmKTdyAws6D2uGCj qWUdAouAe9UtQszmCMLOfS78ecPk1cqUI3jFFIy72guIs3zFGManov0qRXXXVXreciP1 hOFA== X-Gm-Message-State: ALyK8tKGnVZiAcmXhVwJdxQB6TQTcjm5PcAIE2bk7ao+bUNNFp33hykyOsQ8wBsEp5ENcbvH X-Received: by 10.194.114.106 with SMTP id jf10mr16829516wjb.48.1467715514153; Tue, 05 Jul 2016 03:45:14 -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 x194sm11812229wmf.13.2016.07.05.03.45.13 for (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 05 Jul 2016 03:45:13 -0700 (PDT) From: Adrien Mazarguil To: dev@dpdk.org Date: Tue, 5 Jul 2016 12:44:50 +0200 Message-Id: <87ab23e29d5138af3d0d652efc1907088e2dd5a8.1467715254.git.adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: <1459865290-10248-1-git-send-email-adrien.mazarguil@6wind.com> Subject: [dpdk-dev] [PATCH v2 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: Tue, 05 Jul 2016 10:45:14 -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_ether/rte_ethdev.h | 4 ++++ lib/librte_lpm/rte_lpm.h | 4 ++++ lib/librte_mbuf/rte_mbuf.h | 1 + 4 files changed, 11 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_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_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