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 99B693990 for ; Thu, 8 Sep 2016 14:25:26 +0200 (CEST) Received: by mail-wm0-f49.google.com with SMTP id w12so85891696wmf.0 for ; Thu, 08 Sep 2016 05:25:26 -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=RLcgyIwagMNH/38sQDxrBIzqa+AnDg/zGtmsWTuI63k=; b=Y/d0qmefmveB6KlV1blYdlNRzTNroshO7SJv1Twa0oToOT3DguvZgS/Zjks2JwJ4b0 517KaGfhU9puPxHu1u5SNVynngCBqov1PnBCsdFazqOqjcNj140Mgi5T+I04CwnNvgtp RGgXKYUCuWuK9Kpk1wSOqUWL/5t8N82hUxsRQ5mjoi5NF8xzNqOQaSFscsnSrF/CBxeO Kug7NgkvhRmxDZrISpJzrg8ctiRkJ0ZjfHgwlk2cISiotWzH4758PFI4k494RCLK1+mI LqGJN9J4OLgPJ60NFmOHP8EaeOTD9fUnKLMBFVz1IljzDPM3yLtSlwo7jIffmqEdbych 3Tvg== 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=RLcgyIwagMNH/38sQDxrBIzqa+AnDg/zGtmsWTuI63k=; b=JgZaQlEcCo4la63ULevk6NURlsKW1DfZ4rxVBlRLyjfxwsfqg3swd9VW3e8jXHZADC Axb0tTgG/MyCKOXzoFUXVZl+2SZ561N6lcSU3vLJQUOXG9B+V1D+hOpqEmBfVgXzqg1l BBxbZiUMB8J9xBVplY7VU61H0nycJqDRlzAIFqnRRpxEY2FDarQPZ00t3JKtfz/urrRS /UQUE0kHAuS1QI/fXZX5++YqqMTZxOTff4fcFmmbK/mxEHk114JzZiPfDcieuC3HlYGa pOyN5gffmLdlXOwSBmNNQwuMHEihEk1KHy81LDIJW1ZWSbRdP+P0FR38wUXFvZTT/He7 2Y6A== X-Gm-Message-State: AE9vXwNGHFoLXhGowAeKx4Q1zFsOg/JRdPNkDPLscWamgts6ENENq8kcC/M18SQIwl+3iQDU X-Received: by 10.194.40.132 with SMTP id x4mr28678871wjk.95.1473337526180; Thu, 08 Sep 2016 05:25:26 -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 l186sm9424080wmg.20.2016.09.08.05.25.25 for (version=TLS1_2 cipher=AES128-SHA bits=128/128); Thu, 08 Sep 2016 05:25:25 -0700 (PDT) From: Adrien Mazarguil To: dev@dpdk.org Date: Thu, 8 Sep 2016 14:25:05 +0200 Message-Id: X-Mailer: git-send-email 2.1.4 In-Reply-To: References: Subject: [dpdk-dev] [PATCH v5 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: Thu, 08 Sep 2016 12:25:26 -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 b0fe033..96575e8 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 7ae6554..c6cb299 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