From: Nikhil Rao Date: Tue, 21 May 2019 21:52:53 +0000 (+0530) Subject: eventdev: remove event copy in Rx adapter X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=894c373ce59e9f7b52b63d3b660bcc00121f161d;p=dpdk.git 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 Signed-off-by: Nikhil Rao Acked-by: Jerin Jacob --- diff --git a/lib/librte_eventdev/rte_event_eth_rx_adapter.c b/lib/librte_eventdev/rte_event_eth_rx_adapter.c index dd251ccafd..09b2ea6bbb 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 to event buffer */