diff options
Diffstat (limited to 'platform/linux-dpdk')
-rw-r--r-- | platform/linux-dpdk/Makefile.am | 4 | ||||
-rw-r--r-- | platform/linux-dpdk/include/odp_config_internal.h | 7 | ||||
-rw-r--r-- | platform/linux-dpdk/odp_queue_basic.c | 80 | ||||
-rw-r--r-- | platform/linux-dpdk/odp_queue_spsc.c | 2 |
4 files changed, 57 insertions, 36 deletions
diff --git a/platform/linux-dpdk/Makefile.am b/platform/linux-dpdk/Makefile.am index 62134db9c..0b75c6308 100644 --- a/platform/linux-dpdk/Makefile.am +++ b/platform/linux-dpdk/Makefile.am @@ -110,7 +110,7 @@ noinst_HEADERS = \ ${top_srcdir}/platform/linux-generic/include/odp_pkt_queue_internal.h \ include/odp_pool_internal.h \ include/odp_posix_extensions.h \ - ${top_srcdir}/platform/linux-generic/include/odp_queue_internal.h \ + ${top_srcdir}/platform/linux-generic/include/odp_queue_basic_internal.h \ ${top_srcdir}/platform/linux-generic/include/odp_queue_if.h \ ${top_srcdir}/platform/linux-generic/include/odp_queue_lf.h \ ${top_srcdir}/platform/linux-generic/include/odp_ring_internal.h \ @@ -232,7 +232,7 @@ endif if ARCH_IS_AARCH64 __LIB__libodp_linux_la_SOURCES += arch/default/odp_cpu_cycles.c \ arch/aarch64/odp_global_time.c \ - arch/default/odp_sysinfo_parse.c + arch/aarch64/odp_sysinfo_parse.c odpapiabiarchinclude_HEADERS += arch/default/odp/api/abi/cpu_inlines.h \ arch/default/odp/api/abi/cpu_time.h if !ODP_ABI_COMPAT diff --git a/platform/linux-dpdk/include/odp_config_internal.h b/platform/linux-dpdk/include/odp_config_internal.h index db24e6e2d..b200f3819 100644 --- a/platform/linux-dpdk/include/odp_config_internal.h +++ b/platform/linux-dpdk/include/odp_config_internal.h @@ -12,6 +12,11 @@ extern "C" { #endif /* + * Maximum number of CPUs supported. Maximum CPU ID is CONFIG_NUM_CPU - 1. + */ +#define CONFIG_NUM_CPU 256 + +/* * Maximum number of pools */ #define ODP_CONFIG_POOLS 256 @@ -117,7 +122,7 @@ extern "C" { * 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 +#define CONFIG_BURST_SIZE 32 /* * Maximum number of events in a pool diff --git a/platform/linux-dpdk/odp_queue_basic.c b/platform/linux-dpdk/odp_queue_basic.c index 1d20d5af5..2a33e1942 100644 --- a/platform/linux-dpdk/odp_queue_basic.c +++ b/platform/linux-dpdk/odp_queue_basic.c @@ -7,7 +7,7 @@ #include "config.h" #include <odp/api/queue.h> -#include <odp_queue_internal.h> +#include <odp_queue_basic_internal.h> #include <odp_queue_if.h> #include <odp/api/std_types.h> #include <odp/api/align.h> @@ -341,7 +341,7 @@ static odp_queue_t queue_create(const char *name, return handle; } -void sched_cb_queue_destroy_finalize(uint32_t queue_index) +void sched_queue_destroy_finalize(uint32_t queue_index) { queue_entry_t *queue = qentry_from_index(queue_index); @@ -354,7 +354,7 @@ void sched_cb_queue_destroy_finalize(uint32_t queue_index) UNLOCK(queue); } -void sched_cb_queue_set_status(uint32_t queue_index, int status) +void sched_queue_set_status(uint32_t queue_index, int status) { queue_entry_t *queue = qentry_from_index(queue_index); @@ -538,40 +538,21 @@ static int queue_enq(odp_queue_t handle, odp_event_t ev) return queue->s.enqueue(queue, (odp_buffer_hdr_t *)(uintptr_t)ev); } -static inline int deq_multi(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr[], - int num, int update_status) +static inline int plain_queue_deq(queue_entry_t *queue, + odp_buffer_hdr_t *buf_hdr[], int num) { - int status_sync = sched_fn->status_sync; int num_deq; LOCK(queue); if (odp_unlikely(queue->s.status < QUEUE_STATUS_READY)) { - /* Bad queue, or queue has been destroyed. - * Scheduler finalizes queue destroy after this. */ + /* Bad queue, or queue has been destroyed. */ UNLOCK(queue); return -1; } num_deq = ring_st_deq_multi(queue->s.ring_st, (void **)buf_hdr, num); - if (num_deq == 0) { - /* Already empty queue */ - if (update_status && queue->s.status == QUEUE_STATUS_SCHED) { - queue->s.status = QUEUE_STATUS_NOTSCHED; - - if (status_sync) - sched_fn->unsched_queue(queue->s.index); - } - - UNLOCK(queue); - - return 0; - } - - if (status_sync && queue->s.type == ODP_QUEUE_TYPE_SCHED) - sched_fn->save_context(queue->s.index); - UNLOCK(queue); return num_deq; @@ -582,7 +563,7 @@ static int queue_int_deq_multi(void *q_int, odp_buffer_hdr_t *buf_hdr[], { queue_entry_t *queue = q_int; - return deq_multi(queue, buf_hdr, num, 0); + return plain_queue_deq(queue, buf_hdr, num); } static odp_buffer_hdr_t *queue_int_deq(void *q_int) @@ -591,7 +572,7 @@ static odp_buffer_hdr_t *queue_int_deq(void *q_int) odp_buffer_hdr_t *buf_hdr = NULL; int ret; - ret = deq_multi(queue, &buf_hdr, 1, 0); + ret = plain_queue_deq(queue, &buf_hdr, 1); if (ret == 1) return buf_hdr; @@ -760,15 +741,50 @@ static int queue_info(odp_queue_t handle, odp_queue_info_t *info) return 0; } -int sched_cb_queue_deq_multi(uint32_t queue_index, odp_event_t ev[], int num, - int update_status) +int sched_queue_deq(uint32_t queue_index, odp_event_t ev[], int max_num, + int update_status) { - queue_entry_t *qe = qentry_from_index(queue_index); + int num_deq; + ring_st_t ring_st; + queue_entry_t *queue = qentry_from_index(queue_index); + int status_sync = sched_fn->status_sync; + + ring_st = queue->s.ring_st; - return deq_multi(qe, (odp_buffer_hdr_t **)ev, num, update_status); + LOCK(queue); + + if (odp_unlikely(queue->s.status < QUEUE_STATUS_READY)) { + /* Bad queue, or queue has been destroyed. + * Scheduler finalizes queue destroy after this. */ + UNLOCK(queue); + return -1; + } + + num_deq = ring_st_deq_multi(ring_st, (void **)ev, max_num); + + if (num_deq == 0) { + /* Already empty queue */ + if (update_status && queue->s.status == QUEUE_STATUS_SCHED) { + queue->s.status = QUEUE_STATUS_NOTSCHED; + + if (status_sync) + sched_fn->unsched_queue(queue->s.index); + } + + UNLOCK(queue); + + return 0; + } + + if (status_sync && queue->s.type == ODP_QUEUE_TYPE_SCHED) + sched_fn->save_context(queue->s.index); + + UNLOCK(queue); + + return num_deq; } -int sched_cb_queue_empty(uint32_t queue_index) +int sched_queue_empty(uint32_t queue_index) { queue_entry_t *queue = qentry_from_index(queue_index); int ret = 0; diff --git a/platform/linux-dpdk/odp_queue_spsc.c b/platform/linux-dpdk/odp_queue_spsc.c index 9ee6f5b03..89915eb9a 100644 --- a/platform/linux-dpdk/odp_queue_spsc.c +++ b/platform/linux-dpdk/odp_queue_spsc.c @@ -4,7 +4,7 @@ * SPDX-License-Identifier: BSD-3-Clause */ #include <odp/api/hints.h> -#include <odp_queue_internal.h> +#include <odp_queue_basic_internal.h> #include "config.h" #include <odp_debug_internal.h> |