net/memif: allocate socket hash on any NUMA socket

Message ID 973fc5b37c6164c1@cs.arizona.edu (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series net/memif: allocate socket hash on any NUMA socket |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/github-robot: build success github build: passed
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance fail Performance Testing issues
ci/iol-x86_64-compile-testing fail Testing issues
ci/iol-x86_64-unit-testing fail Testing issues

Commit Message

Junxiao Shi Sept. 28, 2021, 1:51 p.m. UTC
  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.

Signed-off-by: Junxiao Shi <git@mail1.yoursunny.com>
---
 drivers/net/memif/memif_socket.c | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Ferruh Yigit Sept. 30, 2021, 1:31 p.m. UTC | #1
On 9/28/2021 2:51 PM, Junxiao Shi wrote:
> 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.
> 
> Signed-off-by: Junxiao Shi <git@mail1.yoursunny.com>
> ---
>  drivers/net/memif/memif_socket.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/memif/memif_socket.c b/drivers/net/memif/memif_socket.c
> index f58ff4c0cb..364e818d65 100644
> --- a/drivers/net/memif/memif_socket.c
> +++ b/drivers/net/memif/memif_socket.c
> @@ -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.
  
Jakub Grajciar -X (jgrajcia - PANTHEON TECH SRO at Cisco) Oct. 4, 2021, 12:02 p.m. UTC | #2
> On 9/28/2021 2:51 PM, Junxiao Shi wrote:
> > 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.
> >
> > Signed-off-by: Junxiao Shi <git@mail1.yoursunny.com>

Looks ok. Thanks for the patch!
  
Ferruh Yigit Oct. 4, 2021, 5:29 p.m. UTC | #3
On 10/4/2021 1:02 PM, Jakub Grajciar -X (jgrajcia - PANTHEON TECH SRO at Cisco) wrote:
> 
> 
>> On 9/28/2021 2:51 PM, Junxiao Shi wrote:
>>> 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.
>>>
>>> Signed-off-by: Junxiao Shi <git@mail1.yoursunny.com>
> 

Reviewed-by: Jakub Grajciar <jgrajcia@cisco.com>

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

Patch

diff --git a/drivers/net/memif/memif_socket.c b/drivers/net/memif/memif_socket.c
index f58ff4c0cb..364e818d65 100644
--- a/drivers/net/memif/memif_socket.c
+++ b/drivers/net/memif/memif_socket.c
@@ -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);
 }