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 7209CA0547; Wed, 21 Apr 2021 14:48:56 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EEF7941AC8; Wed, 21 Apr 2021 14:48:55 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id 313CA410F9 for ; Wed, 21 Apr 2021 14:48:54 +0200 (CEST) IronPort-SDR: Iir+vdnw4G7GCtsUJHlWwfj1ZNskK+57rNrd78I/Bg9hRWGNjNnmGH1mzzds22U21eOZrD/Q5z NuhI98lkTfnw== X-IronPort-AV: E=McAfee;i="6200,9189,9960"; a="193568600" X-IronPort-AV: E=Sophos;i="5.82,238,1613462400"; d="scan'208";a="193568600" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Apr 2021 05:48:53 -0700 IronPort-SDR: zshk6yLgmQv0V/gCNZ3n4+9XjAVFhHIB4LUixubfuTGsyit82+lFHZ+tru0vem/96XNGUHqHWG EWA3+1bj8KEQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,238,1613462400"; d="scan'208";a="423536904" Received: from silpixa00400466.ir.intel.com ([10.237.213.210]) by orsmga007.jf.intel.com with ESMTP; 21 Apr 2021 05:48:50 -0700 From: Conor Walsh To: thomas@monjalon.net, konstantin.ananyev@intel.com, vladimir.medvedkin@intel.com, kathleen.capella@arm.com, honnappa.nagarahalli@arm.com Cc: dev@dpdk.org, Conor Walsh Date: Wed, 21 Apr 2021 12:48:42 +0000 Message-Id: <20210421124842.1550979-1-conor.walsh@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] examples/l3fwd: fib skip tx queue drain on first iteration 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 Sender: "dev" The commit a8f8b672d575 ("examples/l3fwd: skip Tx queue drain on first iteration") implemented a change to the em and lpm lookup methods to prevent the TX queue drain running in the first iteration of their packet processing loops. This patch introduces this change into the fib lookup method, this was done to keep the fib code aligned with the em and lpm code. Signed-off-by: Conor Walsh --- examples/l3fwd/l3fwd_fib.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/examples/l3fwd/l3fwd_fib.c b/examples/l3fwd/l3fwd_fib.c index c7d7689a94..1787229942 100644 --- a/examples/l3fwd/l3fwd_fib.c +++ b/examples/l3fwd/l3fwd_fib.c @@ -179,8 +179,6 @@ fib_main_loop(__rte_unused void *dummy) const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) / US_PER_S * BURST_TX_DRAIN_US; - prev_tsc = 0; - lcore_id = rte_lcore_id(); qconf = &lcore_conf[lcore_id]; @@ -200,9 +198,10 @@ fib_main_loop(__rte_unused void *dummy) lcore_id, portid, queueid); } - while (!force_quit) { + cur_tsc = rte_rdtsc(); + prev_tsc = cur_tsc; - cur_tsc = rte_rdtsc(); + while (!force_quit) { /* TX burst queue drain. */ diff_tsc = cur_tsc - prev_tsc; @@ -233,6 +232,8 @@ fib_main_loop(__rte_unused void *dummy) /* Use fib to lookup port IDs and transmit them. */ fib_send_packets(nb_rx, pkts_burst, portid, qconf); } + + cur_tsc = rte_rdtsc(); } return 0; -- 2.25.1