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.savolai...@nokia.com>
---
 platform/linux-generic/include/odp_buffer_internal.h   | 2 +-
 platform/linux-generic/include/odp_config_internal.h   | 8 ++++++++
 platform/linux-generic/include/odp_packet_io_queue.h   | 3 ++-
 platform/linux-generic/include/odp_pool_internal.h     | 2 +-
 platform/linux-generic/include/odp_queue_internal.h    | 3 ++-
 platform/linux-generic/include/odp_schedule_internal.h | 2 +-
 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 69daf94..1c09cd3 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 989ea08..b7ff610 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 5843f6a..13b79f3 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 1b95627..ca59ade 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 cb7e3f3..e223d9f 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 d6cfdb4..02637c2 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;
-- 
2.8.1

Reply via email to