diff mbox

[v2,2/3] Use shm handle in linux-dpdk

Message ID 1411469133-5211-2-git-send-email-petri.savolainen@linaro.org
State Accepted
Commit f5303f91c541b13c150c8f29e6d59d950f1d2fc6
Headers show

Commit Message

Petri Savolainen Sept. 23, 2014, 10:45 a.m. UTC
Latest shm API updates. Not tested.

Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org>
---
 platform/linux-dpdk/odp_buffer_pool.c | 10 ++++++----
 platform/linux-dpdk/odp_packet_io.c   |  9 ++++++---
 platform/linux-dpdk/odp_queue.c       |  8 +++++---
 3 files changed, 17 insertions(+), 10 deletions(-)
diff mbox

Patch

diff --git a/platform/linux-dpdk/odp_buffer_pool.c b/platform/linux-dpdk/odp_buffer_pool.c
index 894f8dd..7f28f9d 100644
--- a/platform/linux-dpdk/odp_buffer_pool.c
+++ b/platform/linux-dpdk/odp_buffer_pool.c
@@ -69,11 +69,13 @@  void *pool_entry_ptr[ODP_CONFIG_BUFFER_POOLS];
 int odp_buffer_pool_init_global(void)
 {
 	odp_buffer_pool_t i;
+	odp_shm_t shm;
 
-	pool_tbl = odp_shm_reserve("odp_buffer_pools",
-				   sizeof(pool_table_t),
-				   sizeof(pool_entry_t),
-				   0);
+	shm = odp_shm_reserve("odp_buffer_pools",
+			      sizeof(pool_table_t),
+			      sizeof(pool_entry_t), 0);
+
+	pool_tbl = odp_shm_addr(shm);
 
 	if (pool_tbl == NULL)
 		return -1;
diff --git a/platform/linux-dpdk/odp_packet_io.c b/platform/linux-dpdk/odp_packet_io.c
index ea06520..18635de 100644
--- a/platform/linux-dpdk/odp_packet_io.c
+++ b/platform/linux-dpdk/odp_packet_io.c
@@ -52,10 +52,13 @@  int odp_pktio_init_global(void)
 	queue_entry_t *queue_entry;
 	odp_queue_t qid;
 	int id;
+	odp_shm_t shm;
+
+	shm = odp_shm_reserve("odp_pktio_entries",
+			      sizeof(pktio_table_t),
+			      sizeof(pktio_entry_t), 0);
+	pktio_tbl = odp_shm_addr(shm);
 
-	pktio_tbl = odp_shm_reserve("odp_pktio_entries",
-				    sizeof(pktio_table_t),
-				    sizeof(pktio_entry_t), 0);
 	if (pktio_tbl == NULL)
 		return -1;
 
diff --git a/platform/linux-dpdk/odp_queue.c b/platform/linux-dpdk/odp_queue.c
index 5d4522a..7cc8116 100644
--- a/platform/linux-dpdk/odp_queue.c
+++ b/platform/linux-dpdk/odp_queue.c
@@ -93,12 +93,14 @@  static void queue_init(queue_entry_t *queue, const char *name,
 int odp_queue_init_global(void)
 {
 	uint32_t i;
+	odp_shm_t shm;
 
 	ODP_DBG("Queue init ... ");
 
-	queue_tbl = odp_shm_reserve("odp_queues",
-				    sizeof(queue_table_t),
-				    sizeof(queue_entry_t), 0);
+	shm = odp_shm_reserve("odp_queues",
+			      sizeof(queue_table_t),
+			      sizeof(queue_entry_t), 0);
+	queue_tbl = odp_shm_addr(shm);
 
 	if (queue_tbl == NULL)
 		return -1;