DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] examples/l2fwd: add check of Rx packets count
@ 2022-05-25  9:13 Rahul Bhansali
  2022-06-02  7:48 ` Jerin Jacob
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Rahul Bhansali @ 2022-05-25  9:13 UTC (permalink / raw)
  To: dev, Bruce Richardson
  Cc: thomas, ferruh.yigit, ajit.khaparde, aboyer, andrew.rybchenko,
	beilei.xing, chas3, chenbo.xia, ciara.loftus, dsinghrawat,
	ed.czeck, evgenys, grive, g.singh, zhouguoyang, haiyue.wang,
	hkalra, heinrich.kuhn, hemant.agrawal, hyonkim, igorch,
	irusskikh, jgrajcia, jasvinder.singh, jianwang, jiawenwu,
	jingjing.wu, johndale, john.miller, linville, keith.wiles,
	kirankumark, oulijun, lironh, longli, mw, spinler, matan,
	matt.peters, maxime.coquelin, mk, humin29, pnalla, ndabilpuram,
	qiming.yang, qi.z.zhang, radhac, rahul.lakkireddy, rmody,
	rosen.xu, sachin.saxena, skoteshwar, shshaikh, shaibran,
	shepard.siegel, asomalap, somnath.kotur, sthemmin,
	steven.webster, skori, mtetsuyah, vburru, viacheslavo,
	xiao.w.wang, cloud.wangxiaoyun, yisen.zhuang, yongwang,
	xuanziyang2, 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>
---
 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


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-11-02 15:47 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-25  9:13 [PATCH] examples/l2fwd: add check of Rx packets count Rahul Bhansali
2022-06-02  7:48 ` Jerin Jacob
2022-06-23 11:09   ` [EXT] " Rahul Bhansali
2022-06-26 21:12 ` Thomas Monjalon
2022-07-20 16:52   ` [EXT] " Rahul Bhansali
2022-09-14 10:34     ` Rahul Bhansali
2022-11-02 13:47       ` Rahul Bhansali
2022-11-02 15:29         ` Thomas Monjalon
2022-07-20 17:32 ` Stephen Hemminger
2022-11-02 14:09   ` Hemant Agrawal
2022-11-02 15:47     ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).