Skip to content

Commit

Permalink
table: replace zero length array with flex array
Browse files Browse the repository at this point in the history
Zero length arrays are GNU extension. Replace with
standard flex array.

Signed-off-by: Tyler Retzlaff <[email protected]>
Reviewed-by: Morten Brørup <[email protected]>
  • Loading branch information
Tyler Retzlaff authored and david-marchand committed Apr 19, 2024
1 parent c03628d commit 42778fb
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lib/table/rte_table_acl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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[];
};


Expand Down
2 changes: 1 addition & 1 deletion lib/table/rte_table_array.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 *
Expand Down
2 changes: 1 addition & 1 deletion lib/table/rte_table_hash_cuckoo.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/table/rte_table_hash_ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/table/rte_table_hash_key16.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/table/rte_table_hash_key32.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/table/rte_table_hash_key8.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/table/rte_table_hash_lru.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/table/rte_table_lpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 *
Expand Down
2 changes: 1 addition & 1 deletion lib/table/rte_table_lpm_ipv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 *
Expand Down

0 comments on commit 42778fb

Please sign in to comment.