From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 8C506D586 for ; Wed, 1 Mar 2017 15:47:28 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Mar 2017 06:47:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,226,1484035200"; d="scan'208";a="1117076600" Received: from silpixa00397515.ir.intel.com (HELO silpixa00397515.ger.corp.intel.com) ([10.237.223.14]) by fmsmga001.fm.intel.com with ESMTP; 01 Mar 2017 06:47:27 -0800 From: David Hunt To: dev@dpdk.org Cc: bruce.richardson@intel.com, David Hunt Date: Wed, 1 Mar 2017 07:47:32 +0000 Message-Id: <1488354455-142764-16-git-send-email-david.hunt@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1488354455-142764-1-git-send-email-david.hunt@intel.com> References: <1487647073-129064-2-git-send-email-david.hunt@intel.com> <1488354455-142764-1-git-send-email-david.hunt@intel.com> Subject: [dpdk-dev] [PATCH v8 15/18] examples/distributor: limit number of Tx rings X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Mar 2017 14:47:28 -0000 Signed-off-by: David Hunt --- examples/distributor/main.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/examples/distributor/main.c b/examples/distributor/main.c index e9ebe5e..cf2e826 100644 --- a/examples/distributor/main.c +++ b/examples/distributor/main.c @@ -44,14 +44,15 @@ #include #include -#define RX_RING_SIZE 256 -#define TX_RING_SIZE 512 +#define RX_QUEUE_SIZE 512 +#define TX_QUEUE_SIZE 512 + #define NUM_MBUFS ((64*1024)-1) -#define MBUF_CACHE_SIZE 250 -#define BURST_SIZE 32 +#define MBUF_CACHE_SIZE 128 +#define BURST_SIZE 64 #define SCHED_RX_RING_SZ 8192 #define SCHED_TX_RING_SZ 65536 -#define RTE_RING_SZ 1024 +#define BURST_SIZE_TX 32 #define RTE_LOGTYPE_DISTRAPP RTE_LOGTYPE_USER1 @@ -134,9 +135,13 @@ static inline int port_init(uint8_t port, struct rte_mempool *mbuf_pool) { struct rte_eth_conf port_conf = port_conf_default; - const uint16_t rxRings = 1, txRings = rte_lcore_count() - 1; - int retval; + const uint16_t rxRings = 1; + uint16_t txRings = rte_lcore_count() - 1; uint16_t q; + int retval; + + if (txRings > RTE_MAX_ETHPORTS) + txRings = RTE_MAX_ETHPORTS; if (port >= rte_eth_dev_count()) return -1; @@ -146,7 +151,7 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool) return retval; for (q = 0; q < rxRings; q++) { - retval = rte_eth_rx_queue_setup(port, q, RX_RING_SIZE, + retval = rte_eth_rx_queue_setup(port, q, RX_QUEUE_SIZE, rte_eth_dev_socket_id(port), NULL, mbuf_pool); if (retval < 0) @@ -154,7 +159,7 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool) } for (q = 0; q < txRings; q++) { - retval = rte_eth_tx_queue_setup(port, q, TX_RING_SIZE, + retval = rte_eth_tx_queue_setup(port, q, TX_QUEUE_SIZE, rte_eth_dev_socket_id(port), NULL); if (retval < 0) -- 2.7.4