Skip to contentSkip to conversation

lib/librte_ether: change socket_id passed to rte_memzone_reserve

PATCH In review Cian Ferriter 2 participants 2 messages Jan 22, 2015 – Jan 27, 2015 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib/librte_ether: change socket_id passed to rte_memzone_reserve

Removes the dependency that this memzone reserve has on the socket currently running on. Following the socket of the master core will yield more predictable results when calling this function after initialisation.

---
 lib/librte_ether/rte_ethdev.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
 mode change 100644 => 100755 lib/librte_ether/rte_ethdev.c
lib/librte_ether/rte_ethdev.c +1 -1
old mode 100644
new mode 100755
index ea3a1fb..088bffc
@@ -184,7 +184,7 @@ rte_eth_dev_data_alloc(void)
 	if (rte_eal_process_type() == RTE_PROC_PRIMARY){
 		mz = rte_memzone_reserve(MZ_RTE_ETH_DEV_DATA,
 				RTE_MAX_ETHPORTS * sizeof(*rte_eth_dev_data),
-				rte_socket_id(), flags);
+				rte_lcore_to_socket_id(rte_get_master_lcore()), flags);
 	} else
 		mz = rte_memzone_lookup(MZ_RTE_ETH_DEV_DATA);
 	if (mz == NULL)
Signature · 1 line
1.7.4.1
#2 lore raw
In reply to a message not in the archive

Hi,

2015-01-22 15:05, Cian Ferriter:

Quoted 4 lines

Removes the dependency that this memzone reserve has on the socket currently running on. Following the socket of the master core will yield more predictable results when calling this function after initialisation.

You don't describe what is the problem. In another mail, you say "The original suggestion also fixes the crash that I was seeing because of memory being reserved from a numa node with no "--socket-mem" allocated." Please describe it clearly in the commit log.

You should also explain what this rte_memzone_reserve() is for, and what are the incidences of your changes.

Thanks

Signature · 1 line
Thomas
Quoted 6 lines
lib/librte_ether/rte_ethdev.c +1 -1
@@ -184,7 +184,7 @@ rte_eth_dev_data_alloc(void)
 	if (rte_eal_process_type() == RTE_PROC_PRIMARY){
 		mz = rte_memzone_reserve(MZ_RTE_ETH_DEV_DATA,
 				RTE_MAX_ETHPORTS * sizeof(*rte_eth_dev_data),
-				rte_socket_id(), flags);
+				rte_lcore_to_socket_id(rte_get_master_lcore()), flags);