diff mbox

odp_pktio_netmap: fixed odp_shm_reserve

Message ID 1411570006-22095-1-git-send-email-ciprian.barbu@linaro.org
State Accepted
Commit 0a18ba0154049af62b44c6580736d85100b6cf0d
Headers show

Commit Message

Ciprian Barbu Sept. 24, 2014, 2:46 p.m. UTC
Signed-off-by: Ciprian Barbu <ciprian.barbu@linaro.org>
---
 example/packet_netmap/odp_pktio_netmap.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

Comments

Maxim Uvarov Sept. 25, 2014, 9:58 a.m. UTC | #1
Merged, thanks!

Maxim.

On 09/24/2014 06:46 PM, Ciprian Barbu wrote:
> Signed-off-by: Ciprian Barbu <ciprian.barbu@linaro.org>
> ---
>   example/packet_netmap/odp_pktio_netmap.c | 10 +++++++---
>   1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/example/packet_netmap/odp_pktio_netmap.c b/example/packet_netmap/odp_pktio_netmap.c
> index 88af2e5..c65cc93 100644
> --- a/example/packet_netmap/odp_pktio_netmap.c
> +++ b/example/packet_netmap/odp_pktio_netmap.c
> @@ -224,6 +224,7 @@ int main(int argc, char *argv[])
>   	int thr_id;
>   	int num_workers;
>   	void *pool_base;
> +	odp_shm_t shm;
>   	int i;
>   
>   	/* Init ODP before calling anything else */
> @@ -233,7 +234,9 @@ int main(int argc, char *argv[])
>   	}
>   
>   	/* Reserve memory for args from shared mem */
> -	args = odp_shm_reserve("shm_args", sizeof(args_t), ODP_CACHE_LINE_SIZE);
> +	shm = odp_shm_reserve("shm_args", sizeof(args_t),
> +			       ODP_CACHE_LINE_SIZE, 0);
> +	args = odp_shm_addr(shm);
>   	if (args == NULL) {
>   		ODP_ERR("Error: shared mem alloc failed.\n");
>   		exit(EXIT_FAILURE);
> @@ -255,8 +258,9 @@ int main(int argc, char *argv[])
>   	odp_init_local(thr_id);
>   
>   	/* Create packet pool */
> -	pool_base = odp_shm_reserve("shm_packet_pool",
> -				    SHM_PKT_POOL_SIZE, ODP_CACHE_LINE_SIZE);
> +	shm = odp_shm_reserve("shm_packet_pool",
> +				    SHM_PKT_POOL_SIZE, ODP_CACHE_LINE_SIZE, 0);
> +	pool_base = odp_shm_addr(shm);
>   	if (pool_base == NULL) {
>   		ODP_ERR("Error: packet pool mem alloc failed.\n");
>   		exit(EXIT_FAILURE);
diff mbox

Patch

diff --git a/example/packet_netmap/odp_pktio_netmap.c b/example/packet_netmap/odp_pktio_netmap.c
index 88af2e5..c65cc93 100644
--- a/example/packet_netmap/odp_pktio_netmap.c
+++ b/example/packet_netmap/odp_pktio_netmap.c
@@ -224,6 +224,7 @@  int main(int argc, char *argv[])
 	int thr_id;
 	int num_workers;
 	void *pool_base;
+	odp_shm_t shm;
 	int i;
 
 	/* Init ODP before calling anything else */
@@ -233,7 +234,9 @@  int main(int argc, char *argv[])
 	}
 
 	/* Reserve memory for args from shared mem */
-	args = odp_shm_reserve("shm_args", sizeof(args_t), ODP_CACHE_LINE_SIZE);
+	shm = odp_shm_reserve("shm_args", sizeof(args_t),
+			       ODP_CACHE_LINE_SIZE, 0);
+	args = odp_shm_addr(shm);
 	if (args == NULL) {
 		ODP_ERR("Error: shared mem alloc failed.\n");
 		exit(EXIT_FAILURE);
@@ -255,8 +258,9 @@  int main(int argc, char *argv[])
 	odp_init_local(thr_id);
 
 	/* Create packet pool */
-	pool_base = odp_shm_reserve("shm_packet_pool",
-				    SHM_PKT_POOL_SIZE, ODP_CACHE_LINE_SIZE);
+	shm = odp_shm_reserve("shm_packet_pool",
+				    SHM_PKT_POOL_SIZE, ODP_CACHE_LINE_SIZE, 0);
+	pool_base = odp_shm_addr(shm);
 	if (pool_base == NULL) {
 		ODP_ERR("Error: packet pool mem alloc failed.\n");
 		exit(EXIT_FAILURE);