From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id A68F429D2 for ; Thu, 7 Apr 2016 18:38:37 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 07 Apr 2016 09:38:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,449,1455004800"; d="scan'208";a="940462065" Received: from unknown (HELO Sent) ([10.217.248.18]) by fmsmga001.fm.intel.com with SMTP; 07 Apr 2016 09:38:35 -0700 Received: by Sent (sSMTP sendmail emulation); Thu, 07 Apr 2016 18:38:34 +0200 From: Tomasz Kulasek To: dev@dpdk.org Date: Thu, 7 Apr 2016 18:38:31 +0200 Message-Id: <1460047111-2456-1-git-send-email-tomaszx.kulasek@intel.com> X-Mailer: git-send-email 2.1.4 Subject: [dpdk-dev] [PATCH] examples: fix not all queues drained in l3fwd-* X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Apr 2016 16:38:38 -0000 In l3fwd-acl and l3fwd-power not all tx ports was included in tx_port_id array, used to periodically drain only available ports. This caused that some packets can remain in buffer when application stops to receiving packets or when size of burst is small. Fixes: e2366e74e029 ("examples: use buffered Tx") Signed-off-by: Tomasz Kulasek --- examples/l3fwd-acl/main.c | 6 +----- examples/l3fwd-power/main.c | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c index 3a895b7..55ee337 100644 --- a/examples/l3fwd-acl/main.c +++ b/examples/l3fwd-acl/main.c @@ -1893,7 +1893,6 @@ main(int argc, char **argv) unsigned lcore_id; uint32_t n_tx_queue, nb_lcores; uint8_t portid, nb_rx_queue, queue, socketid; - uint8_t nb_tx_port; /* init EAL */ ret = rte_eal_init(argc, argv); @@ -1926,7 +1925,6 @@ main(int argc, char **argv) rte_exit(EXIT_FAILURE, "app_acl_init failed\n"); nb_lcores = rte_lcore_count(); - nb_tx_port = 0; /* initialize all ports */ for (portid = 0; portid < nb_ports; portid++) { @@ -2008,12 +2006,10 @@ main(int argc, char **argv) qconf->tx_queue_id[portid] = queueid; queueid++; - qconf->n_tx_port = nb_tx_port; qconf->tx_port_id[qconf->n_tx_port] = portid; + qconf->n_tx_port++; } printf("\n"); - - nb_tx_port++; } for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) { diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c index e7ebe30..2af7731 100644 --- a/examples/l3fwd-power/main.c +++ b/examples/l3fwd-power/main.c @@ -1546,7 +1546,6 @@ main(int argc, char **argv) uint32_t n_tx_queue, nb_lcores; uint32_t dev_rxq_num, dev_txq_num; uint8_t portid, nb_rx_queue, queue, socketid; - uint8_t nb_tx_port; /* catch SIGINT and restore cpufreq governor to ondemand */ signal(SIGINT, signal_exit_now); @@ -1582,7 +1581,6 @@ main(int argc, char **argv) rte_exit(EXIT_FAILURE, "check_port_config failed\n"); nb_lcores = rte_lcore_count(); - nb_tx_port = 0; /* initialize all ports */ for (portid = 0; portid < nb_ports; portid++) { @@ -1675,12 +1673,10 @@ main(int argc, char **argv) qconf->tx_queue_id[portid] = queueid; queueid++; - qconf->n_tx_port = nb_tx_port; qconf->tx_port_id[qconf->n_tx_port] = portid; + qconf->n_tx_port++; } printf("\n"); - - nb_tx_port++; } for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) { -- 1.7.9.5