From patchwork Fri Feb 16 10:24:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 136846 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C6A5943B30; Fri, 16 Feb 2024 11:25:25 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A06DF43260; Fri, 16 Feb 2024 11:25:25 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 42DF142FCD for ; Fri, 16 Feb 2024 11:25:24 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1708079123; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Plh5Yalhnx69fXj2f8B/HRwRSc4+n1mjvuIo0q1QJ7A=; b=eBneLv4LsJCDOx9hH22WEJOqnHVxqA0DW9PtcwSXA3Vvmbg+5eXNuP5Gqx+yYChyYyAQ+R tUuD7Tj9b9Ew7mbdmFMTKbLvLqUo1Sr28dnzuYPipnQMAC+E8H5ULwkzpi3CtHLiSoxBH9 BDJMxql1a/ONwuFLgtx/yEW9WvYRRMs= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-463-EbVaMy5LOGye0lx53ySMvQ-1; Fri, 16 Feb 2024 05:25:17 -0500 X-MC-Unique: EbVaMy5LOGye0lx53ySMvQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 821E3185A785; Fri, 16 Feb 2024 10:25:16 +0000 (UTC) Received: from dmarchan.redhat.com (unknown [10.45.225.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1A4BD112132A; Fri, 16 Feb 2024 10:25:09 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: Tyler Retzlaff , Ruifeng Wang , Hemant Agrawal , Sachin Saxena , Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao , Kai Ji , Gagandeep Singh , Chengwen Feng , Jerin Jacob , Harman Kalra , Srikanth Yalavarthi , Shai Brandes , Evgeny Schemeilin , Ron Beider , Amit Bernstein , Wajeeh Atrash , Apeksha Gupta , Maciej Czekaj , Jiawen Wu , Jian Wang , Rosen Xu , Cristian Dumitrescu , Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko Subject: [PATCH v2 3/3] add extension keyword to GCC statement expressions Date: Fri, 16 Feb 2024 11:24:54 +0100 Message-ID: <20240216102454.4156609-4-david.marchand@redhat.com> In-Reply-To: <20240216102454.4156609-1-david.marchand@redhat.com> References: <1700089378-26197-1-git-send-email-roretzla@linux.microsoft.com> <20240216102454.4156609-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Tyler Retzlaff Add __extension__ keyword to gcc statement expression extensions. Signed-off-by: Tyler Retzlaff Reviewed-by: Ruifeng Wang Acked-by: Chengwen Feng --- drivers/bus/fslmc/mc/fsl_mc_sys.h | 6 ++-- drivers/common/cnxk/roc_io.h | 6 ++-- drivers/common/cnxk/roc_platform.h | 2 +- drivers/common/dpaax/dpaa_list.h | 2 +- drivers/common/qat/qat_adf/icp_qat_hw.h | 2 +- drivers/crypto/armv8/rte_armv8_pmd.c | 4 +-- drivers/crypto/caam_jr/caam_jr_desc.h | 2 +- drivers/dma/hisilicon/hisi_dmadev.c | 2 +- drivers/event/octeontx/ssovf_evdev.h | 4 +-- drivers/mempool/octeontx/octeontx_fpavf.h | 4 +-- drivers/ml/cnxk/cn10k_ml_dev.h | 4 +-- drivers/net/ena/base/ena_plat_dpdk.h | 14 ++++----- drivers/net/ena/ena_ethdev.c | 30 +++++++++---------- drivers/net/enetfec/enet_ethdev.h | 2 +- drivers/net/fm10k/base/fm10k_osdep.h | 2 +- drivers/net/octeontx/base/octeontx_io.h | 6 ++-- drivers/net/pfe/base/cbus.h | 2 +- drivers/net/pfe/base/pfe.h | 12 ++++---- drivers/net/tap/bpf/bpf_api.h | 2 +- drivers/net/thunderx/base/nicvf_plat.h | 4 +-- drivers/net/txgbe/base/txgbe_osdep.h | 2 +- drivers/raw/ifpga/afu_pmd_core.h | 2 +- drivers/raw/ifpga/base/ifpga_compat.h | 2 +- drivers/raw/ifpga/base/opae_osdep.h | 4 +-- drivers/raw/ifpga/base/opae_spi_transaction.c | 2 +- examples/qos_meter/main.h | 2 +- lib/ethdev/rte_mtr.c | 10 +++---- lib/ethdev/rte_tm.c | 6 ++-- lib/pipeline/rte_pipeline.c | 8 ++--- lib/pipeline/rte_swx_pipeline_internal.h | 2 +- lib/port/rte_port_source_sink.c | 4 +-- 31 files changed, 78 insertions(+), 78 deletions(-) diff --git a/drivers/bus/fslmc/mc/fsl_mc_sys.h b/drivers/bus/fslmc/mc/fsl_mc_sys.h index a310c5697e..c91f14ade8 100644 --- a/drivers/bus/fslmc/mc/fsl_mc_sys.h +++ b/drivers/bus/fslmc/mc/fsl_mc_sys.h @@ -40,11 +40,11 @@ struct fsl_mc_io { #define __arch_putq(v, a) (*(volatile uint64_t *)(a) = (v)) #define __arch_putq32(v, a) (*(volatile uint32_t *)(a) = (v)) #define readq(c) \ - ({ uint64_t __v = __arch_getq(c); __iormb(); __v; }) + __extension__ ({ uint64_t __v = __arch_getq(c); __iormb(); __v; }) #define writeq(v, c) \ - ({ uint64_t __v = v; __iowmb(); __arch_putq(__v, c); __v; }) + __extension__ ({ uint64_t __v = v; __iowmb(); __arch_putq(__v, c); __v; }) #define writeq32(v, c) \ - ({ uint32_t __v = v; __iowmb(); __arch_putq32(__v, c); __v; }) + __extension__ ({ uint32_t __v = v; __iowmb(); __arch_putq32(__v, c); __v; }) #define ioread64(_p) readq(_p) #define iowrite64(_v, _p) writeq(_v, _p) #define iowrite32(_v, _p) writeq32(_v, _p) diff --git a/drivers/common/cnxk/roc_io.h b/drivers/common/cnxk/roc_io.h index af1a10cd66..131578e625 100644 --- a/drivers/common/cnxk/roc_io.h +++ b/drivers/common/cnxk/roc_io.h @@ -30,21 +30,21 @@ #endif #define roc_load_pair(val0, val1, addr) \ - ({ \ + __extension__ ({ \ asm volatile("ldp %x[x0], %x[x1], [%x[p1]]" \ : [x0] "=r"(val0), [x1] "=r"(val1) \ : [p1] "r"(addr)); \ }) #define roc_store_pair(val0, val1, addr) \ - ({ \ + __extension__ ({ \ asm volatile( \ "stp %x[x0], %x[x1], [%x[p1], #0]!" ::[x0] "r"(val0), \ [x1] "r"(val1), [p1] "r"(addr)); \ }) #define roc_prefetch_store_keep(ptr) \ - ({ asm volatile("prfm pstl1keep, [%x0]\n" : : "r"(ptr)); }) + __extension__ ({ asm volatile("prfm pstl1keep, [%x0]\n" : : "r"(ptr)); }) #if defined(__clang__) static __plt_always_inline void diff --git a/drivers/common/cnxk/roc_platform.h b/drivers/common/cnxk/roc_platform.h index 9d2ea8f009..b7fe132093 100644 --- a/drivers/common/cnxk/roc_platform.h +++ b/drivers/common/cnxk/roc_platform.h @@ -82,7 +82,7 @@ /** Divide ceil */ #define PLT_DIV_CEIL(x, y) \ - ({ \ + __extension__ ({ \ __typeof(x) __x = x; \ __typeof(y) __y = y; \ (__x + __y - 1) / __y; \ diff --git a/drivers/common/dpaax/dpaa_list.h b/drivers/common/dpaax/dpaa_list.h index 319a3562ab..2bf013a186 100644 --- a/drivers/common/dpaax/dpaa_list.h +++ b/drivers/common/dpaax/dpaa_list.h @@ -31,7 +31,7 @@ do { \ #define list_entry(node, type, member) \ (type *)((void *)node - offsetof(type, member)) #define list_empty(p) \ -({ \ +__extension__ ({ \ const struct list_head *__p298 = (p); \ ((__p298->next == __p298) && (__p298->prev == __p298)); \ }) diff --git a/drivers/common/qat/qat_adf/icp_qat_hw.h b/drivers/common/qat/qat_adf/icp_qat_hw.h index 8b864e1630..33756d512d 100644 --- a/drivers/common/qat/qat_adf/icp_qat_hw.h +++ b/drivers/common/qat/qat_adf/icp_qat_hw.h @@ -292,7 +292,7 @@ enum icp_qat_hw_cipher_convert { #define QAT_CIPHER_AEAD_AAD_SIZE_BITPOS 16 #define QAT_CIPHER_AEAD_AAD_SIZE_LE_BITPOS 0 #define ICP_QAT_HW_CIPHER_CONFIG_BUILD_UPPER(aad_size) \ - ({ \ + __extension__ ({ \ typeof(aad_size) aad_size1 = aad_size; \ (((((aad_size1) >> QAT_CIPHER_AEAD_AAD_UPPER_SHIFT) & \ QAT_CIPHER_AEAD_AAD_SIZE_UPPER_MASK) << \ diff --git a/drivers/crypto/armv8/rte_armv8_pmd.c b/drivers/crypto/armv8/rte_armv8_pmd.c index 524c959ee0..320e2d4b3b 100644 --- a/drivers/crypto/armv8/rte_armv8_pmd.c +++ b/drivers/crypto/armv8/rte_armv8_pmd.c @@ -139,7 +139,7 @@ crypto_chain_order[] = { * Extract particular combined mode crypto function from the 3D array. */ #define CRYPTO_GET_ALGO(order, cop, calg, aalg, keyl) \ -({ \ +__extension__ ({ \ crypto_func_tbl_t *func_tbl = \ (crypto_chain_order[(order)])[(cop)]; \ \ @@ -186,7 +186,7 @@ crypto_key_sched_dir[] = { * Extract particular combined mode crypto function from the 3D array. */ #define CRYPTO_GET_KEY_SCHED(cop, calg, keyl) \ -({ \ +__extension__ ({ \ crypto_key_sched_tbl_t *ks_tbl = crypto_key_sched_dir[(cop)]; \ \ (calg >= CRYPTO_CIPHER_MAX) ? \ diff --git a/drivers/crypto/caam_jr/caam_jr_desc.h b/drivers/crypto/caam_jr/caam_jr_desc.h index 135d51c392..6fe6184b18 100644 --- a/drivers/crypto/caam_jr/caam_jr_desc.h +++ b/drivers/crypto/caam_jr/caam_jr_desc.h @@ -32,7 +32,7 @@ /* Macro for setting up a JD. The structure of the JD is common across all * supported protocols, thus its structure is identical. */ -#define SEC_JD_INIT(descriptor) ({ \ +#define SEC_JD_INIT(descriptor) __extension__ ({ \ /* CTYPE = job descriptor \ * RSMS, DNR = 0 * ONE = 1 diff --git a/drivers/dma/hisilicon/hisi_dmadev.c b/drivers/dma/hisilicon/hisi_dmadev.c index 0e11ca14cc..22303e7bef 100644 --- a/drivers/dma/hisilicon/hisi_dmadev.c +++ b/drivers/dma/hisilicon/hisi_dmadev.c @@ -124,7 +124,7 @@ hisi_dma_update_queue_mbit(struct hisi_dma_dev *hw, uint32_t qoff, hisi_dma_write_queue(hw, qoff, tmp); } -#define hisi_dma_poll_hw_state(hw, val, cond, sleep_us, timeout_us) ({ \ +#define hisi_dma_poll_hw_state(hw, val, cond, sleep_us, timeout_us) __extension__ ({ \ uint32_t timeout = 0; \ while (timeout++ <= (timeout_us)) { \ (val) = hisi_dma_read_queue(hw, HISI_DMA_QUEUE_FSM_REG); \ diff --git a/drivers/event/octeontx/ssovf_evdev.h b/drivers/event/octeontx/ssovf_evdev.h index e46dc055eb..8a4cb201d1 100644 --- a/drivers/event/octeontx/ssovf_evdev.h +++ b/drivers/event/octeontx/ssovf_evdev.h @@ -96,14 +96,14 @@ /* ARM64 specific functions */ #if defined(RTE_ARCH_ARM64) -#define ssovf_load_pair(val0, val1, addr) ({ \ +#define ssovf_load_pair(val0, val1, addr) __extension__ ({ \ asm volatile( \ "ldp %x[x0], %x[x1], [%x[p1]]" \ :[x0]"=r"(val0), [x1]"=r"(val1) \ :[p1]"r"(addr) \ ); }) -#define ssovf_store_pair(val0, val1, addr) ({ \ +#define ssovf_store_pair(val0, val1, addr) __extension__ ({ \ asm volatile( \ "stp %x[x0], %x[x1], [%x[p1]]" \ ::[x0]"r"(val0), [x1]"r"(val1), [p1]"r"(addr) \ diff --git a/drivers/mempool/octeontx/octeontx_fpavf.h b/drivers/mempool/octeontx/octeontx_fpavf.h index e27c4377e2..b9519f1801 100644 --- a/drivers/mempool/octeontx/octeontx_fpavf.h +++ b/drivers/mempool/octeontx/octeontx_fpavf.h @@ -59,14 +59,14 @@ /* ARM64 specific functions */ #if defined(RTE_ARCH_ARM64) -#define fpavf_load_pair(val0, val1, addr) ({ \ +#define fpavf_load_pair(val0, val1, addr) __extension__ ({ \ asm volatile( \ "ldp %x[x0], %x[x1], [%x[p1]]" \ :[x0]"=r"(val0), [x1]"=r"(val1) \ :[p1]"r"(addr) \ ); }) -#define fpavf_store_pair(val0, val1, addr) ({ \ +#define fpavf_store_pair(val0, val1, addr) __extension__ ({ \ asm volatile( \ "stp %x[x0], %x[x1], [%x[p1]]" \ ::[x0]"r"(val0), [x1]"r"(val1), [p1]"r"(addr) \ diff --git a/drivers/ml/cnxk/cn10k_ml_dev.h b/drivers/ml/cnxk/cn10k_ml_dev.h index cee405f3f5..2101f69b7e 100644 --- a/drivers/ml/cnxk/cn10k_ml_dev.h +++ b/drivers/ml/cnxk/cn10k_ml_dev.h @@ -44,8 +44,8 @@ extern struct rte_ml_dev_ops ml_dev_dummy_ops; /* Memory barrier macros */ #if defined(RTE_ARCH_ARM) -#define dmb_st ({ asm volatile("dmb st" : : : "memory"); }) -#define dsb_st ({ asm volatile("dsb st" : : : "memory"); }) +#define dmb_st __extension__ ({ asm volatile("dmb st" : : : "memory"); }) +#define dsb_st __extension__ ({ asm volatile("dsb st" : : : "memory"); }) #else #define dmb_st #define dsb_st diff --git a/drivers/net/ena/base/ena_plat_dpdk.h b/drivers/net/ena/base/ena_plat_dpdk.h index 665ac2f0cc..14bf582a45 100644 --- a/drivers/net/ena/base/ena_plat_dpdk.h +++ b/drivers/net/ena/base/ena_plat_dpdk.h @@ -141,9 +141,9 @@ extern int ena_logtype_com; #define ena_spinlock_t rte_spinlock_t #define ENA_SPINLOCK_INIT(spinlock) rte_spinlock_init(&(spinlock)) #define ENA_SPINLOCK_LOCK(spinlock, flags) \ - ({(void)(flags); rte_spinlock_lock(&(spinlock)); }) + __extension__ ({(void)(flags); rte_spinlock_lock(&(spinlock)); }) #define ENA_SPINLOCK_UNLOCK(spinlock, flags) \ - ({(void)(flags); rte_spinlock_unlock(&(spinlock)); }) + __extension__ ({(void)(flags); rte_spinlock_unlock(&(spinlock)); }) #define ENA_SPINLOCK_DESTROY(spinlock) ((void)(spinlock)) typedef struct { @@ -237,7 +237,7 @@ ena_mem_alloc_coherent(struct rte_eth_dev_data *data, size_t size, ENA_MEM_ALLOC_COHERENT_ALIGNED(dmadev, size, virt, phys, \ mem_handle, RTE_CACHE_LINE_SIZE) #define ENA_MEM_FREE_COHERENT(dmadev, size, virt, phys, mem_handle) \ - ({ ENA_TOUCH(size); ENA_TOUCH(phys); ENA_TOUCH(dmadev); \ + __extension__ ({ ENA_TOUCH(size); ENA_TOUCH(phys); ENA_TOUCH(dmadev); \ rte_memzone_free(mem_handle); }) #define ENA_MEM_ALLOC_COHERENT_NODE_ALIGNED( \ @@ -263,16 +263,16 @@ ena_mem_alloc_coherent(struct rte_eth_dev_data *data, size_t size, #define ENA_MEM_ALLOC(dmadev, size) rte_zmalloc(NULL, size, 1) #define ENA_MEM_FREE(dmadev, ptr, size) \ - ({ ENA_TOUCH(dmadev); ENA_TOUCH(size); rte_free(ptr); }) + __extension__ ({ ENA_TOUCH(dmadev); ENA_TOUCH(size); rte_free(ptr); }) #define ENA_DB_SYNC(mem_handle) ((void)mem_handle) #define ENA_REG_WRITE32(bus, value, reg) \ - ({ (void)(bus); rte_write32((value), (reg)); }) + __extension__ ({ (void)(bus); rte_write32((value), (reg)); }) #define ENA_REG_WRITE32_RELAXED(bus, value, reg) \ - ({ (void)(bus); rte_write32_relaxed((value), (reg)); }) + __extension__ ({ (void)(bus); rte_write32_relaxed((value), (reg)); }) #define ENA_REG_READ32(bus, reg) \ - ({ (void)(bus); rte_read32_relaxed((reg)); }) + __extension__ ({ (void)(bus); rte_read32_relaxed((reg)); }) #define ATOMIC32_INC(i32_ptr) rte_atomic32_inc(i32_ptr) #define ATOMIC32_DEC(i32_ptr) rte_atomic32_dec(i32_ptr) diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c index dc846d2e84..beb17c4125 100644 --- a/drivers/net/ena/ena_ethdev.c +++ b/drivers/net/ena/ena_ethdev.c @@ -459,7 +459,7 @@ mp_msg_init(struct rte_mp_msg *msg, enum ena_mp_req type, int port_id) * calls to the same proxied function under the same lock. */ #define ENA_PROXY(a, f, ...) \ -({ \ +__extension__ ({ \ struct ena_adapter *_a = (a); \ struct timespec ts = { .tv_sec = ENA_MP_REQ_TMO }; \ struct ena_mp_body *req, *rsp; \ @@ -507,13 +507,13 @@ mp_msg_init(struct rte_mp_msg *msg, enum ena_mp_req type, int port_id) *********************************************************************/ ENA_PROXY_DESC(ena_com_get_dev_basic_stats, ENA_MP_DEV_STATS_GET, -({ +__extension__ ({ ENA_TOUCH(adapter); ENA_TOUCH(req); ENA_TOUCH(ena_dev); ENA_TOUCH(stats); }), -({ +__extension__ ({ ENA_TOUCH(rsp); ENA_TOUCH(ena_dev); if (stats != &adapter->basic_stats) @@ -522,13 +522,13 @@ ENA_PROXY_DESC(ena_com_get_dev_basic_stats, ENA_MP_DEV_STATS_GET, struct ena_com_dev *ena_dev, struct ena_admin_basic_stats *stats); ENA_PROXY_DESC(ena_com_get_eni_stats, ENA_MP_ENI_STATS_GET, -({ +__extension__ ({ ENA_TOUCH(adapter); ENA_TOUCH(req); ENA_TOUCH(ena_dev); ENA_TOUCH(stats); }), -({ +__extension__ ({ ENA_TOUCH(rsp); ENA_TOUCH(ena_dev); if (stats != (struct ena_admin_eni_stats *)&adapter->metrics_stats) @@ -537,12 +537,12 @@ ENA_PROXY_DESC(ena_com_get_eni_stats, ENA_MP_ENI_STATS_GET, struct ena_com_dev *ena_dev, struct ena_admin_eni_stats *stats); ENA_PROXY_DESC(ena_com_set_dev_mtu, ENA_MP_MTU_SET, -({ +__extension__ ({ ENA_TOUCH(adapter); ENA_TOUCH(ena_dev); req->args.mtu = mtu; }), -({ +__extension__ ({ ENA_TOUCH(adapter); ENA_TOUCH(rsp); ENA_TOUCH(ena_dev); @@ -551,12 +551,12 @@ ENA_PROXY_DESC(ena_com_set_dev_mtu, ENA_MP_MTU_SET, struct ena_com_dev *ena_dev, int mtu); ENA_PROXY_DESC(ena_com_indirect_table_set, ENA_MP_IND_TBL_SET, -({ +__extension__ ({ ENA_TOUCH(adapter); ENA_TOUCH(req); ENA_TOUCH(ena_dev); }), -({ +__extension__ ({ ENA_TOUCH(adapter); ENA_TOUCH(rsp); ENA_TOUCH(ena_dev); @@ -564,13 +564,13 @@ ENA_PROXY_DESC(ena_com_indirect_table_set, ENA_MP_IND_TBL_SET, struct ena_com_dev *ena_dev); ENA_PROXY_DESC(ena_com_indirect_table_get, ENA_MP_IND_TBL_GET, -({ +__extension__ ({ ENA_TOUCH(adapter); ENA_TOUCH(req); ENA_TOUCH(ena_dev); ENA_TOUCH(ind_tbl); }), -({ +__extension__ ({ ENA_TOUCH(rsp); ENA_TOUCH(ena_dev); if (ind_tbl != adapter->indirect_table) @@ -580,14 +580,14 @@ ENA_PROXY_DESC(ena_com_indirect_table_get, ENA_MP_IND_TBL_GET, struct ena_com_dev *ena_dev, u32 *ind_tbl); ENA_PROXY_DESC(ena_com_get_customer_metrics, ENA_MP_CUSTOMER_METRICS_GET, -({ +__extension__ ({ ENA_TOUCH(adapter); ENA_TOUCH(req); ENA_TOUCH(ena_dev); ENA_TOUCH(buf); ENA_TOUCH(buf_size); }), -({ +__extension__ ({ ENA_TOUCH(rsp); ENA_TOUCH(ena_dev); ENA_TOUCH(buf_size); @@ -597,13 +597,13 @@ ENA_PROXY_DESC(ena_com_get_customer_metrics, ENA_MP_CUSTOMER_METRICS_GET, struct ena_com_dev *ena_dev, char *buf, size_t buf_size); ENA_PROXY_DESC(ena_com_get_ena_srd_info, ENA_MP_SRD_STATS_GET, -({ +__extension__ ({ ENA_TOUCH(adapter); ENA_TOUCH(req); ENA_TOUCH(ena_dev); ENA_TOUCH(info); }), -({ +__extension__ ({ ENA_TOUCH(rsp); ENA_TOUCH(ena_dev); if ((struct ena_stats_srd *)info != &adapter->srd_stats) diff --git a/drivers/net/enetfec/enet_ethdev.h b/drivers/net/enetfec/enet_ethdev.h index 573b0672cd..02a3397890 100644 --- a/drivers/net/enetfec/enet_ethdev.h +++ b/drivers/net/enetfec/enet_ethdev.h @@ -42,7 +42,7 @@ #define ENETFEC_MAX_Q 1 -#define writel(v, p) ({*(volatile unsigned int *)(p) = (v); }) +#define writel(v, p) __extension__ ({*(volatile unsigned int *)(p) = (v); }) #define readl(p) rte_read32(p) struct bufdesc { diff --git a/drivers/net/fm10k/base/fm10k_osdep.h b/drivers/net/fm10k/base/fm10k_osdep.h index 019fba5e25..25f46c3908 100644 --- a/drivers/net/fm10k/base/fm10k_osdep.h +++ b/drivers/net/fm10k/base/fm10k_osdep.h @@ -102,7 +102,7 @@ typedef uint64_t u64; #endif #ifndef do_div -#define do_div(n, base) ({\ +#define do_div(n, base) __extension__ ({\ (n) = (n) / (base);\ }) #endif /* do_div */ diff --git a/drivers/net/octeontx/base/octeontx_io.h b/drivers/net/octeontx/base/octeontx_io.h index d0b9cfbc67..323e34b634 100644 --- a/drivers/net/octeontx/base/octeontx_io.h +++ b/drivers/net/octeontx/base/octeontx_io.h @@ -19,17 +19,17 @@ /* ARM64 specific functions */ #if defined(RTE_ARCH_ARM64) -#define octeontx_prefetch_store_keep(_ptr) ({\ +#define octeontx_prefetch_store_keep(_ptr) __extension__ ({\ asm volatile("prfm pstl1keep, %a0\n" : : "p" (_ptr)); }) -#define octeontx_load_pair(val0, val1, addr) ({ \ +#define octeontx_load_pair(val0, val1, addr) __extension__ ({ \ asm volatile( \ "ldp %x[x0], %x[x1], [%x[p1]]" \ :[x0]"=r"(val0), [x1]"=r"(val1) \ :[p1]"r"(addr) \ ); }) -#define octeontx_store_pair(val0, val1, addr) ({ \ +#define octeontx_store_pair(val0, val1, addr) __extension__ ({ \ asm volatile( \ "stp %x[x0], %x[x1], [%x[p1]]" \ ::[x0]"r"(val0), [x1]"r"(val1), [p1]"r"(addr) \ diff --git a/drivers/net/pfe/base/cbus.h b/drivers/net/pfe/base/cbus.h index fe7ea60067..7b30588c6a 100644 --- a/drivers/net/pfe/base/cbus.h +++ b/drivers/net/pfe/base/cbus.h @@ -36,7 +36,7 @@ /* Byte Enables of the Internal memory access. These are interpred in BE */ #define PE_MEM_ACCESS_BYTE_ENABLE(offset, size) \ - ({ typeof(size) size_ = (size); \ + __extension__ ({ typeof(size) size_ = (size); \ (((BIT(size_) - 1) << (4 - (offset) - (size_))) & 0xf) << 24; }) #include "cbus/emac_mtip.h" diff --git a/drivers/net/pfe/base/pfe.h b/drivers/net/pfe/base/pfe.h index 0a88e98c1b..b9cf6827f1 100644 --- a/drivers/net/pfe/base/pfe.h +++ b/drivers/net/pfe/base/pfe.h @@ -95,36 +95,36 @@ test_and_set_bit(unsigned long nr, void *addr) #define PMEM_SIZE 0x8000 /* TMU has less... */ #define PMEM_END (PMEM_BASE_ADDR + PMEM_SIZE) -#define writel(v, p) ({*(volatile unsigned int *)(p) = (v); }) +#define writel(v, p) __extension__ ({*(volatile unsigned int *)(p) = (v); }) #define readl(p) (*(const volatile unsigned int *)(p)) /* These check memory ranges from PE point of view/memory map */ #define IS_DMEM(addr, len) \ - ({ typeof(addr) addr_ = (addr); \ + __extension__ ({ typeof(addr) addr_ = (addr); \ ((unsigned long)(addr_) >= DMEM_BASE_ADDR) && \ (((unsigned long)(addr_) + (len)) <= DMEM_END); }) #define IS_PMEM(addr, len) \ - ({ typeof(addr) addr_ = (addr); \ + __extension__ ({ typeof(addr) addr_ = (addr); \ ((unsigned long)(addr_) >= PMEM_BASE_ADDR) && \ (((unsigned long)(addr_) + (len)) <= PMEM_END); }) #define IS_PE_LMEM(addr, len) \ - ({ typeof(addr) addr_ = (addr); \ + __extension__ ({ typeof(addr) addr_ = (addr); \ ((unsigned long)(addr_) >= \ PE_LMEM_BASE_ADDR) && \ (((unsigned long)(addr_) + \ (len)) <= PE_LMEM_END); }) #define IS_PFE_LMEM(addr, len) \ - ({ typeof(addr) addr_ = (addr); \ + __extension__ ({ typeof(addr) addr_ = (addr); \ ((unsigned long)(addr_) >= \ CBUS_VIRT_TO_PFE(LMEM_BASE_ADDR)) && \ (((unsigned long)(addr_) + (len)) <= \ CBUS_VIRT_TO_PFE(LMEM_END)); }) #define __IS_PHYS_DDR(addr, len) \ - ({ typeof(addr) addr_ = (addr); \ + __extension__ ({ typeof(addr) addr_ = (addr); \ ((unsigned long)(addr_) >= \ DDR_PHYS_BASE_ADDR) && \ (((unsigned long)(addr_) + (len)) <= \ diff --git a/drivers/net/tap/bpf/bpf_api.h b/drivers/net/tap/bpf/bpf_api.h index 2638a8a4ac..4cd25fa593 100644 --- a/drivers/net/tap/bpf/bpf_api.h +++ b/drivers/net/tap/bpf/bpf_api.h @@ -162,7 +162,7 @@ static void BPF_FUNC(trace_printk, const char *fmt, int fmt_size, ...); #ifndef printt # define printt(fmt, ...) \ - ({ \ + __extension__ ({ \ char ____fmt[] = fmt; \ trace_printk(____fmt, sizeof(____fmt), ##__VA_ARGS__); \ }) diff --git a/drivers/net/thunderx/base/nicvf_plat.h b/drivers/net/thunderx/base/nicvf_plat.h index dd054627e9..8421f57040 100644 --- a/drivers/net/thunderx/base/nicvf_plat.h +++ b/drivers/net/thunderx/base/nicvf_plat.h @@ -55,11 +55,11 @@ /* ARM64 specific functions */ #if defined(RTE_ARCH_ARM64) -#define nicvf_prefetch_store_keep(_ptr) ({\ +#define nicvf_prefetch_store_keep(_ptr) __extension__ ({\ asm volatile("prfm pstl1keep, [%x0]\n" : : "r" (_ptr)); }) -#define NICVF_LOAD_PAIR(reg1, reg2, addr) ({ \ +#define NICVF_LOAD_PAIR(reg1, reg2, addr) __extension__ ({ \ asm volatile( \ "ldp %x[x1], %x[x0], [%x[p1]]" \ : [x1]"=r"(reg1), [x0]"=r"(reg2)\ diff --git a/drivers/net/txgbe/base/txgbe_osdep.h b/drivers/net/txgbe/base/txgbe_osdep.h index b62c0b0824..4fce355000 100644 --- a/drivers/net/txgbe/base/txgbe_osdep.h +++ b/drivers/net/txgbe/base/txgbe_osdep.h @@ -172,7 +172,7 @@ static inline u64 REVERT_BIT_MASK64(u64 mask) /* Check whether an address is broadcast. */ #define TXGBE_IS_BROADCAST(address) \ - ({typeof(address)addr = (address); \ + __extension__ ({typeof(address)addr = (address); \ (((u8 *)(addr))[0] == ((u8)0xff)) && \ (((u8 *)(addr))[1] == ((u8)0xff)); }) diff --git a/drivers/raw/ifpga/afu_pmd_core.h b/drivers/raw/ifpga/afu_pmd_core.h index ab5a228147..a8f1afe343 100644 --- a/drivers/raw/ifpga/afu_pmd_core.h +++ b/drivers/raw/ifpga/afu_pmd_core.h @@ -66,7 +66,7 @@ afu_rawdev_get_priv(const struct rte_rawdev *rawdev) #define MHZ(f) ((f) * 1000000) #define dsm_poll_timeout(addr, val, cond, invl, timeout) \ -({ \ +__extension__ ({ \ uint64_t __wait = 0; \ uint64_t __invl = (invl); \ uint64_t __timeout = (timeout); \ diff --git a/drivers/raw/ifpga/base/ifpga_compat.h b/drivers/raw/ifpga/base/ifpga_compat.h index 8a624d174f..95fba6c28e 100644 --- a/drivers/raw/ifpga/base/ifpga_compat.h +++ b/drivers/raw/ifpga/base/ifpga_compat.h @@ -31,7 +31,7 @@ * by polling with given interval and timeout. */ #define fpga_wait_register_field(_field, _expect, _reg_addr, _timeout, _invl)\ -({ \ +__extension__ ({ \ int wait = 0; \ int ret = -ETIMEDOUT; \ typeof(_expect) value; \ diff --git a/drivers/raw/ifpga/base/opae_osdep.h b/drivers/raw/ifpga/base/opae_osdep.h index e91205f536..cb780b1fed 100644 --- a/drivers/raw/ifpga/base/opae_osdep.h +++ b/drivers/raw/ifpga/base/opae_osdep.h @@ -81,7 +81,7 @@ struct uuid { #define opae_memset(a, b, c) memset((a), (b), (c)) #define readx_poll_timeout(op, val, cond, invl, timeout, args...) \ -({ \ +__extension__ ({ \ unsigned long __wait = 0; \ unsigned long __invl = (invl); \ unsigned long __timeout = (timeout); \ @@ -107,7 +107,7 @@ struct uuid { readx_poll_timeout(opae_readb, val, cond, invl, timeout, addr) #define opae_max10_read_poll_timeout(dev, addr, value, cond, invl, timeout) \ -({ \ +__extension__ ({ \ int __ret, __tmp; \ __tmp = readx_poll_timeout(max10_sys_read, __ret, __ret || (cond), \ invl, timeout, (dev), (addr), &(value)); \ diff --git a/drivers/raw/ifpga/base/opae_spi_transaction.c b/drivers/raw/ifpga/base/opae_spi_transaction.c index cd50d40629..21015eb95e 100644 --- a/drivers/raw/ifpga/base/opae_spi_transaction.c +++ b/drivers/raw/ifpga/base/opae_spi_transaction.c @@ -24,7 +24,7 @@ #define SPI_REG_BYTES 4 #define INIT_SPI_TRAN_HEADER(trans_type, size, address) \ -({ \ +__extension__ ({ \ header.trans_type = trans_type; \ header.reserve = 0; \ header.size = cpu_to_be16(size); \ diff --git a/examples/qos_meter/main.h b/examples/qos_meter/main.h index 864f019f69..59e5e0bce7 100644 --- a/examples/qos_meter/main.h +++ b/examples/qos_meter/main.h @@ -24,7 +24,7 @@ enum policer_action policer_table[RTE_COLORS][RTE_COLORS] = #if APP_MODE == APP_MODE_FWD #define FUNC_METER(m, p, time, pkt_len, pkt_color) \ -({ \ +__extension__ ({ \ void *mp = m; \ void *pp = p; \ mp = mp; \ diff --git a/lib/ethdev/rte_mtr.c b/lib/ethdev/rte_mtr.c index 4e94af9d9f..900837bc09 100644 --- a/lib/ethdev/rte_mtr.c +++ b/lib/ethdev/rte_mtr.c @@ -41,14 +41,14 @@ rte_mtr_ops_get(uint16_t port_id, struct rte_mtr_error *error) } #define RTE_MTR_FUNC(port_id, func) \ -({ \ +__extension__ ({ \ const struct rte_mtr_ops *ops = \ - rte_mtr_ops_get(port_id, error); \ - if (ops == NULL) \ + rte_mtr_ops_get(port_id, error); \ + if (ops == NULL) \ return -rte_errno; \ \ if (ops->func == NULL) \ - return -rte_mtr_error_set(error, \ + return -rte_mtr_error_set(error, \ ENOSYS, \ RTE_MTR_ERROR_TYPE_UNSPECIFIED, \ NULL, \ @@ -58,7 +58,7 @@ rte_mtr_ops_get(uint16_t port_id, struct rte_mtr_error *error) }) #define RTE_MTR_HNDL_FUNC(port_id, func) \ -({ \ +__extension__ ({ \ const struct rte_mtr_ops *ops = \ rte_mtr_ops_get(port_id, error); \ if (ops == NULL) \ diff --git a/lib/ethdev/rte_tm.c b/lib/ethdev/rte_tm.c index 2d08141133..d594fe0049 100644 --- a/lib/ethdev/rte_tm.c +++ b/lib/ethdev/rte_tm.c @@ -40,11 +40,11 @@ rte_tm_ops_get(uint16_t port_id, struct rte_tm_error *error) return ops; } -#define RTE_TM_FUNC(port_id, func) \ -({ \ +#define RTE_TM_FUNC(port_id, func) \ +__extension__ ({ \ const struct rte_tm_ops *ops = \ rte_tm_ops_get(port_id, error); \ - if (ops == NULL) \ + if (ops == NULL) \ return -rte_errno; \ \ if (ops->func == NULL) \ diff --git a/lib/pipeline/rte_pipeline.c b/lib/pipeline/rte_pipeline.c index c9ed903d71..945bb025a1 100644 --- a/lib/pipeline/rte_pipeline.c +++ b/lib/pipeline/rte_pipeline.c @@ -23,16 +23,16 @@ RTE_LOG_REGISTER_DEFAULT(pipeline_logtype, INFO); #ifdef RTE_PIPELINE_STATS_COLLECT #define RTE_PIPELINE_STATS_AH_DROP_WRITE(p, mask) \ - ({ (p)->n_pkts_ah_drop = rte_popcount64(mask); }) + __extension__ ({ (p)->n_pkts_ah_drop = rte_popcount64(mask); }) #define RTE_PIPELINE_STATS_AH_DROP_READ(p, counter) \ - ({ (counter) += (p)->n_pkts_ah_drop; (p)->n_pkts_ah_drop = 0; }) + __extension__ ({ (counter) += (p)->n_pkts_ah_drop; (p)->n_pkts_ah_drop = 0; }) #define RTE_PIPELINE_STATS_TABLE_DROP0(p) \ - ({ (p)->pkts_drop_mask = (p)->action_mask0[RTE_PIPELINE_ACTION_DROP]; }) + __extension__ ({ (p)->pkts_drop_mask = (p)->action_mask0[RTE_PIPELINE_ACTION_DROP]; }) #define RTE_PIPELINE_STATS_TABLE_DROP1(p, counter) \ -({ \ +__extension__ ({ \ uint64_t mask = (p)->action_mask0[RTE_PIPELINE_ACTION_DROP]; \ mask ^= (p)->pkts_drop_mask; \ (counter) += rte_popcount64(mask); \ diff --git a/lib/pipeline/rte_swx_pipeline_internal.h b/lib/pipeline/rte_swx_pipeline_internal.h index 8ec12263b9..92eb933376 100644 --- a/lib/pipeline/rte_swx_pipeline_internal.h +++ b/lib/pipeline/rte_swx_pipeline_internal.h @@ -1485,7 +1485,7 @@ instr_operand_nbo(struct thread *t, const struct instr_operand *x) #endif #define METADATA_READ(thread, offset, n_bits) \ -({ \ +__extension__ ({ \ uint64_t *m64_ptr = (uint64_t *)&(thread)->metadata[offset]; \ uint64_t m64 = *m64_ptr; \ uint64_t m64_mask = UINT64_MAX >> (64 - (n_bits)); \ diff --git a/lib/port/rte_port_source_sink.c b/lib/port/rte_port_source_sink.c index 4426f13499..a4486a7199 100644 --- a/lib/port/rte_port_source_sink.c +++ b/lib/port/rte_port_source_sink.c @@ -178,7 +178,7 @@ pcap_source_load(struct rte_port_source *port, #else /* RTE_PORT_PCAP */ #define PCAP_SOURCE_LOAD(port, file_name, n_bytes, socket_id) \ -({ \ +__extension__ ({ \ int _ret = 0; \ \ if (file_name) { \ @@ -431,7 +431,7 @@ do { \ #else #define PCAP_SINK_OPEN(port, file_name, max_n_pkts) \ -({ \ +__extension__ ({ \ int _ret = 0; \ \ if (file_name) { \