diff options
author | Bill Fischofer <bill.fischofer@linaro.org> | 2014-12-18 15:21:49 -0600 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2014-12-22 18:14:44 +0300 |
commit | f8f50492431f350ea224129ba6c322b23d17f310 (patch) | |
tree | 2d0085463761761e1f139040b57d2edefa7b5d2b /platform/linux-generic | |
parent | 05b8dfc7e94ba26faeae79fa630e23419ee71504 (diff) |
linux-generic: enable segmented packet support
Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
Reviewed-and-tested-by: Taras Kondratiuk <taras.kondratiuk@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'platform/linux-generic')
-rw-r--r-- | platform/linux-generic/odp_buffer_pool.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/platform/linux-generic/odp_buffer_pool.c b/platform/linux-generic/odp_buffer_pool.c index 48be24f80..9561c0750 100644 --- a/platform/linux-generic/odp_buffer_pool.c +++ b/platform/linux-generic/odp_buffer_pool.c @@ -119,8 +119,8 @@ odp_buffer_pool_t odp_buffer_pool_create(const char *name, if (params == NULL) return ODP_BUFFER_POOL_INVALID; - /* Restriction for v1.0: All buffers are unsegmented */ - const int unsegmented = 1; + /* Restriction for v1.0: All non-packet buffers are unsegmented */ + int unsegmented = 1; /* Restriction for v1.0: No zeroization support */ const int zeroized = 0; @@ -163,6 +163,8 @@ odp_buffer_pool_t odp_buffer_pool_create(const char *name, case ODP_BUFFER_TYPE_ANY: headroom = ODP_CONFIG_PACKET_HEADROOM; tailroom = ODP_CONFIG_PACKET_TAILROOM; + unsegmented = params->buf_size > ODP_CONFIG_PACKET_BUF_LEN_MAX; + if (unsegmented) blk_size = ODP_ALIGN_ROUNDUP( headroom + params->buf_size + tailroom, @@ -171,6 +173,7 @@ odp_buffer_pool_t odp_buffer_pool_create(const char *name, blk_size = ODP_ALIGN_ROUNDUP( headroom + params->buf_size + tailroom, ODP_CONFIG_PACKET_BUF_LEN_MIN); + buf_stride = params->buf_type == ODP_BUFFER_TYPE_PACKET ? sizeof(odp_packet_hdr_stride) : sizeof(odp_any_hdr_stride); |