DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] app/testpmd: log mbuf pool creation
@ 2016-05-30 12:04 Olivier Matz
  2016-05-30 19:44 ` Thomas Monjalon
  2016-06-02 14:49 ` De Lara Guarch, Pablo
  0 siblings, 2 replies; 6+ messages in thread
From: Olivier Matz @ 2016-05-30 12:04 UTC (permalink / raw)
  To: dev; +Cc: pablo.de.lara.guarch

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 <mbuf_pool_socket_0>: 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 <olivier.matz@6wind.com>
---
 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 <inttypes.h>
 
 #include <rte_common.h>
+#include <rte_errno.h>
 #include <rte_byteorder.h>
 #include <rte_log.h>
 #include <rte_debug.h>
@@ -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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] app/testpmd: log mbuf pool creation
  2016-05-30 12:04 [dpdk-dev] [PATCH] app/testpmd: log mbuf pool creation Olivier Matz
@ 2016-05-30 19:44 ` Thomas Monjalon
  2016-05-31  7:39   ` Olivier MATZ
  2016-06-02 14:49 ` De Lara Guarch, Pablo
  1 sibling, 1 reply; 6+ messages in thread
From: Thomas Monjalon @ 2016-05-30 19:44 UTC (permalink / raw)
  To: Olivier Matz; +Cc: dev, pablo.de.lara.guarch

2016-05-30 14:04, Olivier Matz:
> 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 <mbuf_pool_socket_0>: n=331456, \
>       size=2176, socket=0
>   EAL: Error - exiting with code: 1
>     Cause: Creation of mbuf pool for socket 0 failed: Cannot allocate \
>       memory

Yes printing the error reason is a good improvement.
But why the previous line is at INFO level? It looks to be a debug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] app/testpmd: log mbuf pool creation
  2016-05-30 19:44 ` Thomas Monjalon
@ 2016-05-31  7:39   ` Olivier MATZ
  2016-05-31  8:39     ` Thomas Monjalon
  0 siblings, 1 reply; 6+ messages in thread
From: Olivier MATZ @ 2016-05-31  7:39 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev, pablo.de.lara.guarch

Hi Thomas,

On 05/30/2016 09:44 PM, Thomas Monjalon wrote:
> 2016-05-30 14:04, Olivier Matz:
>> 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 <mbuf_pool_socket_0>: n=331456, \
>>       size=2176, socket=0
>>   EAL: Error - exiting with code: 1
>>     Cause: Creation of mbuf pool for socket 0 failed: Cannot allocate \
>>       memory
> 
> Yes printing the error reason is a good improvement.
> But why the previous line is at INFO level? It looks to be a debug.
>

Using INFO instead of DEBUG was done on purpose. I think the mbuf
pool parameters is a valuable information for the user running testpmd,
especially to ensure it's compatible with best performance.

If you really think it should be DEBUG, I'll submit a v2.

Regards,
Olivier

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] app/testpmd: log mbuf pool creation
  2016-05-31  7:39   ` Olivier MATZ
@ 2016-05-31  8:39     ` Thomas Monjalon
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Monjalon @ 2016-05-31  8:39 UTC (permalink / raw)
  To: Olivier MATZ; +Cc: dev, pablo.de.lara.guarch

2016-05-31 09:39, Olivier MATZ:
> Hi Thomas,
> 
> On 05/30/2016 09:44 PM, Thomas Monjalon wrote:
> > 2016-05-30 14:04, Olivier Matz:
> >> 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 <mbuf_pool_socket_0>: n=331456, \
> >>       size=2176, socket=0
> >>   EAL: Error - exiting with code: 1
> >>     Cause: Creation of mbuf pool for socket 0 failed: Cannot allocate \
> >>       memory
> > 
> > Yes printing the error reason is a good improvement.
> > But why the previous line is at INFO level? It looks to be a debug.
> >
> 
> Using INFO instead of DEBUG was done on purpose. I think the mbuf
> pool parameters is a valuable information for the user running testpmd,
> especially to ensure it's compatible with best performance.

OK, seems reasonnable.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] app/testpmd: log mbuf pool creation
  2016-05-30 12:04 [dpdk-dev] [PATCH] app/testpmd: log mbuf pool creation Olivier Matz
  2016-05-30 19:44 ` Thomas Monjalon
@ 2016-06-02 14:49 ` De Lara Guarch, Pablo
  2016-06-08 15:21   ` Thomas Monjalon
  1 sibling, 1 reply; 6+ messages in thread
From: De Lara Guarch, Pablo @ 2016-06-02 14:49 UTC (permalink / raw)
  To: Olivier Matz, dev



> -----Original Message-----
> From: Olivier Matz [mailto:olivier.matz@6wind.com]
> Sent: Monday, May 30, 2016 1:04 PM
> To: dev@dpdk.org
> Cc: De Lara Guarch, Pablo
> Subject: [PATCH] app/testpmd: log mbuf pool creation
> 
> 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 <mbuf_pool_socket_0>: 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 <olivier.matz@6wind.com>

Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] app/testpmd: log mbuf pool creation
  2016-06-02 14:49 ` De Lara Guarch, Pablo
@ 2016-06-08 15:21   ` Thomas Monjalon
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Monjalon @ 2016-06-08 15:21 UTC (permalink / raw)
  To: Olivier Matz; +Cc: dev, De Lara Guarch, Pablo

2016-06-02 14:49, De Lara Guarch, Pablo:
> From: Olivier Matz [mailto:olivier.matz@6wind.com]
> > 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 <mbuf_pool_socket_0>: 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 <olivier.matz@6wind.com>
> 
> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

Applied, thanks

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-06-08 15:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-30 12:04 [dpdk-dev] [PATCH] app/testpmd: log mbuf pool creation Olivier Matz
2016-05-30 19:44 ` Thomas Monjalon
2016-05-31  7:39   ` Olivier MATZ
2016-05-31  8:39     ` Thomas Monjalon
2016-06-02 14:49 ` De Lara Guarch, Pablo
2016-06-08 15:21   ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).