[dpdk-dev] [PATCH] eal: add log to print dpdk version at start

Andrew Rybchenko andrew.rybchenko at oktetlabs.ru
Wed Sep 1 08:55:31 CEST 2021


On 9/1/21 9:18 AM, Aman Singh wrote:
>>From the logs it is difficult to get the DPDK version
> that was used. So added a debug log to print the same.
> The log has been added in eal_init so it gets printed
> at startup for any application.
> 
> Signed-off-by: Aman Singh <aman.deep.singh at intel.com>
> ---
>  lib/eal/freebsd/eal.c | 2 +-
>  lib/eal/linux/eal.c   | 2 +-
>  lib/eal/windows/eal.c | 1 +
>  3 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c
> index 6cee5ae369..a14a205f4d 100644
> --- a/lib/eal/freebsd/eal.c
> +++ b/lib/eal/freebsd/eal.c
> @@ -958,7 +958,7 @@ rte_eal_init(int argc, char **argv)
>  	}
>  
>  	eal_mcfg_complete();
> -
> +	rte_log(RTE_LOG_DEBUG, RTE_LOGTYPE_EAL, "DPDK version: %s\n", rte_version());

I'd say that it should be logged as the very first message.

I'd consider INFO or even NOTICE level for the message.
INFO if we don't want to see it by default.
NOTICE if we want. I'd vote for the notice.

May be a bit out of topic, but I'm a bit surprised that
there is no common entry point for all OS and it is required
to make it in 3 places.

>  	return fctret;
>  }
>  
> diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c
> index 3577eaeaa4..a50960cc78 100644
> --- a/lib/eal/linux/eal.c
> +++ b/lib/eal/linux/eal.c
> @@ -1332,7 +1332,7 @@ rte_eal_init(int argc, char **argv)
>  	}
>  
>  	eal_mcfg_complete();
> -
> +	rte_log(RTE_LOG_DEBUG, RTE_LOGTYPE_EAL, "DPDK version: %s\n", rte_version());
>  	return fctret;
>  }
>  
> diff --git a/lib/eal/windows/eal.c b/lib/eal/windows/eal.c
> index 3d8c520412..5e6d5d8930 100644
> --- a/lib/eal/windows/eal.c
> +++ b/lib/eal/windows/eal.c
> @@ -419,6 +419,7 @@ rte_eal_init(int argc, char **argv)
>  	 */
>  	rte_eal_mp_remote_launch(sync_func, NULL, SKIP_MAIN);
>  	rte_eal_mp_wait_lcore();
> +	rte_log(RTE_LOG_DEBUG, RTE_LOGTYPE_EAL, "DPDK version: %s\n", rte_version());
>  	return fctret;
>  }
>  
> 



More information about the dev mailing list