diff mbox

[API-NEXT,v4,2/3] linux-generic: pool: implement user area init support

Message ID 1439578544-12730-2-git-send-email-zoltan.kiss@linaro.org
State Accepted
Commit 2eb52b7277bb2e0d83e27505d8af4d2ce15fa76a
Headers show

Commit Message

Zoltan Kiss Aug. 14, 2015, 6:55 p.m. UTC
Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org>
---
v4:
- fix function pointer call
- add newline after declarations

 platform/linux-generic/odp_pool.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
diff mbox

Patch

diff --git a/platform/linux-generic/odp_pool.c b/platform/linux-generic/odp_pool.c
index 14221fd..028f0be 100644
--- a/platform/linux-generic/odp_pool.c
+++ b/platform/linux-generic/odp_pool.c
@@ -140,6 +140,15 @@  int odp_pool_term_local(void)
 	return 0;
 }
 
+static void packet_uarea_init(odp_pool_param_t *params, odp_buffer_hdr_t *tmp)
+{
+	if (params->type == ODP_POOL_PACKET && params->pkt.uarea_init) {
+		odp_packet_t pkt = _odp_packet_from_buffer(odp_hdr_to_buf(tmp));
+
+		params->pkt.uarea_init(pkt, params->pkt.uarea_init_arg);
+	}
+}
+
 /**
  * Pool creation
  */
@@ -360,6 +369,8 @@  odp_pool_t odp_pool_create(const char *name, odp_pool_param_t *params)
 				}
 			}
 
+			packet_uarea_init(params, tmp);
+
 			/* Push buffer onto pool's freelist */
 			ret_buf(&pool->s, tmp);
 			buf  -= buf_stride;