git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
raw/ifpga: add APIs to get FPGA information
[dpdk.git]
/
lib
/
librte_eventdev
/
rte_event_ring.h
diff --git
a/lib/librte_eventdev/rte_event_ring.h
b/lib/librte_eventdev/rte_event_ring.h
index
480d1d0
..
c0861b0
100644
(file)
--- a/
lib/librte_eventdev/rte_event_ring.h
+++ b/
lib/librte_eventdev/rte_event_ring.h
@@
-1,5
+1,6
@@
/* SPDX-License-Identifier: BSD-3-Clause
* Copyright(c) 2016-2017 Intel Corporation
/* SPDX-License-Identifier: BSD-3-Clause
* Copyright(c) 2016-2017 Intel Corporation
+ * Copyright(c) 2019 Arm Limited
*/
/**
*/
/**
@@
-19,6
+20,7
@@
#include <rte_memory.h>
#include <rte_malloc.h>
#include <rte_ring.h>
#include <rte_memory.h>
#include <rte_malloc.h>
#include <rte_ring.h>
+#include <rte_ring_elem.h>
#include "rte_eventdev.h"
#define RTE_TAILQ_EVENT_RING_NAME "RTE_EVENT_RING"
#include "rte_eventdev.h"
#define RTE_TAILQ_EVENT_RING_NAME "RTE_EVENT_RING"
@@
-88,23
+90,17
@@
rte_event_ring_enqueue_burst(struct rte_event_ring *r,
const struct rte_event *events,
unsigned int n, uint16_t *free_space)
{
const struct rte_event *events,
unsigned int n, uint16_t *free_space)
{
- u
int32_t prod_head, prod_next
;
- uint32_t
free_entries
;
+ u
nsigned int num
;
+ uint32_t
space
;
- n = __rte_ring_move_prod_head(&r->r, r->r.prod.single, n,
- RTE_RING_QUEUE_VARIABLE,
- &prod_head, &prod_next, &free_entries);
- if (n == 0)
- goto end;
+ num = rte_ring_enqueue_burst_elem(&r->r, events,
+ sizeof(struct rte_event), n,
+ &space);
- ENQUEUE_PTRS(&r->r, &r[1], prod_head, events, n, struct rte_event);
- rte_smp_wmb();
-
- update_tail(&r->r.prod, prod_head, prod_next, 1);
-end:
if (free_space != NULL)
if (free_space != NULL)
- *free_space = free_entries - n;
- return n;
+ *free_space = space;
+
+ return num;
}
/**
}
/**
@@
-130,24
+126,17
@@
rte_event_ring_dequeue_burst(struct rte_event_ring *r,
struct rte_event *events,
unsigned int n, uint16_t *available)
{
struct rte_event *events,
unsigned int n, uint16_t *available)
{
- uint32_t cons_head, cons_next;
- uint32_t entries;
-
- n = __rte_ring_move_cons_head(&r->r, r->r.cons.single, n,
- RTE_RING_QUEUE_VARIABLE,
- &cons_head, &cons_next, &entries);
- if (n == 0)
- goto end;
+ unsigned int num;
+ uint32_t remaining;
- DEQUEUE_PTRS(&r->r, &r[1], cons_head, events, n, struct rte_event);
- rte_smp_rmb();
+ num = rte_ring_dequeue_burst_elem(&r->r, events,
+ sizeof(struct rte_event), n,
+ &remaining);
- update_tail(&r->r.cons, cons_head, cons_next, 1);
-
-end:
if (available != NULL)
if (available != NULL)
- *available = entries - n;
- return n;
+ *available = remaining;
+
+ return num;
}
/*
}
/*