Skip to contentSkip to conversation

lib/table: fix cache alignment issue

PATCH Superseded Ting Xu 1 participant 1 message Jul 9, 2020

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Ting Xu

author
#0 lore raw

PATCH v3 1/1 lib/table: fix cache alignment issue

When create softnic hash table with 16 keys, it failed on 32bit environment because of the structure rte_bucket_4_16 alignment issue. Add __rte_cache_aligned to ensure correct cache align.

Fixes 8aa327214c ("table: hash")

---
v2->v3: Rebase
v1->v2: Correct patch time

---
 lib/librte_table/rte_table_hash_key16.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/librte_table/rte_table_hash_key16.c +1 -1
index 2cca1c924..5e1665c15 100644
@@ -44,7 +44,7 @@ struct rte_bucket_4_16 {
 	uint64_t key[4][2];
 
 	/* Cache line 2 */
-	uint8_t data[0];
+	uint8_t data[0] __rte_cache_aligned;
 };
 
 struct rte_table_hash {
Signature · 1 line
2.17.1