Skip to contentSkip to conversation

net/memif: allocate socket hash on any NUMA socket

PATCH Applied Junxiao Shi 3 participants 4 messages Sep 28, 2021 – Oct 4, 2021 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/memif: allocate socket hash on any NUMA socket

Previously, memif socket hash is always allocated on NUMA socket 0. If the application is entirely running on another NUMA socket and EAL --socket-limit prevents memory allocation on NUMA socket 0, memif creation fails with "HASH: memory allocation failed" error.

This patch allows allocating memif socket hash on any NUMA socket.

---
 drivers/net/memif/memif_socket.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/memif/memif_socket.c +1 -0
index f58ff4c0cb..364e818d65 100644
@@ -946,6 +946,7 @@ memif_create_socket_hash(void)
 	params.key_len = MEMIF_SOCKET_UN_SIZE;
 	params.hash_func = rte_jhash;
 	params.hash_func_init_val = 0;
+	params.socket_id = SOCKET_ID_ANY;
 	return rte_hash_create(&params);
 }
 
Signature · 1 line
2.17.1
#1 lore raw
Quoted 18 lines · Junxiao Shi

Previously, memif socket hash is always allocated on NUMA socket 0. If the application is entirely running on another NUMA socket and EAL --socket-limit prevents memory allocation on NUMA socket 0, memif creation fails with "HASH: memory allocation failed" error.

This patch allows allocating memif socket hash on any NUMA socket.

---
 drivers/net/memif/memif_socket.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/memif/memif_socket.c +0 -0
index f58ff4c0cb..364e818d65 100644

drivers/net/memif/memif_socket.c memif_create_socket_hash(void) · line 952

Quoted 7 lines
drivers/net/memif/memif_socket.c +1 -0
@@ -946,6 +946,7 @@ memif_create_socket_hash(void)
 	params.key_len = MEMIF_SOCKET_UN_SIZE;
 	params.hash_func = rte_jhash;
 	params.hash_func_init_val = 0;
+	params.socket_id = SOCKET_ID_ANY;
 	return rte_hash_create(&params);
 }
 

looks good to me. cc'ed the memif maintainer.

#2 lore raw
Quoted 11 lines · Junxiao Shi
Quoted 8 lines

Previously, memif socket hash is always allocated on NUMA socket 0. If the application is entirely running on another NUMA socket and EAL --socket-limit prevents memory allocation on NUMA socket 0, memif creation fails with "HASH: memory allocation failed" error.

This patch allows allocating memif socket hash on any NUMA socket.

Looks ok. Thanks for the patch!

Reviewed-by Jakub Grajciar Applied
#3 lore raw
Quoted 12 lines · Jakub Grajciar -X (jgrajcia - PANTHEON TECH SRO at Cisco)
Quoted 11 lines · Junxiao Shi
Quoted 8 lines

Previously, memif socket hash is always allocated on NUMA socket 0. If the application is entirely running on another NUMA socket and EAL --socket-limit prevents memory allocation on NUMA socket 0, memif creation fails with "HASH: memory allocation failed" error.

This patch allows allocating memif socket hash on any NUMA socket.

Applied to dpdk-next-net/main, thanks.