From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 7C0BC9AAE for ; Tue, 14 Jun 2016 17:35:55 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 14 Jun 2016 08:35:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,471,1459839600"; d="scan'208";a="987276765" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga001.fm.intel.com with ESMTP; 14 Jun 2016 08:35:53 -0700 Received: from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com [10.237.217.45]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id u5EFZqVO012305; Tue, 14 Jun 2016 16:35:53 +0100 Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id u5EFZqEC015626; Tue, 14 Jun 2016 16:35:52 +0100 Received: (from bairemon@localhost) by sivswdev01.ir.intel.com with id u5EFZqkL015621; Tue, 14 Jun 2016 16:35:52 +0100 From: Bernard Iremonger To: dev@dpdk.org Cc: pablo.de.lara.guarch@intel.com, Bernard Iremonger Date: Tue, 14 Jun 2016 16:35:41 +0100 Message-Id: <1465918542-15512-9-git-send-email-bernard.iremonger@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1465918542-15512-1-git-send-email-bernard.iremonger@intel.com> References: <1465907296-27117-1-git-send-email-bernard.iremonger@intel.com> <1465918542-15512-1-git-send-email-bernard.iremonger@intel.com> Subject: [dpdk-dev] [PATCH v5 8/9] app/testpmd: check for valid mbuf pool 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: Tue, 14 Jun 2016 15:35:56 -0000 Fixes: b6ea6408fbc7 ("ethdev: store numa_node per device") Signed-off-by: Bernard Iremonger --- app/test-pmd/testpmd.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index fa6434c..29947fd 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -1360,7 +1360,7 @@ start_port(portid_t pid) if (mp == NULL) { printf("Failed to setup RX queue:" "No mempool allocation" - "on the socket %d\n", + " on the socket %d\n", rxring_numa[pi]); return -1; } @@ -1368,17 +1368,23 @@ start_port(portid_t pid) diag = rte_eth_rx_queue_setup(pi, qi, nb_rxd,rxring_numa[pi], &(port->rx_conf),mp); - } - else + } else { + struct rte_mempool *mp = + mbuf_pool_find(port->socket_id); + if (mp == NULL) { + printf("Failed to setup RX queue:" + "No mempool allocation" + " on the socket %d\n", + port->socket_id); + return -1; + } diag = rte_eth_rx_queue_setup(pi, qi, nb_rxd,port->socket_id, - &(port->rx_conf), - mbuf_pool_find(port->socket_id)); - + &(port->rx_conf), mp); + } if (diag == 0) continue; - /* Fail to setup rx queue, return */ if (rte_atomic16_cmpset(&(port->port_status), RTE_PORT_HANDLING, -- 2.6.3