From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 135C2A05D3 for ; Wed, 22 May 2019 11:53:23 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6476814EC; Wed, 22 May 2019 11:53:22 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id A7DB610BD for ; Wed, 22 May 2019 11:53:20 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 May 2019 02:53:19 -0700 X-ExtLoop1: 1 Received: from unknown (HELO broadwell-dev-4.localdomain) ([10.224.122.193]) by FMSMGA003.fm.intel.com with ESMTP; 22 May 2019 02:53:17 -0700 From: Nikhil Rao To: jerinj@marvell.com, mattias.ronnblom@ericsson.com Cc: dev@dpdk.org, Nikhil Rao Date: Wed, 22 May 2019 03:22:53 +0530 Message-Id: <1558475573-34837-1-git-send-email-nikhil.rao@intel.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] eventdev: remove event copy in Rx adapter X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- Hi Mattias, This patch eliminates the event copy as you previously mentioned (https://patches.dpdk.org/patch/53350/), the enqueue buffer array is still retained in the rx_adapter struct, since the Rx adapter service function can return with events in the enqueue buffer that have not yet been shipped to the event device. Let me know your comments. Thanks, Nikhil lib/librte_eventdev/rte_event_eth_rx_adapter.c | 20 ++++---------------- 1 file 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 8d178be..a201668 100644 --- a/lib/librte_eventdev/rte_event_eth_rx_adapter.c +++ b/lib/librte_eventdev/rte_event_eth_rx_adapter.c @@ -715,18 +715,6 @@ static uint16_t rxa_gcd_u16(uint16_t a, uint16_t b) } } -/* 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) @@ -769,11 +757,11 @@ static uint16_t rxa_gcd_u16(uint16_t a, uint16_t b) &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; @@ -811,7 +799,6 @@ static uint16_t rxa_gcd_u16(uint16_t a, uint16_t b) 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) : @@ -828,9 +815,10 @@ static uint16_t rxa_gcd_u16(uint16_t a, uint16_t b) 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 */ -- 1.8.3.1