From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
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 <dev@dpdk.org>; Thu,  2 Jun 2022 09:49:16 +0200 (CEST)
Received: by mail-qv1-f47.google.com with SMTP id ea7so3058570qvb.12
 for <dev@dpdk.org>; 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 <jerinjacobk@gmail.com>
Date: Thu, 2 Jun 2022 13:18:49 +0530
Message-ID: <CALBAE1NaDm_cTkbch4CNPiarnFHKqPZyyCVxq59UadaSuaPOEQ@mail.gmail.com>
Subject: Re: [PATCH] examples/l2fwd: add check of Rx packets count
To: Rahul Bhansali <rbhansali@marvell.com>
Cc: dpdk-dev <dev@dpdk.org>, Bruce Richardson <bruce.richardson@intel.com>, 
 Thomas Monjalon <thomas@monjalon.net>, Ferruh Yigit <ferruh.yigit@xilinx.com>, 
 Ajit Khaparde <ajit.khaparde@broadcom.com>, Andrew Boyer <aboyer@pensando.io>, 
 Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
 Beilei Xing <beilei.xing@intel.com>, 
 Chas Williams <chas3@att.com>, "Xia, Chenbo" <chenbo.xia@intel.com>, 
 Ciara Loftus <ciara.loftus@intel.com>,
 Devendra Singh Rawat <dsinghrawat@marvell.com>, 
 Ed Czeck <ed.czeck@atomicrules.com>, Evgeny Schemeilin <evgenys@amazon.com>, 
 Gaetan Rivet <grive@u256.net>, Gagandeep Singh <g.singh@nxp.com>,
 Guoyang Zhou <zhouguoyang@huawei.com>, 
 Haiyue Wang <haiyue.wang@intel.com>, Harman Kalra <hkalra@marvell.com>,
 heinrich.kuhn@corigine.com, 
 Hemant Agrawal <hemant.agrawal@nxp.com>, Hyong Youb Kim <hyonkim@cisco.com>, 
 Igor Chauskin <igorch@amazon.com>, Igor Russkikh <irusskikh@marvell.com>, 
 Jakub Grajciar <jgrajcia@cisco.com>,
 Jasvinder Singh <jasvinder.singh@intel.com>, 
 Jian Wang <jianwang@trustnetic.com>, Jiawen Wu <jiawenwu@trustnetic.com>, 
 Jingjing Wu <jingjing.wu@intel.com>, John Daley <johndale@cisco.com>, 
 John Miller <john.miller@atomicrules.com>,
 "John W. Linville" <linville@tuxdriver.com>, 
 "Wiles, Keith" <keith.wiles@intel.com>, Kiran Kumar K <kirankumark@marvell.com>,
 Lijun Ou <oulijun@huawei.com>, Liron Himi <lironh@marvell.com>,
 Long Li <longli@microsoft.com>, 
 Marcin Wojtas <mw@semihalf.com>, Martin Spinler <spinler@cesnet.cz>,
 Matan Azrad <matan@nvidia.com>, Matt Peters <matt.peters@windriver.com>,
 Maxime Coquelin <maxime.coquelin@redhat.com>, 
 Michal Krawczyk <mk@semihalf.com>, "Min Hu (Connor" <humin29@huawei.com>, 
 Pradeep Kumar Nalla <pnalla@marvell.com>,
 Nithin Dabilpuram <ndabilpuram@marvell.com>, 
 Qiming Yang <qiming.yang@intel.com>, Qi Zhang <qi.z.zhang@intel.com>, 
 Radha Mohan Chintakuntla <radhac@marvell.com>,
 Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>, 
 Rasesh Mody <rmody@marvell.com>, Rosen Xu <rosen.xu@intel.com>, 
 Sachin Saxena <sachin.saxena@oss.nxp.com>, 
 Satha Koteswara Rao Kottidi <skoteshwar@marvell.com>,
 Shahed Shaikh <shshaikh@marvell.com>, Shai Brandes <shaibran@amazon.com>,
 Shepard Siegel <shepard.siegel@atomicrules.com>, 
 Somalapuram Amaranath <asomalap@amd.com>,
 Somnath Kotur <somnath.kotur@broadcom.com>, 
 Stephen Hemminger <sthemmin@microsoft.com>,
 Steven Webster <steven.webster@windriver.com>, 
 Sunil Kumar Kori <skori@marvell.com>, Tetsuya Mukawa <mtetsuyah@gmail.com>, 
 Veerasenareddy Burru <vburru@marvell.com>,
 Viacheslav Ovsiienko <viacheslavo@nvidia.com>, 
 Xiao Wang <xiao.w.wang@intel.com>, Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>,
 Yisen Zhuang <yisen.zhuang@huawei.com>, Yong Wang <yongwang@vmware.com>, 
 Ziyang Xuan <xuanziyang2@huawei.com>
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 <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org

On Wed, May 25, 2022 at 2:44 PM Rahul Bhansali <rbhansali@marvell.com> 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 <rbhansali@marvell.com>

Acked-by: Jerin Jacob <jerinj@marvell.com>


> ---
>  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
>