[dpdk-dev] [PATCH] lib/librte_ether: change socket_id passed to rte_memzone_reserve

Ferriter, Cian cian.ferriter at intel.com
Tue Jan 13 10:23:16 CET 2015


Passing a socket id of "rte_socket_id()" can cause problems in non DPDK applications as there is a dependency on the current logical core we are running on.
Passing " rte_lcore_to_socket_id(rte_get_master_lcore())" as the socket id to rte_memzone_reserve resolves these issues as the master lcore doesn't change.

-----Original Message-----
From: Ferriter, Cian 
Sent: Tuesday, January 13, 2015 9:22 AM
To: dev at dpdk.org
Cc: Ferriter, Cian
Subject: [PATCH] lib/librte_ether: change socket_id passed to rte_memzone_reserve

Change the socket id that is passed to rte_memzone_reserve from the socket id of current logical core to the socket id of the master_lcore.
---
 lib/librte_ether/rte_ethdev.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)  mode change 100644 => 100755 lib/librte_ether/rte_ethdev.c

diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c old mode 100644 new mode 100755 index 95f2ceb..835540d
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -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)
--
1.7.4.1



More information about the dev mailing list