All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jiawen Wu" <jiawenwu@trustnetic.com>
To: "'Ferruh Yigit'" <ferruh.yigit@intel.com>, <dev@dpdk.org>
Cc: <stable@dpdk.org>
Subject: RE: [PATCH v2 08/12] net/ngbe: fix debug log
Date: Thu, 10 Feb 2022 16:03:54 +0800	[thread overview]
Message-ID: <004201d81e54$c0401160$40c03420$@trustnetic.com> (raw)
In-Reply-To: <d8e082be-d223-09f8-2f86-90ace1d0e800@intel.com>

On February 10, 2022 3:07 AM, Ferruh Yigit wrote:
> On 2/9/2022 10:42 AM, Jiawen Wu wrote:
> > Remove 'DEBUGFUNC' due to too many invalid debug log prints. And fix
> > that double line was added by using 'DEBUGOUT'.
> >
> > Fixes: cc934df178ab ("net/ngbe: add log and error types")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
> > ---
> >   drivers/net/ngbe/ngbe_logs.h | 11 +++++++----
> >   1 file changed, 7 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/net/ngbe/ngbe_logs.h
> > b/drivers/net/ngbe/ngbe_logs.h index fd306419e6..b7d78fb400 100644
> > --- a/drivers/net/ngbe/ngbe_logs.h
> > +++ b/drivers/net/ngbe/ngbe_logs.h
> > @@ -15,9 +15,12 @@ extern int ngbe_logtype_init;
> >   		"%s(): " fmt "\n", __func__, ##args)
> >
> >   extern int ngbe_logtype_driver;
> > -#define PMD_DRV_LOG(level, fmt, args...) \
> > +#define PMD_TLOG_DRIVER(level, fmt, args...) \
> >   	rte_log(RTE_LOG_ ## level, ngbe_logtype_driver, \
> > -		"%s(): " fmt "\n", __func__, ##args)
> > +		"%s(): " fmt, __func__, ##args)
> > +
> > +#define PMD_DRV_LOG(level, fmt, args...) \
> > +	PMD_TLOG_DRIVER(level, fmt "\n", ## args)
> >
> 
> Both 'DEBUGOUT' and 'PMD_DRV_LOG(DEBUG, ..' are in use for same thing,
> but one appends '\n' other doesn't, this is very error prune and there are
> already wrong usage in the driver.
> I think no need to add complexity for something as simple as this, what do you
> think to unify the DEBUG level macros, at least unify the line ending behavior?
> 
> 
> >   #ifdef RTE_ETHDEV_DEBUG_RX
> >   extern int ngbe_logtype_rx;
> > @@ -37,10 +40,10 @@ extern int ngbe_logtype_tx;
> >   #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
> >   #endif
> >
> > -#define TLOG_DEBUG(fmt, args...)  PMD_DRV_LOG(DEBUG, fmt, ##args)
> > +#define TLOG_DEBUG(fmt, args...)  PMD_TLOG_DRIVER(DEBUG, fmt,
> ##args)
> >
> >   #define DEBUGOUT(fmt, args...)    TLOG_DEBUG(fmt, ##args)
> >   #define PMD_INIT_FUNC_TRACE()     TLOG_DEBUG(" >>")
> 
> What is difference between 'PMD_INIT_FUNC_TRACE' and 'DEBUGFUNC'?
> As far as I can see they are for same reason, and both macros are used. If they
> are for same reason can you please unify the usage?
> 
> > -#define DEBUGFUNC(fmt)            TLOG_DEBUG(fmt)
> > +#define DEBUGFUNC(fmt)            do { } while (0)
> 
> If 'DEBUGFUNC' can be removed, why not removing from the code, instead of
> above define? This is your driver, you have full control on it.

Okay. I just realize that this is going to be a big change, so I want to keep it to a minimum.
Anyway, 'DEBUGFUNC' should be removed, because 'DEBUGOUT' already contains the function name.





  reply	other threads:[~2022-02-10  8:04 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-09 10:42 [PATCH v2 00/12] Wangxun fixes and supports Jiawen Wu
2022-02-09 10:42 ` [PATCH v2 01/12] net/ngbe: fix failed to receive packets Jiawen Wu
2022-02-09 10:42 ` [PATCH v2 02/12] net/ngbe: fix link interrupt sometimes lost Jiawen Wu
2022-02-09 10:42 ` [PATCH v2 03/12] net/ngbe: fix Tx pending Jiawen Wu
2022-02-09 19:07   ` Ferruh Yigit
2022-02-09 10:42 ` [PATCH v2 04/12] net/ngbe: fix RxTx packet statistics Jiawen Wu
2022-02-09 10:42 ` [PATCH v2 05/12] net/ngbe: optimize the PHY initialization process Jiawen Wu
2022-02-09 10:42 ` [PATCH v2 06/12] net/ngbe: add support to custom PHY interfaces Jiawen Wu
2022-02-09 10:42 ` [PATCH v2 07/12] net/ngbe: add LED OEM support Jiawen Wu
2022-02-09 19:06   ` Ferruh Yigit
2022-02-09 10:42 ` [PATCH v2 08/12] net/ngbe: fix debug log Jiawen Wu
2022-02-09 19:07   ` Ferruh Yigit
2022-02-10  8:03     ` Jiawen Wu [this message]
2022-02-10  9:02       ` Ferruh Yigit
2022-02-10  9:49         ` Jiawen Wu
2022-02-10 10:16           ` Ferruh Yigit
2022-02-11  2:02             ` Jiawen Wu
2022-02-09 10:42 ` [PATCH v2 09/12] net/txgbe: add LED OEM support Jiawen Wu
2022-02-09 10:42 ` [PATCH v2 10/12] net/txgbe: fix debug log Jiawen Wu
2022-02-09 19:07   ` Ferruh Yigit
2022-02-09 10:42 ` [PATCH v2 11/12] net/txgbe: fix to set link up and down Jiawen Wu
2022-02-09 10:42 ` [PATCH v2 12/12] net/txgbe: fix KR auto-negotiation Jiawen Wu
2022-02-09 19:06 ` [PATCH v2 00/12] Wangxun fixes and supports Ferruh Yigit
2022-02-11 13:10 ` Ferruh Yigit

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='004201d81e54$c0401160$40c03420$@trustnetic.com' \
    --to=jiawenwu@trustnetic.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.