From d27a8fd01f596932f081e2b75383afe9d35543b7 Mon Sep 17 00:00:00 2001 From: Beilei Xing Date: Fri, 17 Feb 2017 16:37:56 +0800 Subject: [PATCH] net/i40e: fix memory allocation for hash table Testpmd failed to start in another hugetlbfs mount point on i40e, the root cause is that hash table is always allocated on socket 0. Issue can be reproduced by forcing testpmd to allocate memory only from node 1: testpmd --socket-mem=0,8192 -- -i --socket-num=1 EAL: PCI device 0000:81:00.0 on NUMA socket 1 EAL: probe driver: 8086:1572 net_i40e PMD: eth_i40e_dev_init(): FW 4.40 API 1.4 NVM 04.05.03 eetrack 80001cd8 RING: Cannot reserve memory HASH: memory allocation failed PMD: i40e_init_ethtype_filter_list(): Failed to create ethertype hash table! EAL: Error - exiting with code: 1 Cause: Requested device 0000:81:00.0 cannot be used Fix the issue by assigning socket id during hash parameter definition. Fixes: 5c53c82c8174 ("net/i40e: store flow director filter") Fixes: 425c3325f0b0 ("net/i40e: store tunnel filter") Fixes: 078259773da9 ("net/i40e: store ethertype filter") Cc: stable@dpdk.org Reported-by: Ivan Nardi Signed-off-by: Beilei Xing --- drivers/net/i40e/i40e_ethdev.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index f54a1587be..799de0546f 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -901,6 +901,8 @@ i40e_init_ethtype_filter_list(struct rte_eth_dev *dev) .entries = I40E_MAX_ETHERTYPE_FILTER_NUM, .key_len = sizeof(struct i40e_ethertype_filter_input), .hash_func = rte_hash_crc, + .hash_func_init_val = 0, + .socket_id = rte_socket_id(), }; /* Initialize ethertype filter rule list and hash */ @@ -944,6 +946,8 @@ i40e_init_tunnel_filter_list(struct rte_eth_dev *dev) .entries = I40E_MAX_TUNNEL_FILTER_NUM, .key_len = sizeof(struct i40e_tunnel_filter_input), .hash_func = rte_hash_crc, + .hash_func_init_val = 0, + .socket_id = rte_socket_id(), }; /* Initialize tunnel filter rule list and hash */ @@ -987,6 +991,8 @@ i40e_init_fdir_filter_list(struct rte_eth_dev *dev) .entries = I40E_MAX_FDIR_FILTER_NUM, .key_len = sizeof(struct rte_eth_fdir_input), .hash_func = rte_hash_crc, + .hash_func_init_val = 0, + .socket_id = rte_socket_id(), }; /* Initialize flow director filter rule list and hash */ -- 2.20.1