patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Olivier Matz <olivier.matz@6wind.com>
To: Hemant Agrawal <hemant.agrawal@nxp.com>
Cc: <dev@dpdk.org>, <stable@dpdk.org>, <shreyansh.jain@nxp.com>
Subject: Re: [dpdk-stable] [PATCH 2/2] mempool/dpaa2: improving the alloc/free logging
Date: Thu, 8 Jun 2017 12:08:01 +0200	[thread overview]
Message-ID: <20170608120801.1102e7bc@platinum> (raw)
In-Reply-To: <1495532028-9700-2-git-send-email-hemant.agrawal@nxp.com>

Hi Hemant,

On Tue, 23 May 2017 15:03:48 +0530, Hemant Agrawal <hemant.agrawal@nxp.com> wrote:
> Debug logs are helpful for better debugging. Alloc
> was having the logs, but logs were not present in free routines.
> 
> This patch add support for debug mode logs in free routine.
> Also, changing the log category to DRV instead of TX.
> 
> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
> ---
>  drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
> index 60dd1c0..e00ed5d 100644
> --- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
> +++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
> @@ -309,8 +309,8 @@
>  
>  #ifdef RTE_LIBRTE_DPAA2_DEBUG_DRIVER
>  	alloc += n;
> -	PMD_TX_LOG(DEBUG, "Total = %d , req = %d done = %d",
> -		   alloc, count, n);
> +	PMD_DRV_LOG(DEBUG, "Total = %d , req = %d done = %d",
> +		    alloc, count, n);
>  #endif
>  	return 0;
>  }

Since we are in a mempool driver, we may not want to use PMD_*_LOG()
functions.

Also, I don't see where these macros are defined for this file, but maybe
I miss something that is right under my nose ;)

Anyway, I suggest to use your own macros for dpaa mempool instead,
and if possible:
  - avoid compilation options as much as possible
  - RTE_LOG() for logs that cannot occur in dataplane (they can be enabled
    dynamically)
  - RTE_LOG_DP() for dataplane logs: these are stripped at compilation
    time, unless your log level <= RTE_LOG_DP_LEVEL


> @@ -320,6 +320,9 @@
>  		  void * const *obj_table, unsigned int n)
>  {
>  	struct dpaa2_bp_info *bp_info;
> +#ifdef RTE_LIBRTE_DPAA2_DEBUG_DRIVER
> +	static int freed;
> +#endif
>  
>  	bp_info = mempool_to_bpinfo(pool);
>  	if (!(bp_info->bp_list)) {
> @@ -329,6 +332,11 @@
>  	rte_dpaa2_mbuf_release(pool, obj_table, bp_info->bpid,
>  			   bp_info->meta_data_size, n);
>  
> +#ifdef RTE_LIBRTE_DPAA2_DEBUG_DRIVER
> +	freed += n;
> +	PMD_DRV_LOG(DEBUG, "Total = %d , done = %d",
> +		    freed, n);
> +#endif
>  	return 0;
>  }
>  

  reply	other threads:[~2017-06-08 10:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-23  9:33 [dpdk-stable] [PATCH 1/2] mempool/dpaa2: fix the return value for alloc fail Hemant Agrawal
2017-05-23  9:33 ` [dpdk-stable] [PATCH 2/2] mempool/dpaa2: improving the alloc/free logging Hemant Agrawal
2017-06-08 10:08   ` Olivier Matz [this message]
2017-06-22 12:46     ` Hemant Agrawal
2017-06-08  9:53 ` [dpdk-stable] [PATCH 1/2] mempool/dpaa2: fix the return value for alloc fail Olivier Matz
2017-06-22 12:48 ` [dpdk-stable] [PATCH v2 " Hemant Agrawal
2017-06-22 12:48   ` [dpdk-stable] [PATCH v2 2/2] mempool/dpaa2: fix the incorrect free usages for bplist Hemant Agrawal
2017-07-10  8:11     ` Olivier Matz
2017-07-18 14:46     ` Shreyansh Jain
2017-07-10  8:10   ` [dpdk-stable] [PATCH v2 1/2] mempool/dpaa2: fix the return value for alloc fail Olivier Matz
2017-07-18 14:47   ` Shreyansh Jain
2017-07-21  6:29     ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170608120801.1102e7bc@platinum \
    --to=olivier.matz@6wind.com \
    --cc=dev@dpdk.org \
    --cc=hemant.agrawal@nxp.com \
    --cc=shreyansh.jain@nxp.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).