enic: fix allocation when not using first numa node
PATCH 1/2 enic: fix allocation when not using first numa node
Seen by code review.
If dpdk is run with memory only available on socket != 0, then enic pmd refuses to initialize ports as this pmd requires some memory on socket 0. Fix this by setting socket to SOCKET_ID_ANY, so that allocations happen on the caller socket.
--- drivers/net/enic/enic_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/enic/enic_main.c +1 -1
@@ -539,7 +539,7 @@ enic_alloc_consistent(__rte_unused void *priv, size_t size, *dma_handle =0 ; rz =rte_memzone_reserve_aligned ((const char *)name, - size,0 ,0 ,ENIC_ALIGN ); + size,SOCKET_ID_ANY ,0 ,ENIC_ALIGN );if (!rz) {pr_err ("%s : Failed to allocate memory requested for %s" , __func__, name);
Signature · 1 line
1.9.1
PATCH 2/2 enic: fix hash creation when not using first numa node
If dpdk is run with memory only available on socket != 0, then hash creation will fail and flow director feature won't be available. Fix this by asking for allocation on caller socket.
--- drivers/net/enic/enic_clsf.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/enic/enic_clsf.c +1 -2
@@ -61,7 +61,6 @@#define DEFAULT_HASH_FUNC rte_jhash#endif -#define SOCKET_0 0#define ENICPMD_CLSF_HASH_ENTRIES ENICPMD_FDIR_MAXvoid enic_fdir_stats_get (struct enic *enic,struct rte_eth_fdir_stats *stats)
@@ -247,7 +246,7 @@ int enic_clsf_init(struct enic *enic) .key_len = sizeof(struct rte_eth_fdir_filter), .hash_func = DEFAULT_HASH_FUNC, .hash_func_init_val = 0, - .socket_id = SOCKET_0, + .socket_id = SOCKET_ID_ANY, }; enic->fdir.hash =rte_hash_create (&hash_params);
Signature · 1 line
1.9.1
Re: [PATCH 2/2] enic: fix hash creation when not using first numa node
Quoted 23 lines · David Marchand
If dpdk is run with memory only available on socket != 0, then hash creation will fail and flow director feature won't be available. Fix this by asking for allocation on caller socket.
Signed-off-by David Marchand <[email protected]>---
drivers/net/enic/enic_clsf.c| 3 +--1 file changed, 1 insertion(+), 2 deletions(-)drivers/net/enic/enic_clsf.c +0
-1@@ -61,7 +61,6 @@#define DEFAULT_HASH_FUNC rte_jhash#endif -#define SOCKET_0 0#define ENICPMD_CLSF_HASH_ENTRIES ENICPMD_FDIR_MAXvoid
enic_fdir_stats_get(struct enic *enic, struct rte_eth_fdir_stats *stats)
drivers/net/enic/enic_clsf.c int enic_clsf_init(struct enic *enic)
Quoted 9 lines
drivers/net/enic/enic_clsf.c +1
-2@@ -247,7 +246,7 @@ int enic_clsf_init(struct enic *enic) .key_len = sizeof(struct rte_eth_fdir_filter), .hash_func = DEFAULT_HASH_FUNC, .hash_func_init_val = 0, - .socket_id = SOCKET_0, + .socket_id = SOCKET_ID_ANY, }; enic->fdir.hash =rte_hash_create (&hash_params); --
Acked by: Sujith Sankar <[email protected]>
Quoted 3 lines
1.9.1
Re: [PATCH 2/2] enic: fix hash creation when not using first numa node
Quoted 7 lines
Quoted 5 lines
If dpdk is run with memory only available on socket != 0, then hash creation will fail and flow director feature won't be available. Fix this by asking for allocation on caller socket.
Signed-off-by David Marchand <[email protected]>Acked by: Sujith Sankar <[email protected]>
Series applied, thanks.
Quoted 26 lines · David Marchand
Seen by code review.
If dpdk is run with memory only available on socket != 0, then enic pmd refuses to initialize ports as this pmd requires some memory on socket 0. Fix this by setting socket to
SOCKET_ID_ANY, so that allocations happen on the caller socket.Signed-off-by David Marchand <[email protected]>---
drivers/net/enic/enic_main.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/enic/enic_main.c +1
-1@@ -539,7 +539,7 @@ enic_alloc_consistent(__rte_unused void *priv, size_t size, *dma_handle =0 ; rz =rte_memzone_reserve_aligned ((const char *)name, - size,0 ,0 ,ENIC_ALIGN ); + size,SOCKET_ID_ANY ,0 ,ENIC_ALIGN );if (!rz) { pr_err("%s : Failed to allocate memory requested for %s",__func__, name);
Quoted 1 line
--
Acked by: Sujith Sankar <[email protected]>
Quoted 3 lines
1.9.1