From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f44.google.com (mail-wm0-f44.google.com [74.125.82.44]) by dpdk.org (Postfix) with ESMTP id 7AA672E7B for ; Tue, 5 Apr 2016 16:08:34 +0200 (CEST) Received: by mail-wm0-f44.google.com with SMTP id u206so5976661wme.1 for ; Tue, 05 Apr 2016 07:08:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=dFJkfLBW/Hg8x5gHNcNdl0pXNSEdg6M3OjL0Nc+Oj/0=; b=v8tzj1kniy2bKAzzTiXx6XZReL/J0zufCMqR+A7+nRNxzEDPFwPUhB1AjpRFg0/TGy W2vzPb4PVTjMeXSGxEbXRxC9YdWA5c2ZG7I2TEDcEGwtVexs45V1GcWbLv1Hm0kfi9Kt CF6YKtunWO8sfjd9iLE11ss7L2gqmgQfbpHWaEFLFhgrnsQ6WKBWmEFN7l2zMa5PPR2x BKm6EKeoFNTsk7j28WDsFlYW3DeSK4jou2jgY57iYxHobImXlG7XB3dBGW9beG8HjLeR 3I15GpqQYN/3wanzrzON3IbnR4ylLsEecs2Qs50S10hxV9BJcJAS1cOcU2EBoGVWw27L uL0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=dFJkfLBW/Hg8x5gHNcNdl0pXNSEdg6M3OjL0Nc+Oj/0=; b=MgqzP18UVc+fasvH44VrljTAaL3f5dW0Vtgt8qUx93Vq4MdCinfgk/PzJiKlZz6YyY PJXEG91QAcsPaEcMbW+ooHN+2FSnmTfjYXAnJlsLGzf91Zc8BtmJfHJjbBIP08xcFA8f 7jvyvbCKxZoOXTsDtnO5/H+kUTmHuPisGPg5e3x2cR8kNsvZlEb9h0OuJxIHf/OUO/fy Y7R+e7hG87Q25nbXnHNbgAO1fitnwbLnQFjpO+jWUSHt9qWYF2wmEYtv+7g/csazu5qs OQIgFeT0+YvOjNeqsFLWrKT0+wwjmUFvg5QCW/raSVWzNW+Uk4DaC7L7gJgd+rW7F59s Jskw== X-Gm-Message-State: AD7BkJJs1w0OUPGsjJJSsgFbC5MkFqrdYaMDZ5zGVjV7K2jvCv6uPgK+GTKCpI/de6gvIgrA X-Received: by 10.194.185.179 with SMTP id fd19mr20425673wjc.107.1459865314377; Tue, 05 Apr 2016 07:08:34 -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 x2sm23399362wjr.33.2016.04.05.07.08.33 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 05 Apr 2016 07:08:33 -0700 (PDT) From: Adrien Mazarguil To: dev@dpdk.org Cc: Bruce Richardson , Thomas Monjalon Date: Tue, 5 Apr 2016 16:08:04 +0200 Message-Id: <1459865290-10248-5-git-send-email-adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1459865290-10248-1-git-send-email-adrien.mazarguil@6wind.com> References: <1459865290-10248-1-git-send-email-adrien.mazarguil@6wind.com> Subject: [dpdk-dev] [PATCH 04/10] lib: add extension keyword to 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 Apr 2016 14:08:34 -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 ba6042d..bea48bb 100644 --- a/lib/librte_cryptodev/rte_cryptodev.h +++ b/lib/librte_cryptodev/rte_cryptodev.h @@ -706,6 +706,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; @@ -729,6 +730,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 37ddd51..d002ba6 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -281,6 +281,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 */ @@ -372,6 +373,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. */ @@ -656,6 +658,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, @@ -1688,6 +1691,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 4397f5d..4ea6bf6 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 bad349a..81eb3e4 100644 --- a/lib/librte_mbuf/rte_mbuf.h +++ b/lib/librte_mbuf/rte_mbuf.h @@ -827,6 +827,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