From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from proxy.6wind.com (host.76.145.23.62.rev.coltfrance.com [62.23.145.76]) by dpdk.org (Postfix) with ESMTP id C3C126A94 for ; Mon, 30 May 2016 14:04:41 +0200 (CEST) Received: from glumotte.dev.6wind.com (unknown [10.16.0.195]) by proxy.6wind.com (Postfix) with ESMTP id A685623E49; Mon, 30 May 2016 14:04:41 +0200 (CEST) From: Olivier Matz To: dev@dpdk.org Cc: pablo.de.lara.guarch@intel.com Date: Mon, 30 May 2016 14:04:17 +0200 Message-Id: <1464609857-30162-1-git-send-email-olivier.matz@6wind.com> X-Mailer: git-send-email 2.8.0.rc3 Subject: [dpdk-dev] [PATCH] app/testpmd: log mbuf pool creation 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: Mon, 30 May 2016 12:04:41 -0000 Enhance the logs related to mbuf pool creation. Display an info level log when creating the mbuf, and display the error as a string on failure. After the patch, we have: [...] EAL: probe driver: 8086:10fb rte_ixgbe_pmd USER1: create a new mbuf pool : n=331456, \ size=2176, socket=0 EAL: Error - exiting with code: 1 Cause: Creation of mbuf pool for socket 0 failed: Cannot allocate \ memory Signed-off-by: Olivier Matz --- app/test-pmd/testpmd.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 9d11830..a585aad 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -49,6 +49,7 @@ #include #include +#include #include #include #include @@ -415,6 +416,10 @@ mbuf_pool_create(uint16_t mbuf_seg_size, unsigned nb_mbuf, mb_size = sizeof(struct rte_mbuf) + mbuf_seg_size; mbuf_poolname_build(socket_id, pool_name, sizeof(pool_name)); + RTE_LOG(INFO, USER1, + "create a new mbuf pool <%s>: n=%u, size=%u, socket=%u\n", + pool_name, nb_mbuf, mbuf_seg_size, socket_id); + #ifdef RTE_LIBRTE_PMD_XENVIRT rte_mp = rte_mempool_gntalloc_create(pool_name, nb_mbuf, mb_size, (unsigned) mb_mempool_cache, @@ -446,8 +451,9 @@ mbuf_pool_create(uint16_t mbuf_seg_size, unsigned nb_mbuf, } if (rte_mp == NULL) { - rte_exit(EXIT_FAILURE, "Creation of mbuf pool for socket %u " - "failed\n", socket_id); + rte_exit(EXIT_FAILURE, + "Creation of mbuf pool for socket %u failed: %s\n", + socket_id, rte_strerror(rte_errno)); } else if (verbose_level > 0) { rte_mempool_dump(stdout, rte_mp); } -- 2.8.0.rc3