diff options
author | Matias Elo <matias.elo@nokia.com> | 2021-12-13 12:19:05 +0200 |
---|---|---|
committer | Matias Elo <matias.elo@nokia.com> | 2021-12-17 12:33:44 +0200 |
commit | 7fbfc75ef516b3f80f6c362772cf797302d7cdc6 (patch) | |
tree | a1ed9edbd456d308cee1c1f2b0a337432d0f13bc /platform/linux-dpdk/odp_queue_spsc.c | |
parent | 07e82ddd44497de2d8a993071915552e396b920a (diff) |
Port e6ac302e9 "linux-gen: buffer: use common event header"
Port original commit from linux-generic.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com>
Diffstat (limited to 'platform/linux-dpdk/odp_queue_spsc.c')
-rw-r--r-- | platform/linux-dpdk/odp_queue_spsc.c | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/platform/linux-dpdk/odp_queue_spsc.c b/platform/linux-dpdk/odp_queue_spsc.c index d07451042..dc74c9595 100644 --- a/platform/linux-dpdk/odp_queue_spsc.c +++ b/platform/linux-dpdk/odp_queue_spsc.c @@ -1,15 +1,17 @@ /* Copyright (c) 2018, Linaro Limited + * Copyright (c) 2021, Nokia * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ #include <odp/api/hints.h> -#include <odp_queue_basic_internal.h> #include <odp_debug_internal.h> +#include <odp_event_internal.h> +#include <odp_queue_basic_internal.h> static inline int spsc_enq_multi(odp_queue_t handle, - odp_buffer_hdr_t *buf_hdr[], int num) + _odp_event_hdr_t *event_hdr[], int num) { queue_entry_t *queue; ring_spsc_t ring_spsc; @@ -22,11 +24,11 @@ static inline int spsc_enq_multi(odp_queue_t handle, return -1; } - return ring_spsc_enq_multi(ring_spsc, (void **)buf_hdr, num); + return ring_spsc_enq_multi(ring_spsc, (void **)event_hdr, num); } static inline int spsc_deq_multi(odp_queue_t handle, - odp_buffer_hdr_t *buf_hdr[], int num) + _odp_event_hdr_t *event_hdr[], int num) { queue_entry_t *queue; ring_spsc_t ring_spsc; @@ -39,20 +41,20 @@ static inline int spsc_deq_multi(odp_queue_t handle, return -1; } - return ring_spsc_deq_multi(ring_spsc, (void **)buf_hdr, num); + return ring_spsc_deq_multi(ring_spsc, (void **)event_hdr, num); } -static int queue_spsc_enq_multi(odp_queue_t handle, odp_buffer_hdr_t *buf_hdr[], +static int queue_spsc_enq_multi(odp_queue_t handle, _odp_event_hdr_t *event_hdr[], int num) { - return spsc_enq_multi(handle, buf_hdr, num); + return spsc_enq_multi(handle, event_hdr, num); } -static int queue_spsc_enq(odp_queue_t handle, odp_buffer_hdr_t *buf_hdr) +static int queue_spsc_enq(odp_queue_t handle, _odp_event_hdr_t *event_hdr) { int ret; - ret = spsc_enq_multi(handle, &buf_hdr, 1); + ret = spsc_enq_multi(handle, &event_hdr, 1); if (ret == 1) return 0; @@ -60,21 +62,21 @@ static int queue_spsc_enq(odp_queue_t handle, odp_buffer_hdr_t *buf_hdr) return -1; } -static int queue_spsc_deq_multi(odp_queue_t handle, odp_buffer_hdr_t *buf_hdr[], +static int queue_spsc_deq_multi(odp_queue_t handle, _odp_event_hdr_t *event_hdr[], int num) { - return spsc_deq_multi(handle, buf_hdr, num); + return spsc_deq_multi(handle, event_hdr, num); } -static odp_buffer_hdr_t *queue_spsc_deq(odp_queue_t handle) +static _odp_event_hdr_t *queue_spsc_deq(odp_queue_t handle) { - odp_buffer_hdr_t *buf_hdr = NULL; + _odp_event_hdr_t *event_hdr = NULL; int ret; - ret = spsc_deq_multi(handle, &buf_hdr, 1); + ret = spsc_deq_multi(handle, &event_hdr, 1); if (ret == 1) - return buf_hdr; + return event_hdr; else return NULL; } |