Skip to content

Commit

Permalink
linux-generic: pool: implementation for min and max headroom configur…
Browse files Browse the repository at this point in the history
…ation

Implements pool min and max headroom configuration

Signed-off-by: Balasubramanian Manoharan <bala.manoharan@linaro.org>
Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
  • Loading branch information
bala-manoharan authored and muvarov committed Sep 19, 2017
1 parent f2da013 commit c6ab55e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions platform/linux-generic/odp_pool.c
Expand Up @@ -356,6 +356,10 @@ static odp_pool_t pool_create(const char *name, odp_pool_param_t *params,
break;

case ODP_POOL_PACKET:
if (params->pkt.headroom > CONFIG_PACKET_HEADROOM) {
ODP_ERR("Packet headroom size not supported.");
return ODP_POOL_INVALID;
}
headroom = CONFIG_PACKET_HEADROOM;
tailroom = CONFIG_PACKET_TAILROOM;
num = params->pkt.num;
Expand Down Expand Up @@ -862,6 +866,7 @@ int odp_pool_capability(odp_pool_capability_t *capa)
capa->pkt.max_len = CONFIG_PACKET_MAX_SEGS * max_seg_len;
capa->pkt.max_num = CONFIG_POOL_MAX_NUM;
capa->pkt.min_headroom = CONFIG_PACKET_HEADROOM;
capa->pkt.max_headroom = CONFIG_PACKET_HEADROOM;
capa->pkt.min_tailroom = CONFIG_PACKET_TAILROOM;
capa->pkt.max_segs_per_pkt = CONFIG_PACKET_MAX_SEGS;
capa->pkt.min_seg_len = max_seg_len;
Expand Down Expand Up @@ -921,6 +926,7 @@ odp_pool_t odp_buffer_pool(odp_buffer_t buf)
void odp_pool_param_init(odp_pool_param_t *params)
{
memset(params, 0, sizeof(odp_pool_param_t));
params->pkt.headroom = CONFIG_PACKET_HEADROOM;
}

uint64_t odp_pool_to_u64(odp_pool_t hdl)
Expand Down

0 comments on commit c6ab55e

Please sign in to comment.