summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikhil Rao <nikhil.rao@intel.com>2019-05-22 03:22:53 +0530
committerJerin Jacob <jerinj@marvell.com>2019-06-13 20:12:42 +0530
commit17b2a19cec7a191bc7f77ffaf6c657f94613e523 (patch)
tree559d1944e83e76c40bf11515466228a9c5dda592
parent557c5cbde374172c7140bc6a7cef2cc81e5a29dc (diff)
downloaddpdk-next-eventdev-17b2a19cec7a191bc7f77ffaf6c657f94613e523.zip
dpdk-next-eventdev-17b2a19cec7a191bc7f77ffaf6c657f94613e523.tar.gz
dpdk-next-eventdev-17b2a19cec7a191bc7f77ffaf6c657f94613e523.tar.xz
eventdev: remove event copy in Rx adapter
Remove copy from temporary event array on the stack to the enqueue buffer event array entry, instead initialize event in the enqueue buffer event array entry. Suggested-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com> Signed-off-by: Nikhil Rao <nikhil.rao@intel.com> Acked-by: Jerin Jacob <jerinj@marvell.com>
-rw-r--r--lib/librte_eventdev/rte_event_eth_rx_adapter.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/lib/librte_eventdev/rte_event_eth_rx_adapter.c b/lib/librte_eventdev/rte_event_eth_rx_adapter.c
index a97d198..eaf341c 100644
--- a/lib/librte_eventdev/rte_event_eth_rx_adapter.c
+++ b/lib/librte_eventdev/rte_event_eth_rx_adapter.c
@@ -716,18 +716,6 @@ rxa_enq_block_end_ts(struct rte_event_eth_rx_adapter *rx_adapter,
}
}
-/* Add event to buffer, free space check is done prior to calling
- * this function
- */
-static inline void
-rxa_buffer_event(struct rte_event_eth_rx_adapter *rx_adapter,
- struct rte_event *ev)
-{
- struct rte_eth_event_enqueue_buffer *buf =
- &rx_adapter->event_enqueue_buffer;
- rte_memcpy(&buf->events[buf->count++], ev, sizeof(struct rte_event));
-}
-
/* Enqueue buffered events to event device */
static inline uint16_t
rxa_flush_event_buffer(struct rte_event_eth_rx_adapter *rx_adapter)
@@ -770,11 +758,11 @@ rxa_buffer_mbufs(struct rte_event_eth_rx_adapter *rx_adapter,
&dev_info->rx_queue[rx_queue_id];
struct rte_eth_event_enqueue_buffer *buf =
&rx_adapter->event_enqueue_buffer;
+ struct rte_event *ev = &buf->events[buf->count];
int32_t qid = eth_rx_queue_info->event_queue_id;
uint8_t sched_type = eth_rx_queue_info->sched_type;
uint8_t priority = eth_rx_queue_info->priority;
uint32_t flow_id;
- struct rte_event events[BATCH_SIZE];
struct rte_mbuf *m = mbufs[0];
uint32_t rss_mask;
uint32_t rss;
@@ -812,7 +800,6 @@ rxa_buffer_mbufs(struct rte_event_eth_rx_adapter *rx_adapter,
for (i = 0; i < num; i++) {
m = mbufs[i];
- struct rte_event *ev = &events[i];
rss = do_rss ?
rxa_do_softrss(m, rx_adapter->rss_key_be) :
@@ -829,9 +816,10 @@ rxa_buffer_mbufs(struct rte_event_eth_rx_adapter *rx_adapter,
ev->sub_event_type = 0;
ev->priority = priority;
ev->mbuf = m;
-
- rxa_buffer_event(rx_adapter, ev);
+ ev++;
}
+
+ buf->count += num;
}
/* Enqueue packets from <port, q> to event buffer */