[dpdk-dev] [PATCH v2 03/17] net/ionic: add log

Ferruh Yigit ferruh.yigit at intel.com
Mon Dec 2 17:07:51 CET 2019


On 10/15/2019 9:22 AM, Alfredo Cardigliano wrote:
> Add debug options to the config file.
> Define macros used for logs and make use of config file options
> to enable them.
> 
> Signed-off-by: Alfredo Cardigliano <cardigliano at ntop.org>
> Reviewed-by: Shannon Nelson <snelson at pensando.io>
> ---
>  drivers/net/ionic/Makefile       |  2 +-
>  drivers/net/ionic/ionic_ethdev.c | 21 +++++++++++++++++++++
>  drivers/net/ionic/ionic_logs.h   | 32 ++++++++++++++++++++++++++++++++
>  drivers/net/ionic/meson.build    |  1 +
>  4 files changed, 55 insertions(+), 1 deletion(-)
>  create mode 100644 drivers/net/ionic/ionic_ethdev.c
>  create mode 100644 drivers/net/ionic/ionic_logs.h
> 

<...>

> @@ -0,0 +1,21 @@
> +/* SPDX-License-Identifier: GPL-2.0
> + * Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved.

I will stop commenting on licenses, but that needs to be resolved for all files.

> + */
> +
> +#include "ionic_logs.h"
> +
> +int ionic_logtype_init;
> +int ionic_logtype_driver;

Why two different log types are required?
Can you please put some comments on the difference of the two log types?

<...>

> @@ -0,0 +1,32 @@
> +/* SPDX-License-Identifier: GPL-2.0
> + * Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved.
> + */
> +
> +#ifndef _IONIC_LOGS_H_
> +#define _IONIC_LOGS_H_
> +
> +#include <rte_log.h>
> +
> +extern int ionic_logtype_init;
> +extern int ionic_logtype_driver;
> +
> +#define ionic_init_print(level, fmt, args...) rte_log(RTE_LOG_ ## level, \
> +		ionic_logtype_init, "%s(): " fmt "\n", __func__, ##args)
> +
> +#define ionic_init_print_call() ionic_init_print(DEBUG, " >>")

We tend to define macros as all upercase, to distinguish between the functions,
not really a requirement but I think it will be good to do for consistency.




More information about the dev mailing list