From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C458843C5A; Wed, 6 Mar 2024 21:14:33 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BAD2E42EA5; Wed, 6 Mar 2024 21:14:06 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 55EF340647 for ; Wed, 6 Mar 2024 21:13:59 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 0EF6720B74C6; Wed, 6 Mar 2024 12:13:57 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 0EF6720B74C6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1709756038; bh=pVs5sASd/4GjOV9VzK63KCIC/Go1jqVnhnSbRNwPRwg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hDJH3FkPCYjF3ppBVsQVrSpjfg+SmCP6f+t3V3eZjqIJaBrjczgTqIjxcP0slbFsL 0VnIEmYxWZVJRmlZVOaNWZ3FDCrVEgPXtddIwCMx7CS1lAxr0lOyL+9tNdqcrUeKcM z0M9r4urrVM2fNE6T6bX7L9iMZx8jg6/UwXrATyQ= From: Tyler Retzlaff To: dev@dpdk.org Cc: Bruce Richardson , Cristian Dumitrescu , Honnappa Nagarahalli , Sameh Gobriel , Vladimir Medvedkin , Yipeng Wang , mb@smartsharesystems.com, fengchengwen@huawei.com, Tyler Retzlaff Subject: [PATCH v5 6/6] table: replace zero length array with flex array Date: Wed, 6 Mar 2024 12:13:56 -0800 Message-Id: <1709756036-24068-7-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1709756036-24068-1-git-send-email-roretzla@linux.microsoft.com> References: <1706134657-17446-1-git-send-email-roretzla@linux.microsoft.com> <1709756036-24068-1-git-send-email-roretzla@linux.microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Zero length arrays are GNU extension. Replace with standard flex array. Signed-off-by: Tyler Retzlaff Reviewed-by: Morten Brørup --- lib/table/rte_table_acl.c | 2 +- lib/table/rte_table_array.c | 2 +- lib/table/rte_table_hash_cuckoo.c | 2 +- lib/table/rte_table_hash_ext.c | 2 +- lib/table/rte_table_hash_key16.c | 2 +- lib/table/rte_table_hash_key32.c | 2 +- lib/table/rte_table_hash_key8.c | 2 +- lib/table/rte_table_hash_lru.c | 2 +- lib/table/rte_table_lpm.c | 2 +- lib/table/rte_table_lpm_ipv6.c | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/table/rte_table_acl.c b/lib/table/rte_table_acl.c index 6f3be6f..78779bb 100644 --- a/lib/table/rte_table_acl.c +++ b/lib/table/rte_table_acl.c @@ -48,7 +48,7 @@ struct rte_table_acl { uint8_t *acl_rule_memory; /* Memory to store the rules */ /* Memory to store the action table and stack of free entries */ - alignas(RTE_CACHE_LINE_SIZE) uint8_t memory[0]; + alignas(RTE_CACHE_LINE_SIZE) uint8_t memory[]; }; diff --git a/lib/table/rte_table_array.c b/lib/table/rte_table_array.c index 71aada4..84b5d67 100644 --- a/lib/table/rte_table_array.c +++ b/lib/table/rte_table_array.c @@ -40,7 +40,7 @@ struct __rte_cache_aligned rte_table_array { uint32_t entry_pos_mask; /* Internal table */ - alignas(RTE_CACHE_LINE_SIZE) uint8_t array[0]; + alignas(RTE_CACHE_LINE_SIZE) uint8_t array[]; }; static void * diff --git a/lib/table/rte_table_hash_cuckoo.c b/lib/table/rte_table_hash_cuckoo.c index 04668ca..388eae9 100644 --- a/lib/table/rte_table_hash_cuckoo.c +++ b/lib/table/rte_table_hash_cuckoo.c @@ -44,7 +44,7 @@ struct rte_table_hash { struct rte_hash *h_table; /* Lookup table */ - alignas(RTE_CACHE_LINE_SIZE) uint8_t memory[0]; + alignas(RTE_CACHE_LINE_SIZE) uint8_t memory[]; }; static int diff --git a/lib/table/rte_table_hash_ext.c b/lib/table/rte_table_hash_ext.c index ed93f24..91e5037 100644 --- a/lib/table/rte_table_hash_ext.c +++ b/lib/table/rte_table_hash_ext.c @@ -100,7 +100,7 @@ struct rte_table_hash { uint32_t *bkt_ext_stack; /* Table memory */ - alignas(RTE_CACHE_LINE_SIZE) uint8_t memory[0]; + alignas(RTE_CACHE_LINE_SIZE) uint8_t memory[]; }; static int diff --git a/lib/table/rte_table_hash_key16.c b/lib/table/rte_table_hash_key16.c index 6141815..67b77c1 100644 --- a/lib/table/rte_table_hash_key16.c +++ b/lib/table/rte_table_hash_key16.c @@ -85,7 +85,7 @@ struct rte_table_hash { uint32_t *stack; /* Lookup table */ - alignas(RTE_CACHE_LINE_SIZE) uint8_t memory[0]; + alignas(RTE_CACHE_LINE_SIZE) uint8_t memory[]; }; static int diff --git a/lib/table/rte_table_hash_key32.c b/lib/table/rte_table_hash_key32.c index c8f59ad..1aa86c6 100644 --- a/lib/table/rte_table_hash_key32.c +++ b/lib/table/rte_table_hash_key32.c @@ -85,7 +85,7 @@ struct rte_table_hash { uint32_t *stack; /* Lookup table */ - alignas(RTE_CACHE_LINE_SIZE) uint8_t memory[0]; + alignas(RTE_CACHE_LINE_SIZE) uint8_t memory[]; }; static int diff --git a/lib/table/rte_table_hash_key8.c b/lib/table/rte_table_hash_key8.c index cd91a0e..c8d72b3 100644 --- a/lib/table/rte_table_hash_key8.c +++ b/lib/table/rte_table_hash_key8.c @@ -81,7 +81,7 @@ struct rte_table_hash { uint32_t *stack; /* Lookup table */ - alignas(RTE_CACHE_LINE_SIZE) uint8_t memory[0]; + alignas(RTE_CACHE_LINE_SIZE) uint8_t memory[]; }; static int diff --git a/lib/table/rte_table_hash_lru.c b/lib/table/rte_table_hash_lru.c index 7b67b99..801e48f 100644 --- a/lib/table/rte_table_hash_lru.c +++ b/lib/table/rte_table_hash_lru.c @@ -77,7 +77,7 @@ struct rte_table_hash { uint32_t *key_stack; /* Table memory */ - alignas(RTE_CACHE_LINE_SIZE) uint8_t memory[0]; + alignas(RTE_CACHE_LINE_SIZE) uint8_t memory[]; }; static int diff --git a/lib/table/rte_table_lpm.c b/lib/table/rte_table_lpm.c index 89f8323..3e10c14 100644 --- a/lib/table/rte_table_lpm.c +++ b/lib/table/rte_table_lpm.c @@ -48,7 +48,7 @@ struct rte_table_lpm { /* Next Hop Table (NHT) */ uint32_t nht_users[RTE_TABLE_LPM_MAX_NEXT_HOPS]; - alignas(RTE_CACHE_LINE_SIZE) uint8_t nht[0]; + alignas(RTE_CACHE_LINE_SIZE) uint8_t nht[]; }; static void * diff --git a/lib/table/rte_table_lpm_ipv6.c b/lib/table/rte_table_lpm_ipv6.c index 3dec5dd..c1a7412 100644 --- a/lib/table/rte_table_lpm_ipv6.c +++ b/lib/table/rte_table_lpm_ipv6.c @@ -45,7 +45,7 @@ struct rte_table_lpm_ipv6 { /* Next Hop Table (NHT) */ uint32_t nht_users[RTE_TABLE_LPM_MAX_NEXT_HOPS]; - alignas(RTE_CACHE_LINE_SIZE) uint8_t nht[0]; + alignas(RTE_CACHE_LINE_SIZE) uint8_t nht[]; }; static void * -- 1.8.3.1