diff mbox series

examples/l2fwd: add check of Rx packets count

Message ID 20220525091327.4006824-1-rbhansali@marvell.com (mailing list archive)
State New
Delegated to: Thomas Monjalon
Headers show
Series examples/l2fwd: add check of Rx packets count | expand

Checks

Context Check Description
ci/iol-abi-testing success Testing PASS
ci/iol-x86_64-compile-testing fail Testing issues
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/github-robot: build success github build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/intel-Testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Rahul Bhansali May 25, 2022, 9:13 a.m. UTC
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>
---
 examples/l2fwd/main.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Jerin Jacob June 2, 2022, 7:48 a.m. UTC | #1
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
>
Rahul Bhansali June 23, 2022, 11:09 a.m. UTC | #2
Ping.

> -----Original Message-----
> From: Jerin Jacob <jerinjacobk@gmail.com>
> Sent: Thursday, June 2, 2022 1:19 PM
> 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 Kokkilagadda
> <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 Kumar Dabilpuram
> <ndabilpuram@marvell.com>; Qiming Yang <qiming.yang@intel.com>; Qi Zhang
> <qi.z.zhang@intel.com>; Radha 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>
> Subject: [EXT] Re: [PATCH] examples/l2fwd: add check of Rx packets count
> 
> External Email
> 
> ----------------------------------------------------------------------
> 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
> >
Thomas Monjalon June 26, 2022, 9:12 p.m. UTC | #3
Please could we have some tests on other hardware with this improvement?


25/05/2022 11:13, Rahul Bhansali:
> 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>
> ---
>  			nb_rx = rte_eth_rx_burst(portid, 0,
>  						 pkts_burst, MAX_PKT_BURST);
>  
> +			if (unlikely(nb_rx == 0))
> +				continue;
> +
diff mbox series

Patch

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++) {