diff options
author | Petri Savolainen <petri.savolainen@nokia.com> | 2016-09-15 16:39:24 +0300 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2016-09-22 19:03:08 +0300 |
commit | e858d688c3ad3ce0d0b3ea22539cac8e6ec844b7 (patch) | |
tree | 38ee2441dc00765116ea19014db8cb1d947dc208 | |
parent | 93718d4ead55bfbaa8e564c24d1f3b76e60235ce (diff) |
linux-gen: config: increase burst sizes
Added main burst size configuration option (CONFIG_BURST_SIZE),
which helps to keep various burst sizes in sync. Increased common
burst size from 8 to 16. This increases scheduled queue throughput
about 30-40%.
Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com>
Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
6 files changed, 15 insertions, 5 deletions
diff --git a/platform/linux-generic/include/odp_buffer_internal.h b/platform/linux-generic/include/odp_buffer_internal.h index 69daf94b..1c09cd36 100644 --- a/platform/linux-generic/include/odp_buffer_internal.h +++ b/platform/linux-generic/include/odp_buffer_internal.h @@ -103,7 +103,7 @@ typedef union odp_buffer_bits_t { }; } odp_buffer_bits_t; -#define BUFFER_BURST_SIZE 8 +#define BUFFER_BURST_SIZE CONFIG_BURST_SIZE /* Common buffer header */ struct odp_buffer_hdr_t { diff --git a/platform/linux-generic/include/odp_config_internal.h b/platform/linux-generic/include/odp_config_internal.h index 989ea087..b7ff610b 100644 --- a/platform/linux-generic/include/odp_config_internal.h +++ b/platform/linux-generic/include/odp_config_internal.h @@ -110,6 +110,14 @@ extern "C" { */ #define ODP_CONFIG_SHM_BLOCKS (ODP_CONFIG_POOLS + 48) +/* + * Maximum event burst size + * + * This controls the burst size on various enqueue, dequeue, etc calls. Large + * burst size improves throughput, but may degrade QoS (increase latency). + */ +#define CONFIG_BURST_SIZE 16 + #ifdef __cplusplus } #endif diff --git a/platform/linux-generic/include/odp_packet_io_queue.h b/platform/linux-generic/include/odp_packet_io_queue.h index 5843f6a4..13b79f3f 100644 --- a/platform/linux-generic/include/odp_packet_io_queue.h +++ b/platform/linux-generic/include/odp_packet_io_queue.h @@ -20,9 +20,10 @@ extern "C" { #include <odp_queue_internal.h> #include <odp_buffer_internal.h> +#include <odp_config_internal.h> /** Max nbr of pkts to receive in one burst (keep same as QUEUE_MULTI_MAX) */ -#define ODP_PKTIN_QUEUE_MAX_BURST 16 +#define ODP_PKTIN_QUEUE_MAX_BURST CONFIG_BURST_SIZE /* pktin_deq_multi() depends on the condition: */ ODP_STATIC_ASSERT(ODP_PKTIN_QUEUE_MAX_BURST >= QUEUE_MULTI_MAX, "ODP_PKTIN_DEQ_MULTI_MAX_ERROR"); diff --git a/platform/linux-generic/include/odp_pool_internal.h b/platform/linux-generic/include/odp_pool_internal.h index 1b956272..ca59ade0 100644 --- a/platform/linux-generic/include/odp_pool_internal.h +++ b/platform/linux-generic/include/odp_pool_internal.h @@ -52,7 +52,7 @@ typedef struct _odp_buffer_pool_init_t { } _odp_buffer_pool_init_t; /**< Type of buffer initialization struct */ #define POOL_MAX_LOCAL_CHUNKS 4 -#define POOL_CHUNK_SIZE 32 +#define POOL_CHUNK_SIZE (4 * CONFIG_BURST_SIZE) #define POOL_MAX_LOCAL_BUFS (POOL_MAX_LOCAL_CHUNKS * POOL_CHUNK_SIZE) struct local_cache_s { diff --git a/platform/linux-generic/include/odp_queue_internal.h b/platform/linux-generic/include/odp_queue_internal.h index cb7e3f3e..e223d9f2 100644 --- a/platform/linux-generic/include/odp_queue_internal.h +++ b/platform/linux-generic/include/odp_queue_internal.h @@ -27,8 +27,9 @@ extern "C" { #include <odp/api/align.h> #include <odp/api/hints.h> #include <odp/api/ticketlock.h> +#include <odp_config_internal.h> -#define QUEUE_MULTI_MAX 8 +#define QUEUE_MULTI_MAX CONFIG_BURST_SIZE #define QUEUE_STATUS_FREE 0 #define QUEUE_STATUS_DESTROYED 1 diff --git a/platform/linux-generic/include/odp_schedule_internal.h b/platform/linux-generic/include/odp_schedule_internal.h index d6cfdb4c..02637c2b 100644 --- a/platform/linux-generic/include/odp_schedule_internal.h +++ b/platform/linux-generic/include/odp_schedule_internal.h @@ -12,7 +12,7 @@ extern "C" { #endif /* Maximum number of dequeues */ -#define MAX_DEQ 8 +#define MAX_DEQ CONFIG_BURST_SIZE typedef struct { int thr; |