From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 15B9FA0544; Thu, 2 Jun 2022 09:49:18 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0139A40694; Thu, 2 Jun 2022 09:49:18 +0200 (CEST) Received: from mail-qv1-f47.google.com (mail-qv1-f47.google.com [209.85.219.47]) by mails.dpdk.org (Postfix) with ESMTP id A52104021E for ; Thu, 2 Jun 2022 09:49:16 +0200 (CEST) Received: by mail-qv1-f47.google.com with SMTP id ea7so3058570qvb.12 for ; Thu, 02 Jun 2022 00:49:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=pOxpvmzLd08Q9mHZgG7Iwaf+Ndc6xasne2iE3RFZcN4=; b=qW9whBPvfrDzBJ/N4dYeagzISZRg9Z/VX1/25ckiAZ/F+2+S4Hal3DG1PQejcZwmcK 9J+dXVHjuVxlIT5xKGfVm4iIdwexlHYdLO4WBEaj1Eu2niixlD6MPOGyBlh9miEgjlvL SSA1lb/8abhw4f7JjiV2ZgkVtVsdFZiiQPdUpbyDW2iDjkfWCU76xl0KEZsZuKIJfDdl LVpZhkRjOcW46/ojBpGKJssz/pUYT0dmOLkqAi91v3zwfW5ubD+VD+xYqQiBx2gbcRQb aEl7PORoVYcf7zPRTDZshxlyScpwx1nFox1a78Dq+0HHwIQ97EjQBlPOEgYnWCehDvNj 2w1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=pOxpvmzLd08Q9mHZgG7Iwaf+Ndc6xasne2iE3RFZcN4=; b=CVSkCnTLyhUXc451GTfD8eX1zitYRQcg2IC+Xa5ngHlMeyD+4/WY4uGEsFhuvs3cDM knuwz6XrPDukrbPybFjmyzCZiMUE3Ot9gqNYkv6/2Z9ndxCGIkAisuu/Efi1kKD+2ZoM cc+3SU++raAZ//+enpne+ybVxyXjIzOeJDa3MJEE2HoM5Kes7X00PPSEe/YvGVs/v0Wv vlht+H2n8WGPUuj9urDAfCpGroGY25hOvGQBgtn0lCoftoE5V0fqdS9yAA9Z9BDY8P+S /QYlxWsFCO3X/+PMtzF0LeciD0vaAZRW8NQq6ln3i8KHT41O54OsfHqo1VhEuizz4AFL jbiw== X-Gm-Message-State: AOAM532yPiw7ptEm0Pq1gqycBzK+kElQTAxlMF70+e7Se1fUbiT3OYXk yMcwqCIj91Q7b/vPvcjuuU0bCutI98HPI6VPBQ4JIrdmzCtlFg== X-Google-Smtp-Source: ABdhPJzRVCLLUED8lL1L3mfrC/arqHN5ql3W7Z9ZTnnSvyDuF81KvDKVMme/7wibM9SVVNRrbORfk7/1/QKTlFbVdZQ= X-Received: by 2002:ad4:5de6:0:b0:462:180d:7038 with SMTP id jn6-20020ad45de6000000b00462180d7038mr51881357qvb.16.1654156156078; Thu, 02 Jun 2022 00:49:16 -0700 (PDT) MIME-Version: 1.0 References: <20220525091327.4006824-1-rbhansali@marvell.com> In-Reply-To: <20220525091327.4006824-1-rbhansali@marvell.com> From: Jerin Jacob Date: Thu, 2 Jun 2022 13:18:49 +0530 Message-ID: Subject: Re: [PATCH] examples/l2fwd: add check of Rx packets count To: Rahul Bhansali Cc: dpdk-dev , Bruce Richardson , Thomas Monjalon , Ferruh Yigit , Ajit Khaparde , Andrew Boyer , Andrew Rybchenko , Beilei Xing , Chas Williams , "Xia, Chenbo" , Ciara Loftus , Devendra Singh Rawat , Ed Czeck , Evgeny Schemeilin , Gaetan Rivet , Gagandeep Singh , Guoyang Zhou , Haiyue Wang , Harman Kalra , heinrich.kuhn@corigine.com, Hemant Agrawal , Hyong Youb Kim , Igor Chauskin , Igor Russkikh , Jakub Grajciar , Jasvinder Singh , Jian Wang , Jiawen Wu , Jingjing Wu , John Daley , John Miller , "John W. Linville" , "Wiles, Keith" , Kiran Kumar K , Lijun Ou , Liron Himi , Long Li , Marcin Wojtas , Martin Spinler , Matan Azrad , Matt Peters , Maxime Coquelin , Michal Krawczyk , "Min Hu (Connor" , Pradeep Kumar Nalla , Nithin Dabilpuram , Qiming Yang , Qi Zhang , Radha Mohan Chintakuntla , Rahul Lakkireddy , Rasesh Mody , Rosen Xu , Sachin Saxena , Satha Koteswara Rao Kottidi , Shahed Shaikh , Shai Brandes , Shepard Siegel , Somalapuram Amaranath , Somnath Kotur , Stephen Hemminger , Steven Webster , Sunil Kumar Kori , Tetsuya Mukawa , Veerasenareddy Burru , Viacheslav Ovsiienko , Xiao Wang , Xiaoyun Wang , Yisen Zhuang , Yong Wang , Ziyang Xuan Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Wed, May 25, 2022 at 2:44 PM Rahul Bhansali wrote: > > An additional check is added to avoid extra processing if > receive packets are 0. > > Performance impact: with Marvell OCTEON TX2 platform, observed an > improvement by ~14%. > > Signed-off-by: Rahul Bhansali Acked-by: Jerin Jacob > --- > examples/l2fwd/main.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c > index 281c6b7a3f..28c498712e 100644 > --- a/examples/l2fwd/main.c > +++ b/examples/l2fwd/main.c > @@ -286,6 +286,9 @@ l2fwd_main_loop(void) > nb_rx = rte_eth_rx_burst(portid, 0, > pkts_burst, MAX_PKT_BURST); > > + if (unlikely(nb_rx == 0)) > + continue; > + > port_statistics[portid].rx += nb_rx; > > for (j = 0; j < nb_rx; j++) { > -- > 2.25.1 >