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 8B68CA0096 for ; Thu, 9 May 2019 21:22:13 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 734FC4CA6; Thu, 9 May 2019 21:22:12 +0200 (CEST) Received: from mail.lysator.liu.se (mail.lysator.liu.se [130.236.254.3]) by dpdk.org (Postfix) with ESMTP id D31534CA0 for ; Thu, 9 May 2019 21:22:10 +0200 (CEST) Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 329784000A for ; Thu, 9 May 2019 21:22:10 +0200 (CEST) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id 1DAAA40009; Thu, 9 May 2019 21:22:10 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on bernadotte.lysator.liu.se X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL autolearn=disabled version=3.4.1 X-Spam-Score: -0.9 Received: from [192.168.1.59] (host-90-232-127-248.mobileonline.telia.com [90.232.127.248]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 1E19E40006; Thu, 9 May 2019 21:22:08 +0200 (CEST) To: Nikhil Rao , jerinj@marvell.com Cc: dev@dpdk.org, matias.elo@nokia.com References: <1557376797-10609-1-git-send-email-nikhil.rao@intel.com> <1557377440-11616-1-git-send-email-nikhil.rao@intel.com> From: =?UTF-8?Q?Mattias_R=c3=b6nnblom?= Message-ID: <69c88aac-b86e-2cfc-4f13-7ab40a47fafa@ericsson.com> Date: Thu, 9 May 2019 21:22:08 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <1557377440-11616-1-git-send-email-nikhil.rao@intel.com> Content-Type: text/plain; charset="UTF-8"; format="flowed" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP Subject: Re: [dpdk-dev] [PATCH v2] eventdev: fix Rx adapter event flush logic 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" Message-ID: <20190509192208.J2OfCidvT3rYNK_VDuvzRDsuxdVIRSBqs-9Up5aX2tg@z> On 2019-05-09 06:50, Nikhil Rao wrote: > The Rx adapter flushes events only if it has BATCH_SIZE > events buffered where BATCH_SIZE is set to 32, e.g., if a > single packet is sent, it is never passed to > eventdev. Fix this issue by adding an event buffer flush > either when a Rx queue is found to be empty or the adapter service > function has processed the max number of packets for an invocation. > > Bugzilla ID: 277 > > Fixes: 6b83f5935543 ("eventdev: add event buffer flush in Rx adapter") > > Reported-by: Matias Elo > > Signed-off-by: Nikhil Rao > --- > lib/librte_eventdev/rte_event_eth_rx_adapter.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > v2: > * added Bugzilla ID > > diff --git a/lib/librte_eventdev/rte_event_eth_rx_adapter.c b/lib/librte_eventdev/rte_event_eth_rx_adapter.c > index 8d178be..fd3761b 100644 > --- a/lib/librte_eventdev/rte_event_eth_rx_adapter.c > +++ b/lib/librte_eventdev/rte_event_eth_rx_adapter.c > @@ -872,7 +872,7 @@ static uint16_t rxa_gcd_u16(uint16_t a, uint16_t b) > break; > } > > - if (buf->count >= BATCH_SIZE) > + if (buf->count) > rxa_flush_event_buffer(rx_adapter); > > return nb_rx; > After this change, is there any point in having the event_enqueue_buffer being a part of the rx_adapter struct? It could be stack allocated. In the process, you could eliminate the rte_event copying that goes on and the logic around that. Just make mbufs ETH_EVENT_BUFFER_SIZE in size, and retry until the NIC queue is empty or you accumulated ETH_EVENT_BUFFER_SIZE events. Then you ship it off to the event device.