Skip to contentSkip to conversation

librte_sched: allocate memory on the given socket id

PATCH Applied Jasvinder Singh 2 participants 3 messages Sep 27, 2018 – Oct 8, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 librte_sched: allocate memory on the given socket id

Replace rte_zmalloc() with rte_zmalloc_socket() to allocate memory on the socket id provided by the application.

---
 lib/librte_sched/rte_sched.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
lib/librte_sched/rte_sched.c +2 -1
index 9269e5c71..328c983b4 100644
@@ -633,7 +633,8 @@ rte_sched_port_config(struct rte_sched_port_params *params)
 		return NULL;
 
 	/* Allocate memory to store the data structures */
-	port = rte_zmalloc("qos_params", mem_size, RTE_CACHE_LINE_SIZE);
+	port = rte_zmalloc_socket("qos_params", mem_size, RTE_CACHE_LINE_SIZE,
+		params->socket);
 	if (port == NULL)
 		return NULL;
 
Signature · 1 line
2.17.1
Acked-by on v1 1/1
#1 lore raw
Quoted 35 lines

-----Original Message-----
From: Singh, Jasvinder
Sent: Thursday, September 27, 2018 6:11 PM
To: [email protected]
Cc: Dumitrescu, Cristian <[email protected]>
Subject: [PATCH] librte_sched: allocate memory on the given socket id

Replace rte_zmalloc() with rte_zmalloc_socket() to allocate memory on the socket id provided by the application.

---
 lib/librte_sched/rte_sched.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
lib/librte_sched/rte_sched.c +2 -1
index 9269e5c71..328c983b4 100644
@@ -633,7 +633,8 @@ rte_sched_port_config(struct
 rte_sched_port_params *params)
 		return NULL;
 
 	/* Allocate memory to store the data structures */
-	port = rte_zmalloc("qos_params", mem_size,
 RTE_CACHE_LINE_SIZE);
+	port = rte_zmalloc_socket("qos_params", mem_size,
 RTE_CACHE_LINE_SIZE,
+		params->socket);
lib/librte_sched/rte_sched.c +0 -1
 	if (port == NULL)
 		return NULL;
 
--
Quoted 1 line

2.17.1

#2 lore raw
In reply to Jasvinder Singh
Quoted 35 lines

-----Original Message-----
From: Singh, Jasvinder
Sent: Thursday, September 27, 2018 6:11 PM
To: [email protected]
Cc: Dumitrescu, Cristian <[email protected]>
Subject: [PATCH] librte_sched: allocate memory on the given socket id

Replace rte_zmalloc() with rte_zmalloc_socket() to allocate memory on the socket id provided by the application.

---
 lib/librte_sched/rte_sched.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
lib/librte_sched/rte_sched.c +2 -1
index 9269e5c71..328c983b4 100644
@@ -633,7 +633,8 @@ rte_sched_port_config(struct
 rte_sched_port_params *params)
 		return NULL;
 
 	/* Allocate memory to store the data structures */
-	port = rte_zmalloc("qos_params", mem_size,
 RTE_CACHE_LINE_SIZE);
+	port = rte_zmalloc_socket("qos_params", mem_size,
 RTE_CACHE_LINE_SIZE,
+		params->socket);
lib/librte_sched/rte_sched.c +0 -1
 	if (port == NULL)
 		return NULL;
 
--
Quoted 1 line

2.17.1

Applied to next-qos tree, thanks!